]> git.koha-community.org Git - koha.git/log
koha.git
17 months agoBug 33586: Fix sequence of fields for memberresultst in table configuration
Katrin Fischer [Fri, 21 Apr 2023 19:46:19 +0000 (19:46 +0000)]
Bug 33586: Fix sequence of fields for memberresultst in table configuration

The sequence of options actually matters, not the name.
Library and category were switched, this patch fixes it and
now it should all hide/show as expected:

* Go to administration > table configuration
* Hide library in memberresultst
* Go to patron search and search
* Verify that category was hidden instead
* Apply patch
* Verify now label and columns for library and category
  match with configuration.

Signed-off-by: Lisette Scheer <lisette.scheer@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
17 months agoBug 33673: Change "global system preferences" to "system preferences"
David Nind [Thu, 4 May 2023 20:25:01 +0000 (20:25 +0000)]
Bug 33673: Change "global system preferences" to "system preferences"

The Koha Community normally refers to "global system preferences"
as just "system preferences".

This updates the staff interface and other occurences to refelect
this, including:
- Administration > Global system preferences and the description
- Patrons > [a patron] > More > Set permissions > Manage Koha
  system settings > Manage global system preferences
  (manage_sysprefs)
- The installer files and the database (permissions table)

Test plan:
1. Note that in the staff interface "Global system preferences"
   is dispalyed in two places:
   1.1 Administration: Go to Administration. There is a section
       called "Global system preferences" with a description
       and a search box.
   1.2 User permissions: View the details for a patron > More >
       Set permissions > expand 'Manage Koha system settings' >
       scroll down to 'Manage global system preferences
       (manage_sysprefs)'
2. Apply the patch.
3. Update the database.
4. Revisit the pages in step 1 - these should now show as
   "System prefereneces" or "system preferences" as appropriate.
5. Sign off!

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Magnus Enger <magnus@libriotech.no>
I agree with this change, consistency is good. As far as I can see
this patch cathes all the occurrences of "global".
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
17 months agoBug 33356: Add mana-kb hint to reports start page
Katrin Fischer [Sun, 9 Apr 2023 11:44:21 +0000 (11:44 +0000)]
Bug 33356: Add mana-kb hint to reports start page

An alternate placement of the Mana KB hint on the reports start page.

To test:
* Go to Reports module
* Verify the hint shows when you haven't decided on Mana KB
* Once you set yes or no, it will no longer show

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
17 months agoBug 28315: Remove duplicate function definition
Philip Orr [Tue, 25 Apr 2023 10:34:09 +0000 (10:34 +0000)]
Bug 28315: Remove duplicate function definition

This patch removes the unnecessary second definition of the JS function PopupMARCFieldDoc from addbiblio.tt.
To test:
1. Apply the patch
2. Check that addbiblio.tt contains only one function definition for PopupMARCFieldDoc
3. Navigate to "Cataloging" -> "Add MARC record"
4. Check that after clicking on the question mark symbol next to any MARC field, the loc description of that MARC field is opened in a new tab

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
17 months agoBug 32232: Ignore DST when calculating patron age
David Cook [Mon, 17 Apr 2023 00:34:05 +0000 (00:34 +0000)]
Bug 32232: Ignore DST when calculating patron age

This change calculates patron age using the floating timezone, so that
datetimes missing midnight don't cause fatal errors in the comparison.

Test plan:
0. Apply patch
1. Change <timezone></timezone> in koha-conf.xml to include Canada/Eastern
2. koha-plack --restart kohadev
3. Create a patron, setting the date of birth to one of these three dates
- 1947-04-27
- 1948-04-25
- 1949-04-24
4. Save the patron
5. Patron detail page loads instead of producing fatal error

Signed-off-by: Marius Mandrescu <marius.mandrescu@inLibro.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
17 months agoBug 33696: Fix doubled up home icon in budgets page
Tomas Cohen Arazi [Mon, 8 May 2023 12:34:56 +0000 (09:34 -0300)]
Bug 33696: Fix doubled up home icon in budgets page

To test:
1. Go to the Administration > Budgets page
=> FAIL: Breadcrumbs show two little house icons
2. Apply this patch
3. Reload page
=> SUCCESS: Only one icon
4. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
17 months agoBug 33093: (Bug 27546 follow-up) With ES searching within results does not work for...
Janusz Kaczmarek [Tue, 28 Feb 2023 18:18:05 +0000 (19:18 +0100)]
Bug 33093: (Bug 27546 follow-up) With ES searching within results does not work for 'Keyword' and 'Keyword as phrase'

The feature of searching within search results in librarian
interface has some problems with with elastic: 'Keyword' and
'Keyword as phrase' searches give no results.  This is because
elastic is unaware of the search field 'kw' and 'kw' is not
transformed nor removed for limits.

Test plan
=========
1. Have a Koha instance with reasonable number of biblio records
1. Set SearchEngine to Elasticsearch
3. In librarian interface, perform a search that would give
   you a list of results
4. With the new search box 'Search within results', having 'Keyword'
   and 'Keyword as phrase' active, try to perform a search within
   search results with a term that should give you some results
5. You should get no results
6. Apply the patch
7. Repeat steps 3 and 4
8. You should get expected results.  Note the difference between
   'Keyword' and 'Keyword as phrase' in results
9. Sign off

Signed-off-by: Emmi Takkinen <emmi.takkinen@koha-suomi.fi>
Signed-off-by: Nick <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
17 months agoBug 33601: Use template wrapper for breadcrumbs: Tools, part 8
Owen Leonard [Mon, 24 Apr 2023 11:22:32 +0000 (11:22 +0000)]
Bug 33601: Use template wrapper for breadcrumbs: Tools, part 8

This patch updates several templates in the tools directory so that they
use the new WRAPPER for displaying breadcrumbs.

To test, apply the patch and test each page and its variations.
Breadcrumbs should look correct, and each link should be correct.

- Tools ->
  - Tools home page
    - Log viewer
      - Search result
    - Uploads
      - Upload results
- Cataloging ->
  - Upload local cover image
    - Upload result
    - Test uploading an biblio-level image from the bibliographic detail
      page
    - Test uploading an item-level image from the bibliograhpic detail
      page's holdings table

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>
17 months agoBug 33600: Use template wrapper for breadcrumbs: Tools, part 7
Owen Leonard [Mon, 24 Apr 2023 11:24:58 +0000 (11:24 +0000)]
Bug 33600: Use template wrapper for breadcrumbs: Tools, part 7

This patch updates several templates in the tools directory so that they
use the new WRAPPER for displaying breadcrumbs.

To test, apply the patch and test each page and its variations.
Breadcrumbs should look correct, and each link should be correct.

- Tools ->
  - Task scheduler
- Cataloging ->
  - Stage MARC records for import (use a batch of MARC records which
    will match existing records)
    - View batch ->
      - View diff of records with a match
  - Stock rotation (must have StockRotation enabled)
    - New rota
    - Edit rota
    - Manage stages
    - Manage items

Signed-off-by: Andrew Auld <andrew.auld@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
17 months agoBug 33643: Add page-section to 'scan index' page in staff interface
Katrin Fischer [Mon, 1 May 2023 13:26:55 +0000 (13:26 +0000)]
Bug 33643: Add page-section to 'scan index' page in staff interface

This adds the white background. As we do on other pages I have
chosen to include the h2 heading within the page-section.

To test:
* Go to advanced search in staff interface
* Activate 'More options'
* Check checkbox for scan indexes
* Switch to author (especially when using Elasticsearch)
* Search for C
* On the result list verify there is no white background/page section
* Apply patch
* Repeat test - background should be present now

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Nicolas Giraud <nicolas.giraud@inlibro.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
17 months agoBug 31799: (follow-up) Add 409 error to spec
Nick Clemens [Tue, 24 Jan 2023 19:11:08 +0000 (19:11 +0000)]
Bug 31799: (follow-up) Add 409 error to spec

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
17 months agoBug 31799: (follow-up) Tidy up and fix duplicate barcode handling
Agustin Moyano [Tue, 3 Jan 2023 19:09:10 +0000 (16:09 -0300)]
Bug 31799: (follow-up) Tidy up and fix duplicate barcode handling

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
17 months agoBug 31799: Add REST endpoint to modify a biblio's item
Agustin Moyano [Mon, 2 Jan 2023 14:44:05 +0000 (11:44 -0300)]
Bug 31799: Add REST endpoint to modify a biblio's item

To test:
1. Apply patch
2. Set RESTBasicAuth preference to true
3. Get a biblio with an item
4. Make a PUT request to /api/v1/biblios/:biblio_id/items/:item_id with a json body that represents an item to replace
5. Check that the item was modified
6. Sign off

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
17 months agoBug 33069: Fix error in MARC download for OPAC lists
Katrin Fischer [Wed, 3 May 2023 21:28:30 +0000 (21:28 +0000)]
Bug 33069: Fix error in MARC download for OPAC lists

There was a code typo causing an error when you tried
to download a list in MARC format:

Not a CODE reference at /kohadevbox/koha/opac/opac-downloadshelf.pl line 93

To test:
* In the OPAC: create a new list, public or private, with some records
* Open the list
* Try to download the list as MARC
* Verify you get an error
* Apply patch
* Verify you now get the expected download file
* Sign off :)

Co-authored-by: Kévin AYRAULT <kevin.ayrault87@gmail.com>
Signed-off-by: Magnus Enger <magnus@libriotech.no>
Nasty error before the patch; nice, tasty MARC download after.
Signed-off-by: Hinemoea Viault <hinemoea.viault@inlibro.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
18 months agoBug 33104: Add koha_object_class(s) definitions
Tomas Cohen Arazi [Fri, 5 May 2023 20:41:20 +0000 (17:41 -0300)]
Bug 33104: Add koha_object_class(s) definitions

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
18 months agoBug 22440: (follow-up) Fix existing tests
Tomas Cohen Arazi [Fri, 5 May 2023 19:22:20 +0000 (16:22 -0300)]
Bug 22440: (follow-up) Fix existing tests

As we are introducing a FK for illrequests.biblio_id, TestBuilder is
generating a linked biblio, and so tests expecting undef are failing.

This fixes it by explicitly setting biblio_id => undef on creating the
request.

The patch also cleans the area a bit, removing a redundant and fragile
test as well.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
18 months agoBug 31798: (QA follow-up) Fix tests permissions
Tomas Cohen Arazi [Fri, 5 May 2023 19:07:41 +0000 (16:07 -0300)]
Bug 31798: (QA follow-up) Fix tests permissions

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
18 months agoBug 22440: (follow-up) Nothing is forever
Tomas Cohen Arazi [Fri, 5 May 2023 18:53:31 +0000 (15:53 -0300)]
Bug 22440: (follow-up) Nothing is forever

This patch picks (yet) another class for testing purposes. The class
needs to not implement to_api() and to_api_mapping().

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
18 months agoBug 33102: Display fields from biblioitems in OPAC/staff interface cart
Frédéric Demians [Wed, 1 Mar 2023 09:25:04 +0000 (10:25 +0100)]
Bug 33102: Display fields from biblioitems in OPAC/staff interface cart

The OPAC/PRO cart only displays biblio fields coming from 'biblio'
table. Fields from biblioitems table aren't displayed anymore.

TO TEST:

1. Populate a cart in OPAC/staff interface and display it.
2. You can see that Year column is empty (if you don't have copyright
   field). And other fields.
3. Apply the patch.
4. You can see more fields in cart simple/detailed view.

Signed-off-by: Magnus Enger <magnus@libriotech.no>
Tested by having a record with:
- biblio.copyrightdate = NULL
- biblioitems.publicationyear = 2025
Without the patch, no year is shown in the cart. With the patch, 2025 is shown.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
18 months agoBug 31798: (QA follow-up) Remove use Koha::Item, we already use Koha::Items
Kyle M Hall [Fri, 5 May 2023 14:58:41 +0000 (10:58 -0400)]
Bug 31798: (QA follow-up) Remove use Koha::Item, we already use Koha::Items

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
18 months agoBug 31798: (follow-up) Handle all values of autoBarcode
Nick Clemens [Wed, 3 May 2023 15:08:46 +0000 (12:08 -0300)]
Bug 31798: (follow-up) Handle all values of autoBarcode

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
18 months agoBug 31798: (follow-up) Tidy up and add duplicate barcode test
Agustin Moyano [Tue, 3 Jan 2023 15:12:39 +0000 (12:12 -0300)]
Bug 31798: (follow-up) Tidy up and add duplicate barcode test

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
18 months agoBug 31798: Add REST endpoint to add a biblio's item
Agustin Moyano [Fri, 30 Dec 2022 15:18:37 +0000 (12:18 -0300)]
Bug 31798: Add REST endpoint to add a biblio's item

To test:
1. Apply patch
2. Set RESTBasicAuth preference to true
3. Get a biblio
4. Make a POST request to /api/v1/biblios/:biblio_id/items with a json body that represents the new item
5. Check that the item is created
6. Sign off

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
18 months agoBug 33053: DBRev 22.12.00.030
Tomas Cohen Arazi [Fri, 5 May 2023 17:57:37 +0000 (14:57 -0300)]
Bug 33053: DBRev 22.12.00.030

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
18 months agoBug 33053: (QA follow-up) fix syntax error
Aleisha Amohia [Fri, 28 Apr 2023 04:08:13 +0000 (04:08 +0000)]
Bug 33053: (QA follow-up) fix syntax error

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
18 months agoBug 33053: Remove default value for tables item_groups and recalls
Kyle Hall [Thu, 23 Feb 2023 13:31:46 +0000 (08:31 -0500)]
Bug 33053: Remove default value for tables item_groups and recalls

These default biblio_ids of 0 are harmless but incorrect. The default values should be removed.

Test Plan:
1) Apply this patch
2) prove t/db_dependent/Koha/Biblio.t
3) prove t/db_dependent/Koha/Recalls.t

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
18 months agoBug 33637: Update tab ids for batch modification form
Nick Clemens [Fri, 28 Apr 2023 15:56:54 +0000 (15:56 +0000)]
Bug 33637: Update tab ids for batch modification form

This patch adjusts the ids in the submit function

To test:
1 - Browse to tools -> Batch patron modification
2 - Enter cardnumbers and submit
3 - No patrons
4 - Enter borrowernumbers and submit
5 - No patrons
6 - Apply patch
7 - Repeat
8 - Success, patrons are listed

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
18 months agoBug 33233: Don't allow disabled attribute to remain when using browser's back button
Lucas Gass [Tue, 11 Apr 2023 20:41:28 +0000 (20:41 +0000)]
Bug 33233: Don't allow disabled attribute to remain when using browser's back button

To test:
1. Go to OPAC advanced search and do a search using only one of the inputs.
2. Once the search is complete use the browser's back button to return to the advanced search.
3. Notice the unused inputs are disabled.
4. Apply patch and try again. Now the inputs should not be disabled.

Signed-off-by: Barbara Johnson <barbara.johnson@bedfordtx.gov>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
18 months agoBug 33582: Use template wrapper for breadcrumbs: Tools, part 4
Owen Leonard [Mon, 24 Apr 2023 10:51:50 +0000 (10:51 +0000)]
Bug 33582: Use template wrapper for breadcrumbs: Tools, part 4

This patch updates several templates in the tools directory so that they
use the new WRAPPER for displaying breadcrumbs.

To test, apply the patch and test each page and its variations.
Breadcrumbs should look correct, and each link should be correct.

- Tools ->
  - Notices and slips
    - New notice
    - Edit notice
    - Confirm deletion
  - Batch patron modification
  - Overdue notice/status triggers
- Cataloging ->
  - Manage staged records
    - Batch details
  - MARC modification templates
    - Edit actions for a template

Signed-off-by: Barbara Johnson <barbara.johnson@bedfordtx.gov>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
18 months agoBug 33532: Fix HTML page title for cataloging concerns page
David Nind [Thu, 13 Apr 2023 18:40:23 +0000 (18:40 +0000)]
Bug 33532: Fix HTML page title for cataloging concerns page

The HTML title of the Catalog concerns management page (which
appears in the browser tab) says Catalog concerns > Tools >
Koha. But the page is under Cataloging, not Tools.

Test plan:
1. Enable the CatalogConcerns system preference.
2. Go to Cataloging > Catalog concerns:
   => The title of the page in the browser tab says Catalog
      concerns > Tools > Koha
3. Apply the patch.
4. Refresh the catalog concerns page.
5. The title of the page in the browser tab should now say Catalog
   concerns > Cataloging > Koha
6. Sign off 8-)

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Caroline Cyr La Rose <caroline.cyr-la-rose@inlibro.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
18 months agoBug 33645: Make koha-foreach return 0 if it completes successfully
David Cook [Tue, 2 May 2023 00:16:30 +0000 (00:16 +0000)]
Bug 33645: Make koha-foreach return 0 if it completes successfully

This patch adds an "exit 0" to the end of koha-foreach, so that it
returns a successful exit code if it reaches the bottom of the script
without errors.

Test plan:
0) `koha-foreach echo`
1) `echo $?`
2) Note that the exit status is 1
3) Apply patch
4) `./debian/scripts/koha-foreach echo`
5) `echo $?`
6) Note that the exit status is 0

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>
18 months agoBug 33615: Date picker icon not visible
Mason James [Thu, 27 Apr 2023 03:24:07 +0000 (15:24 +1200)]
Bug 33615: Date picker icon not visible

to test:

 - apply patch, build package

 - edit item, observe calendar icon is visible

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
18 months agoBug 33631: Fix misaligned labels
Lucas Gass [Thu, 27 Apr 2023 21:08:35 +0000 (21:08 +0000)]
Bug 33631: Fix misaligned labels

If you look at the results_summary on either the results
or detail pages you will notice that the label and
content are slightly misaligned.

To test:
1. On staff results, detail page, or ISBD details notice
   that slight misaligmnet between label and content.
2. Apply patch, yarn_build, clear browser cache
3. Look again, alignment should be fixed

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
18 months agoBug 33596: Merge result page is missing page-section
Owen Leonard [Mon, 24 Apr 2023 19:09:00 +0000 (19:09 +0000)]
Bug 33596: Merge result page is missing page-section

This patch adds a "page-section" container around the contents of the
page seen when you complete the process of merging catalog records.

The patch also adds the "merge was successful" message into the standard
message dialog.

Perform a catalog search which will return more than one record.

- Select two records in your search results and click "Edit" -> "Merge
  records."
- Complete the process of merging your selected records.
- On the last page you should see a "merge was successful" message
  styled as the standard information box.
- The "Report" section should be shown inside a "page-section" div.

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
18 months agoBug 33196: Generalize pseudonymization system preference description
Katrin Fischer [Fri, 17 Mar 2023 22:42:47 +0000 (22:42 +0000)]
Bug 33196: Generalize pseudonymization system preference description

The Pseudonymization system preference description in
the staff interface is: "Disable/Enable pseudonymization
to comply with GDPR for personal information. Patrons and
transactions will be copied to a separate table for
statistics purpose."

GDPR is a European Union (and, at time of writing, UK) law;
it makes the system preference look irrelevant for
libraries outside this area. However, this is not correct:
pseudonymization may be useful for libraries anywhere.

This generalized the system preference description and
only uses GDPR as an example instead of the only purpose.

It also updates the fields listed to more closely reflect
the labels on the patron form.

To test:
* Search for "Pseudonymization" in the systme preferences
* Verify that the description of the system preference is
  very GDPR
* Apply patch
* Verify the system preference description is improved

https://bugs.koha-community.org/show_bug.cgi?id=33196
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
18 months agoBug 31405: Set focus for cursor to setSpec input when adding a new OAI set
Katrin Fischer [Sat, 4 Feb 2023 23:54:22 +0000 (23:54 +0000)]
Bug 31405: Set focus for cursor to setSpec input when adding a new OAI set

Makes sure the focus is in the first form field when adding
a new OAI set: setSpec

To test:
* Go to administration > OAI sets
* Add a new set, verify the focus is still in the search bar on top
* Apply patch
* Repeat and verify the focus is now in the first form field
* Save set
* Edit set and verify the focus is in the search field at the top

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
18 months agoBug 32990: Prevent deadlock in _update_batch_record_counts
Marcel de Rooy [Fri, 17 Feb 2023 08:33:41 +0000 (08:33 +0000)]
Bug 32990: Prevent deadlock in _update_batch_record_counts

Resolves:
C4::ImportBatch::_update_batch_record_counts(): DBI Exception: DBD::mysql::st execute failed: Deadlock found when trying to get lock; try restarting transaction at /usr/share/koha/C4/ImportBatch.pm line 392

See also bug 32558.

Test plan:
If you apply 32558 first, run multiple processes that stage a marc import.
Without this patch, you can trigger the deadlock.
With this patch, it works.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
18 months agoBug 31410: Set focus for cursor to Server name when adding a new Z39.50/SRU server
Katrin Fischer [Sun, 5 Feb 2023 00:17:01 +0000 (00:17 +0000)]
Bug 31410: Set focus for cursor to Server name when adding a new Z39.50/SRU server

This makes sure that the focus is in the first form field when
adding a new Z39.50 or SRU server.

To test:
* Administration > Z39.50/SRU servers
* Add a new server for each
* Verify the focus is not in the form
* Apply patch
* Verify the focus is now in the first form field
* Edit an existing server
* Verify the focus is not in the form

Not having the focus when editing is to avoid accidental changes.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
18 months agoBug 33355: Add missing counter number to related users in agreements and licenses...
Pedro Amorim [Wed, 29 Mar 2023 08:33:30 +0000 (08:33 +0000)]
Bug 33355: Add missing counter number to related users in agreements and licenses to be in line with other related content

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
18 months agoBug 33355: Update forms markup to be in line with interface patterns
Pedro Amorim [Wed, 29 Mar 2023 08:27:51 +0000 (08:27 +0000)]
Bug 33355: Update forms markup to be in line with interface patterns

https://wiki.koha-community.org/wiki/Interface_patterns

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
18 months agoBug 33355: Fix is_perpetual radio buttons in AgreementsFormAdd
Pedro Amorim [Tue, 28 Mar 2023 14:23:04 +0000 (14:23 +0000)]
Bug 33355: Fix is_perpetual radio buttons in AgreementsFormAdd

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
18 months agoBug 23924: Reset the fields to add
Jonathan Druart [Fri, 31 Jan 2020 09:01:59 +0000 (10:01 +0100)]
Bug 23924: Reset the fields to add

We do not want to copy fields from the previous records!

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
18 months agoBug 23924: Add --date-field to add_date_fields_to_marc_records.pl
Jonathan Druart [Wed, 30 Oct 2019 08:12:39 +0000 (09:12 +0100)]
Bug 23924: Add --date-field to add_date_fields_to_marc_records.pl

The date used in the script will use this parameter, instead of today.

Test plan:
Use the POD of the script to understand how this flag works. Then use
the script to create fields with a date contained in a specific MARC
field.

Signed-off-by: Hugo Agud <hagud@orex.es>
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>
18 months agoBug 21043: Handle exceptions and switch to debit response
Martin Renvoize [Wed, 1 Mar 2023 15:26:30 +0000 (15:26 +0000)]
Bug 21043: Handle exceptions and switch to debit response

We were cheating a bit here and expecting a 'debit' to be sent in but a
'line' to be returned.

We should really be sending a debit and returning a debit.. so I've
update the paths schema as such and we're now coercing the
Koha::Account::Line object that's returned by Koha::Account->add_debit
into a Koha::Account::Debit object. Longer term it would be nice to
convert returns from the various Koha::Account methods to their correct
Koha::Account:: objects as apposed to them all being the base ::Line

I've also added some code to catch exceptions that can be thrown by
Koha::Account->add_debit and added the appropriate 400 errors into the
path specs again.

Finally.. I added more unit tests to prove the above

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
18 months agoBug 21043: Add debit REST endpoint
Agustin Moyano [Mon, 27 Feb 2023 15:51:16 +0000 (12:51 -0300)]
Bug 21043: Add debit REST endpoint

This patch adds an endpoint to create a debit for a patron.

Testplan

1. Create a new account debit type (Administration > Debit types)
2. Add a fee with this debit type to a patron’s account via API
3. Make sure that this fee is shown in the accounting overview in the patron’s account in the staff interface
4. Make sure that it is possible to make a payment for this fee

Sponsored-by: The Research University in the Helmholtz Association (KIT)
Signed-off-by: Michaela Sieber <michaela.sieber@kit.edu>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
18 months agoBug 29453: (follow-up) Add tests and fix minimum amount in credit.yaml definition
Agustin Moyano [Thu, 4 May 2023 14:09:10 +0000 (14:09 +0000)]
Bug 29453: (follow-up) Add tests and fix minimum amount in credit.yaml definition

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
18 months agoBug 29453: Add endpoints for fetching patron credits & debits
Martin Renvoize [Wed, 10 Nov 2021 16:07:00 +0000 (16:07 +0000)]
Bug 29453: Add endpoints for fetching patron credits & debits

This patch adds two new API endpoints for fetching a patrons credits and
a patrons debits.

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Agustin Moyano <agustinmoyano@theke.io>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
18 months agoBug 32735: (follow-up) Make Koha::Objects::Record::Collections->print_collection...
Agustin Moyano [Wed, 3 May 2023 18:31:05 +0000 (15:31 -0300)]
Bug 32735: (follow-up) Make Koha::Objects::Record::Collections->print_collection work with Authorities and Biblios

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
18 months agoBug 32735: Add endpoint to list authorities
Agustin Moyano [Tue, 28 Feb 2023 14:05:34 +0000 (11:05 -0300)]
Bug 32735: Add endpoint to list authorities

This patch adds an endpoint to list authorities

To test:
1. apply patch
2. enable basic auth
3. call to GET /api/v1/authorities with the following Accept headers:
 * application/json
 * application/marcxml+xml
 * application/marc-in-json
 * application/marc
 * text/plain
4. notice how data changes with each Accept header
5. prove t/db_dependent/api/v1/authorities.t
6. sign off

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
18 months agoBug 31796: Add REST endpoint to modify an authority
Agustin Moyano [Tue, 20 Dec 2022 18:28:04 +0000 (15:28 -0300)]
Bug 31796: Add REST endpoint to modify an authority

To test:
1. Apply patch
2. Set RESTBasicAuth preference to true
3. Pick an authority to modify, and modify it's marc record
4. Make a PUT request to /api/v1/authorities/:authid with one of the following content type header
  - application/json
  - application/marcxml+xml
  - application/marc-in-json
  - application/marc
5. If content type is other than 'application/json' place the following header in the request 'x-authority-type: <auth type>'
5. Check that the authority was modified
6. Sign off

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
18 months agoBug 30367: (follow-up) Same adjustment for gitlab
Nick Clemens [Wed, 3 May 2023 10:58:22 +0000 (10:58 +0000)]
Bug 30367: (follow-up) Same adjustment for gitlab

This adds the same update for gitlab code. I was unable to trigger the error,
however, I confirm searching for 'PayPal' returns a result after this patch
as well as before.

JD amended patch: fix indentation

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
18 months agoBug 30367: Skip processing if we don't get releases
Nick Clemens [Tue, 2 May 2023 16:27:15 +0000 (16:27 +0000)]
Bug 30367: Skip processing if we don't get releases

Some repos don't have releases, and this seems to break things as get returns an empty
response. Calling from_json on this is the error

This simply skips the bad responses to avoid the error:

To test:
1. Have this on your koha-conf.xml file:

 <plugin_repos>
    <repo>
        <name>ByWater Solutions</name>
        <org_name>bywatersolutions</org_name>
        <service>github</service>
    </repo>
    <repo>
        <name>Theke Solutions</name>
        <org_name>thekesolutions</org_name>
        <service>gitlab</service>
    </repo>
    <repo>
        <name>PTFS Europe</name>
        <org_name>ptfs-europe</org_name>
        <service>github</service>
    </repo>
 </plugin_repos>

2. Restart all services:
   $ restart_all
3. Search for the term 'barclaycard'

The search will give an error:

malformed JSON string, neither tag, array, object, number, string or atom, at character offset 0 (before "(end of string)") at /usr/share/perl5/JSON.pm line 190
4. Apply patch
5. Repeat
6. No error

Note: The barclaycard plugin won't install even though it is returned as of this note - the plugin needs an update I believe, I don't think it's a Koha issue
Signed-off-by: David Nind <david@davidnind.com>
JD amended patch: fix indentation

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
18 months agoBug 33626: Remove invalid params
Nick Clemens [Thu, 27 Apr 2023 11:23:03 +0000 (11:23 +0000)]
Bug 33626: Remove invalid params

This patch reformats the params passed to scroll_helper as defined here:
https://metacpan.org/pod/Search::Elasticsearch::Client::7_0::Scroll

To test:
1 - perl misc/maintenance/compare_es_to_db.pl
2 - It dies:
[Param] ** Unknown param (scroll_in_qs) in (search) request. , called from sub Search::Elasticsearch::Client::7_0::Direct::scroll_helper at misc/maintenance/compare_es_to_db.pl line 55.
3 - Apply patch
4 - Repeat
5 - It succeeds!

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
18 months agoBug 21699: Allow circulation messages to be editable
Kyle Hall [Tue, 8 Nov 2022 20:10:07 +0000 (15:10 -0500)]
Bug 21699: Allow circulation messages to be editable

During a Webinar discussion regarding the new placement of the circulation messages appearing in the Patron Detail page.  It was commented by a librarian that it would be nice to have the circulation messages editable. At times libraries need to keep a specific message on a patrons account with the details such as what branch it was written from and the staff member that wrote it, but it would be nice to be able to edit this message.

Test Plan:
1) Apply this patch
2) Restart all the things!
3) Browser to a patron record
4) Create a new patron message
5) Note the patron message now has an "edit" button
6) Edit the existing message using the edit button and form
7) Check the action logs for that message, note there is a modification
   logged to that message if BorrowersLog is enabled

Signed-off-by: Barbara Johnson <barbara.johnson@bedfordtx.gov>
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>
18 months agoBug 33197: DBRev 22.12.00.029
Tomas Cohen Arazi [Fri, 5 May 2023 13:07:10 +0000 (10:07 -0300)]
Bug 33197: DBRev 22.12.00.029

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
18 months agoBug 33197: Rename GDPR_Policy system preference
Katrin Fischer [Fri, 17 Mar 2023 22:06:40 +0000 (22:06 +0000)]
Bug 33197: Rename GDPR_Policy system preference

GDPR is a European Union (and, at time of writing, UK) law.
The GDPR_Policy system preference is about a patron
giving consent to their personal data being processed in
line with the library's privacy policy.

The name of the preference is vague: there could be
many policies implemented by libraries to comply with
GDPR. It also makes the preference look irrelevant for
libraries outside the areas where GDPR applies, while
it may be useful for libraries anywhere.

This renames GDPR_Policy to PrivacyPolicyConsent and
adjusts the system preference descriptions.

To test:
* Apply the patch
* Run database update
* Search for GDPR_Policy in the system preference
  - you should not find anything.
* Search for DataPrivacyConsent in the system preferences
  - you should find it and be able to activate it
* Verify the feature works as expected
  - If the preference is set to "enforced", you will be
    asked to give consent to the data privacy agreement
    in the OPAC when you log in
* Verify the page is now phrased neutrally using 'privacy policy'

Bonus: Consent date is now formatted according to DateFormat
       system preference.
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>
18 months agoBug 33104: DBRev 22.12.00.028
Tomas Cohen Arazi [Fri, 5 May 2023 13:00:00 +0000 (10:00 -0300)]
Bug 33104: DBRev 22.12.00.028

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
18 months agoBug 33104: DBIC schema
Tomas Cohen Arazi [Fri, 5 May 2023 12:56:19 +0000 (09:56 -0300)]
Bug 33104: DBIC schema

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
18 months agoBug 33104: Rename interfaces.id with interface_id
Jonathan Druart [Fri, 14 Apr 2023 06:14:47 +0000 (08:14 +0200)]
Bug 33104: Rename interfaces.id with interface_id

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
18 months agoBug 33104: Remove fieldset
Jonathan Druart [Tue, 11 Apr 2023 10:23:32 +0000 (12:23 +0200)]
Bug 33104: Remove fieldset

For consistency with "Contacts"

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
18 months agoBug 33104: Prevent 'Type' to be cleared
Jonathan Druart [Tue, 11 Apr 2023 10:03:42 +0000 (12:03 +0200)]
Bug 33104: Prevent 'Type' to be cleared

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
18 months agoBug 33104: Add email validation
Jonathan Druart [Tue, 11 Apr 2023 09:59:04 +0000 (11:59 +0200)]
Bug 33104: Add email validation

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
18 months agoBug 33104: Fix translatability
Jonathan Druart [Tue, 11 Apr 2023 09:45:00 +0000 (11:45 +0200)]
Bug 33104: Fix translatability

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
18 months agoBug 33104: Add tests
Jonathan Druart [Thu, 2 Mar 2023 13:15:15 +0000 (14:15 +0100)]
Bug 33104: Add tests

Signed-off-by: Jonathan Field <jonathan.field@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
18 months agoBug 33104: Display the VENDOR_INTERFACE_TYPE AVs in the dropdown list
Jonathan Druart [Thu, 2 Mar 2023 13:40:42 +0000 (14:40 +0100)]
Bug 33104: Display the VENDOR_INTERFACE_TYPE AVs in the dropdown list

Signed-off-by: Jonathan Field <jonathan.field@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
18 months agoBug 33104: Encrypt password
Jonathan Druart [Thu, 2 Mar 2023 12:41:16 +0000 (13:41 +0100)]
Bug 33104: Encrypt password

Signed-off-by: Jonathan Field <jonathan.field@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
18 months agoBug 33104: Make the code reusable
Jonathan Druart [Thu, 2 Mar 2023 09:56:42 +0000 (10:56 +0100)]
Bug 33104: Make the code reusable

We could then reuse it for the contacts code in this same template, on
another bug report.

Signed-off-by: Jonathan Field <jonathan.field@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
18 months agoBug 33104: Add the ability to create vendor interfaces
Jonathan Druart [Wed, 1 Mar 2023 14:53:22 +0000 (15:53 +0100)]
Bug 33104: Add the ability to create vendor interfaces

This patchset is adding the ability to create interfaces for vendors.
An interface is a website, software, or portal that you use to manage orders or
gather statistics from the vendor/organisation.

It will help librarians to keep track of those different information
within Koha.

* new DB table aqbookseller_interfaces(id, vendor_id, type, name, uri,
login, password, account_email, notes)
* new AV category VENDOR_INTERFACE_TYPE with 3 example values ADMIN,
ORDERS, REPORTS
* new pair of Koha classes Koha::Acquisition::Bookseller::Interface[s]
* new method to retrieve the interfaces from the vendor
Koha::Acquisition::Bookseller->interfaces
* Add/Delete interfaces when editing a vendor
* Display the interfaces on the vendor show view

Test plan:
- Add a new vendor
=> Notice the new "Interfaces" block
- Create some interfaces
=> They are display on the vendor show view
=> The password is hashed and can displayed on the demand

QA Note:
The "contacts" code is not very nice and I didn't want to replicate it,
so I went another way and tried to make the code reusable, for further
reutilisation.

Signed-off-by: Jonathan Field <jonathan.field@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
18 months agoBug 33104: Koha classes
Jonathan Druart [Wed, 1 Mar 2023 14:27:39 +0000 (15:27 +0100)]
Bug 33104: Koha classes

Signed-off-by: Jonathan Field <jonathan.field@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
18 months agoBug 33104: DB changes
Jonathan Druart [Wed, 1 Mar 2023 14:18:17 +0000 (15:18 +0100)]
Bug 33104: DB changes

Signed-off-by: Jonathan Field <jonathan.field@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
18 months agoBug 31448: Replace 'Print' with 'Receipt' dropdown
Martin Renvoize [Wed, 24 Aug 2022 07:28:12 +0000 (08:28 +0100)]
Bug 31448: Replace 'Print' with 'Receipt' dropdown

This patch replaces the 'Print' button with a 'Receipt' menu dropdown
exposing 'Print' and 'Email' options when `UseEmailReceipts` is enabled

Test plan
1. Enable `UseEmailReceipts`
2. Navigate to a patron with paid charges
3. Note the new dropdown 'Receipt' menu
4. Confirm 'Print' works as expected
5. Confirm 'Email' works as expected

Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
18 months agoBug 31795: (follow-up) Mock call to FindDuplicateAuthority
Tomas Cohen Arazi [Tue, 11 Apr 2023 15:04:17 +0000 (12:04 -0300)]
Bug 31795: (follow-up) Mock call to FindDuplicateAuthority

When running against Zebra, this tests fail because it requires the
record to be indexed timely. In theory, a 5 seconds delay should be
enough for the indexer to pick up. But that's not the point of the test,
and we should better just mock the query in this case.

To test:
1. Have ktd launch with zebra:
   $ ktd up -d
2. Run:
   $ ktd --shell
  k$ prove t/db_dependent/api/v1/authorities.t
=> FAIL: Tests fail!
3. Apply this patch
4. Repeat 2
=> SUCCESS: Tests pass!
5. Launch ktd with ES:
   $ ktd down
   $ ktd --es7 up -d
6. Repeat 2
=> SUCCESS: Tests pass!
7. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
18 months agoBug 31795: Fix required permissions
Tomas Cohen Arazi [Mon, 10 Apr 2023 17:54:30 +0000 (14:54 -0300)]
Bug 31795: Fix required permissions

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
18 months agoBug 31795: (QA follow-up) Use x-koha-override header
Tomas Cohen Arazi [Mon, 10 Apr 2023 17:14:12 +0000 (14:14 -0300)]
Bug 31795: (QA follow-up) Use x-koha-override header

Despite its title, this patch does a couple more things.

1. The tests are rewritten to cover more things, and also to avoid
   deleting all authorities inside the transaction. It is really not
   required.
2. It makes the endpoint rely on the already generically implemented
   x-koha-override header, which is intended for the same use case as
   x-confirm-not-duplicate is for.
3. It changes the return codes to match the coding guidelines [1]
4. Only checks for duplicates if no override passed.

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

[1] https://wiki.koha-community.org/wiki/Coding_Guidelines_-_API#SWAGGER3.2.1_POST

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
18 months agoBug 31795: Add REST endpoint to add an authority
Agustin Moyano [Thu, 6 Apr 2023 18:55:26 +0000 (15:55 -0300)]
Bug 31795: Add REST endpoint to add an authority

To test:
1. Apply patch
2. Set RESTBasicAuth preference to true
3. Make a POST request to /api/v1/authorities with one of the following content type header
  - application/json
  - application/marcxml+xml
  - application/marc-in-json
  - application/marc
4. If content type is other than application/json, then add the following header to the request: "x-authority-type: <auth type code>"
5. Check that the authority is created
6. Sign off

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
18 months agoBug 32412: Do not reload COCE image for biblio
Jonathan Druart [Wed, 3 May 2023 09:16:14 +0000 (11:16 +0200)]
Bug 32412: Do not reload COCE image for biblio

We do not want to fetch again the new image for the biblio record. We
only want to fetch those for the shelf browser.

Note that the third parameter 'covernewwindow' was not used.

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
18 months agoBug 32412: Empty coce container before appending image
Lucas Gass [Tue, 4 Apr 2023 21:50:39 +0000 (21:50 +0000)]
Bug 32412: Empty coce container before appending image

To test:
1. Apply patch and clear browser cache
2. Turn on Coce for the OPAC.
3. OPACShelfBrowser must be on
4. Find a record that returns a cover image and open it's detail page.
5. Use the next/previous navigation links in the OPACShelfBrowser
6. Notice that no extra image is being added to the biblio-cover-slider.
7. Make sure that Coce images still load correctly in on the OPAC detail page, OPAC results page, and in the shelf browser.

Signed-off-by: Andrew Auld <andrew.auld@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
18 months agoBug 33551: (QA follow-up) Fix TT filters
Katrin Fischer [Wed, 3 May 2023 20:51:49 +0000 (20:51 +0000)]
Bug 33551: (QA follow-up) Fix TT filters

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
18 months agoBug 33551: Remove span from restriction-types.inc
Jonathan Druart [Wed, 3 May 2023 07:09:25 +0000 (09:09 +0200)]
Bug 33551: Remove span from restriction-types.inc

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
18 months agoBug 33419: (QA follow-up) Remove changes to basic_workflow.t
Katrin Fischer [Tue, 2 May 2023 22:48:09 +0000 (22:48 +0000)]
Bug 33419: (QA follow-up) Remove changes to basic_workflow.t

These are not needed: 942 and 200 have no subfields for
homebranch and holdingbranch.

The tests pass without these changes.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
18 months agoBug 33419: Make home library and current library mandatory by default
Laura Escamilla [Tue, 2 May 2023 18:35:23 +0000 (18:35 +0000)]
Bug 33419: Make home library and current library mandatory by default

Items without a home and current library can cause errors in Koha.
On the bibliographic page, items appear without the "edit" drop-down
or the selection check box. On a bulk delete page, items without
a home library create a red error that says "Cannot delete".

Making the home and current library values mandatory
helps avoid these issues.

Test plan (using koha-testing-docker (KTD)):
1. Reset KTD so that the web installer is used to setup Koha.[1]
2. Setup Koha using the web installer
   -> When setting up the default settings, don't add any of the
      optional data.
3. Once setup and logged in, check the two frameworks (default and ACQ)
    and note that $952$a and $952$b are not mandatory.
4. Apply the patch.
5. Repeat steps 1-2.
6. Once setup and logged in, check the two frameworks (default and ACQ)
   and note that $952$a and $952$b are now mandatory.

[1] How to access the web installer to setup Koha in KTD:
1. Access the database server:
   mysql -uroot -ppassword -hkoha-db-1
2. Drop the koha_kohadev database: drop database koha_kohadev;
3. Create the database: create database koha_kohadev;
4. Add privileges (for a real installation this would be limited):
   grant all on koha_kohadev.* to koha_kohadev;
5. Restart everything (there may be some errors listed):
   flush_memcached and then restart_all
6. Access the web installer: go to 127.0.0.1:8081
7. Use the database user name and password:
   get from /etc/koha/sites/kohadev/koha-conf.xml
   (default: koha_kohadev, password)
8. Continue through the installation process.

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>
18 months agoBug 33329: Correctly handle UNIMARC encoding for biblios
Tomas Cohen Arazi [Fri, 14 Apr 2023 20:21:15 +0000 (17:21 -0300)]
Bug 33329: Correctly handle UNIMARC encoding for biblios

This patch introduces the same treatment we had for bug 32336, this time
for Koha::Objects::Record::Collections.

To test:
1. Apply the regression tests patch
2. Run:
   $ ktd --shell
  k$ prove t/db_dependent/api/v1/biblios.t
=> FAIL: Tests fail! Encoding is wrong for UNIMARC!
3. Apply this patch
4. Repeat 2
=> SUCCESS: Tests pass!
5. Sign off :-D

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
18 months agoBug 33329: Regression tests
Tomas Cohen Arazi [Thu, 23 Mar 2023 23:46:44 +0000 (20:46 -0300)]
Bug 33329: Regression tests

This patch introduces tests for the bug highlighted on bug 32336, but in
the context of lists of records.

To reproduce:
1. Run:
   $ prove t/db_dependent/api/v1/biblios.t
=> SUCCESS: Tests pass!
2. Apply this patch
3. Repeat 1
=> FAIL: Test fail, encoding is bad!

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
18 months agoBug 32701: Fix I18N JavaScript libraries on self checkout help page
Katrin Fischer [Sun, 23 Apr 2023 21:16:52 +0000 (21:16 +0000)]
Bug 32701: Fix I18N JavaScript libraries on self checkout help page

The help page was missing the fixes from bug 28488. The missing
libraries are causing a JavaScript error on the page and likely
other issues.

To test:
* Make sure WebBasedSelfCheck is activated and configured
  Note: In ktd you don't need to configure anything, it's already set up.
* In the OPAC, go to:
  /cgi-bin/koha/sco/sco-main.pl
* Click on the link to the help in the top right corner
* Verify you see the error in the console:
  jQuery.Deferred exception: __ is not defined
* Apply patch
* Restart things
* Reload the page
* Veriy the errors are gone

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>
18 months agoBug 33649: Fix use of cronlogaction
Magnus Enger [Wed, 3 May 2023 06:51:14 +0000 (08:51 +0200)]
Bug 33649: Fix use of cronlogaction

C4::Log::cronlogaction() takes a hashref as argument, with "info"
and possibly "action" as keys. But there are a couple of places
where it is called with just a string as argument, and that does
not work. Both places need lock_exec to fail to trigger the error.
I have seen this on a production server, but not been able to
reproduce in ktd.

To test:
- Run this on the Koha repo: grep -r "cronlogaction(" *
- Verify that fines.pl and process_message_queue.pl are the only
  scripts that call cronlogaction without a hashref as argument,
  but do it like this: cronlogaction( $message );
- Apply this patch
- Run the grep again and verify that all calls to cronlogaction
  now take a hashref as argument

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
18 months agoBug 33470: Don't calculate overridden hold limits
Nick Clemens [Sun, 9 Apr 2023 18:25:41 +0000 (18:25 +0000)]
Bug 33470: Don't calculate overridden hold limits

This patch can largely be checked in the code to ensure it makes sense, it
moves a conditional up one level for the two different checks that could prevent holds

To test:
1 - Attempt to place a hold via the REST API with an invalid pickup location
    Set pickup location as no in branches to make this easy
2 - Confirm you get an error
3 - Attempt again with header (bug 27760):
    x-koha-override: any
4 - Hold is placed
5 - Repeat 1-4 above but with an item that cannot be held
6 - Apply patch
7 - Repeat 1-4 above
8 - Results should be the same

Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
18 months agoBug 32921: Honor SelfCheckTimeout when modal is open
Lucas Gass [Wed, 8 Feb 2023 23:28:59 +0000 (23:28 +0000)]
Bug 32921: Honor SelfCheckTimeout when modal is open

To test:
1. Set the 'SelfCheckTimeout' system preference to something low for testing.
2. Make sure 'SelfCheckReceiptPrompt' is set to 'Show'.
3. Log in to SCO and press finish but leave the modal open.
4. Wait until the 'SelfCheckTimeout' time has expired, nothing happens.
5. Apply patch and try again. You should be logged out when SelfCheckTimeout expires.

Signed-off-by: Marius Mandrescu <marius.mandrescu@inLibro.com>
JD amended patch - fix indentation

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
18 months agoBug 28267: Simplify things
Jonathan Druart [Thu, 4 May 2023 07:05:17 +0000 (09:05 +0200)]
Bug 28267: Simplify things

We don't need:
* a separate Koha::Installer module when we already have
C4::Installer
* the tests as they are actually modifying the DB structure
without rolling back
* An unecessary complicated subroutine, just make is simple

WNC amended patch: Remove change to Koha.pm

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
18 months agoBug 28267: Add warnings for database row formats
David Cook [Wed, 18 Jan 2023 03:20:29 +0000 (03:20 +0000)]
Bug 28267: Add warnings for database row formats

This patch adds a warning on about.pl regarding database row formats
other than "DYNAMIC". It points to the Koha community wiki for more
information on how to resolve the problem.

This patch also stops the installer if there are any database tables
with a row format other than "DYNAMIC". It points to the Koha community
wiki for more information on how to resolve the problem.

Test plan:
0a. Apply the patch
0b. koha-plack --restart kohadev
1a. koha-mysql kohadev
1b. ALTER TABLE tags ROW_FORMAT=COMPACT;
2. Go to http://localhost:8081/cgi-bin/koha/about.pl
3. Note that there is a warning about database row formats
4a. koha-mysql kohadev
4b. ALTER TABLE tags ROW_FORMAT=DYNAMIC;
5. Go to http://localhost:8081/cgi-bin/koha/about.pl
6. Note that there is no warning about database row formats

7a. Manually change the version in Koha.pm to a higher version
7b. koha-plack --restart kohadev
8a. koha-mysql kohadev
8b. ALTER TABLE tags ROW_FORMAT=COMPACT;
9. Go to http://localhost:8081/
10. Log into the web installer and click through until you reach
a warning telling you that you have database row formats other
than 'DYNAMIC'
11. Note that you can't progress with the installer until
this problem is resolved
12a. koha-mysql kohadev
12b. ALTER TABLE tags ROW_FORMAT=DYNAMIC;
13. Refresh the page or redo the web installer process
14. Note that you're no longer blocked from running the installer
due to database row format
15. Undo your change to Koha.pm
16. Profit

Note: Due to bug 32665 you'll see an unrelated warning on
step 3

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
18 months agoBug 33262: DBRev 22.12.00.027
Tomas Cohen Arazi [Fri, 5 May 2023 12:32:48 +0000 (09:32 -0300)]
Bug 33262: DBRev 22.12.00.027

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
18 months agoBug 33262: DBIC schema
Tomas Cohen Arazi [Fri, 5 May 2023 12:31:58 +0000 (09:31 -0300)]
Bug 33262: DBIC schema

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
18 months agoBug 33262: Add new field to REST API route for orders
Katrin Fischer [Thu, 4 May 2023 15:06:45 +0000 (15:06 +0000)]
Bug 33262: Add new field to REST API route for orders

Without this patch the API driven list of pending orders
on the order receive page was broken.

With the patch, all should be well now.

prove -v t/db_dependent/api/v1/acquisitions_orders.t

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
18 months agoBug 33262: Unit tests
Katrin Fischer [Thu, 4 May 2023 13:08:54 +0000 (13:08 +0000)]
Bug 33262: Unit tests

prove t/db_dependent/Biblio.t

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
18 months agoBug 33262: Store the biblionumber of a deleted record in the order line
Katrin Fischer [Thu, 4 May 2023 12:15:36 +0000 (12:15 +0000)]
Bug 33262: Store the biblionumber of a deleted record in the order line

When a bibliographic record is deleted and linked to an order
in the acquisition module, the biblionumber in the order line is
currently deleted as well. This makes it impossible to tell what
was ordered in the first place. This is a big issue for libraries
that need to be able to track how money was spent over long periods
of time.

With this patch the biblionumber of the deleted record will be moved
to a new column deleted_biblionumber in the order line, keeping the FK
on biblionumber.

To test:
* Apply patch, run dataase update
* Create a order/basket in the acquisitions module
* Order several things, you can use existing records from the sample data
* Make sure you order one of the records at least twice
* Take a look at the aqorders table in your database, using a report:

  SELECT biblionumber, deleted_biblionumber, ordernumber from aqorders;

* From the catalog, delete the items on the records and then the records

  Note: There is a warning about attached orders warning about consequences
  for acquisitions. I have chosen to keep it at this point in time, as
  there are still visible side effects of deleting the record, like bug 10758.

* Re-run the report and compare results to the first run. deleted_biblionumber
  should now be filled with the biblionumber of the deleted record.
  biblionumber should be NULL/empty.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
18 months agoBug 33262: Add deleted_biblionumber column to aqorders table
Katrin Fischer [Thu, 4 May 2023 13:23:31 +0000 (13:23 +0000)]
Bug 33262: Add deleted_biblionumber column to aqorders table

This adds a new column deleted_biblionumber to the aqorders table.
This will allow us to store the biblionumber of a deleted record,
so we will still be able to tell what has been ordered once the
record is deleted.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
18 months agoBug 22440: DBRev 22.12.00.026
Tomas Cohen Arazi [Fri, 5 May 2023 12:12:47 +0000 (09:12 -0300)]
Bug 22440: DBRev 22.12.00.026

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
18 months agoBug 22440: DBIC schema
Tomas Cohen Arazi [Fri, 5 May 2023 12:10:31 +0000 (09:10 -0300)]
Bug 22440: DBIC schema

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
18 months agoBug 22440: Move backend statuses api endpoint
Pedro Amorim [Thu, 27 Apr 2023 16:08:56 +0000 (16:08 +0000)]
Bug 22440: Move backend statuses api endpoint

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
18 months agoBug 22440: Tests
Pedro Amorim [Thu, 30 Mar 2023 10:07:05 +0000 (12:07 +0200)]
Bug 22440: Tests

Updated API tests

Co-authored-by: Tomás Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
18 months agoBug 22440: ILL API changes
Pedro Amorim [Mon, 24 Apr 2023 15:28:28 +0000 (15:28 +0000)]
Bug 22440: ILL API changes

* Add GET /illbackends/{id}/statuses
* Change API route to ill/requests

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>