]> git.koha-community.org Git - koha.git/log
koha.git
12 months agoBug 35032: Remove the use of "onclick" from Koha to MARC mapping template
Owen Leonard [Fri, 21 Jul 2023 16:41:48 +0000 (16:41 +0000)]
Bug 35032: Remove the use of "onclick" from Koha to MARC mapping template

This patch eliminates two instances of "onclick" from the Koha to MARC
mapping template, moving these event handlers into JS in the footer.

To test, apply the patch and go to Administration -> Koha to MARC
mapping.

- Click "Add" next to a Koha field.
  - You should get a JS popup asking for entry of a MARC tag. Confirm
    that this process completes correctly.
- Test a "Remove" link too. It should work to remove mapping from a Koha
  field.
- Test the "Cancel" choice in both the "Add" and "Remove" cases to
  confirm that the operation is cancelled.

Signed-off-by: Andrew Fuerste-Henry <andrewfh@dubcolib.org>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
12 months agoBug 35006: OPAC holdings table - Fix sort for library columns
Owen Leonard [Tue, 10 Oct 2023 12:03:18 +0000 (12:03 +0000)]
Bug 35006: OPAC holdings table - Fix sort for library columns

This patch updates the holdings table on the OPAC's bibliographic detail
page so that home and current library columns can be sorted correctly by
library name. There have been changes to the way the template shows
these values, but the DataTables "data-sort" attribute on the table cell
had not been updated accordingly.

To test, apply the patch set the OpacLocationBranchToDisplay system
preference to "home and holding libraries."

- Make sure home and holding library columns are not hidden in the
  table settings under Administration -> Table settings -> OPAC ->
  holdingst.
- Locate a bibliographic record in the OPAC which has multiple items
  from different libraries.
- Test that the home and current library columns sort correctly by
  library name.

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>
12 months agoBug 34881: (QA follow-up) Remove stray paren
Nick Clemens [Thu, 12 Oct 2023 14:53:50 +0000 (14:53 +0000)]
Bug 34881: (QA follow-up) Remove stray paren

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
12 months agoBug 34881: Improve idempotency of DBRev
Emily Lamancusa [Wed, 11 Oct 2023 13:40:05 +0000 (09:40 -0400)]
Bug 34881: Improve idempotency of DBRev

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>
12 months agoBug 35041: Fix Patron.t for a filter_by_last_update test
Marcel de Rooy [Thu, 12 Oct 2023 07:48:11 +0000 (07:48 +0000)]
Bug 35041: Fix Patron.t for a filter_by_last_update test

Since filter with from now tests stricter, we should be a bit
more accurate with setting our test datetime.

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

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
12 months agoBug 27249: Replace DateTime->now by dt_from_string
Julian Maurice [Tue, 10 Oct 2023 09:53:17 +0000 (11:53 +0200)]
Bug 27249: Replace DateTime->now by dt_from_string

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
12 months agoBug 27249: Add missing POD for Koha::Exceptions::Calendar
Julian Maurice [Tue, 10 Oct 2023 09:53:00 +0000 (11:53 +0200)]
Bug 27249: Add missing POD for Koha::Exceptions::Calendar

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
12 months agoBug 27249: Fix code style
Julian Maurice [Tue, 10 Oct 2023 09:52:26 +0000 (11:52 +0200)]
Bug 27249: Fix code style

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
12 months agoBug 27249: Catch NoOpenDays exception while checking out an item
Julian Maurice [Thu, 24 Aug 2023 07:27:28 +0000 (09:27 +0200)]
Bug 27249: Catch NoOpenDays exception while checking out an item

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>
12 months agoBug 27249: Prevent infinite loop when searching for an open day
Julian Maurice [Tue, 18 Jul 2023 08:26:03 +0000 (10:26 +0200)]
Bug 27249: Prevent infinite loop when searching for an open day

Calendars can be configured in a way that all days are closed.
The simplest way to do that is to configure a repeatable holiday for
every day of the week.
With such calendars, searching for an open day will literally take
forever.

This patch sets a hard limit on how many iterations are allowed before
giving up. This limit is set to the arbitrary value of 5000, which
should be large enough to be able to consider there is no open days if
we haven't found any with that many iterations, and small enough to
allow the loop to end quickly

Test plan:
1. Set system preference 'useDaysMode' to 'Use the calendar to push the
   due date to the next open day' ('Datedue'). Make sure the existing
   circulation rules do not conflict with that setting.
2. Browse to Tools » Calendar
3. Set every day of the week to "Holiday repeated every same day of the
   week"
4. Issue an item to a patron
5. Check the box and select 'Renew selected items'
6. The renewal should fail pretty quickly

Signed-off-by: Sam Lau <samalau@gmail.com>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
12 months agoBug 35037: (follow-up) Minor adjustments to margins and padding
Owen Leonard [Thu, 12 Oct 2023 10:38:34 +0000 (10:38 +0000)]
Bug 35037: (follow-up) Minor adjustments to margins and padding

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
12 months agoBug 35037: Revise the appearance of the last patron button
Owen Leonard [Wed, 11 Oct 2023 17:41:45 +0000 (17:41 +0000)]
Bug 35037: Revise the appearance of the last patron button

Following Bug 21246 I find the button to be too obtrusive. This patch
makes CSS changes to the style of the "Last patron" button shown in the
staff interface when the "showLastPatron" system preference is enabled.

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

- Enable the showLastPatron system preference if necessary.
- Go to Circulation in the staff interface and check out to a patron.
- A "Last patron" button should appear on the right-hand end of the
  breadcrumbs bar.
- Check that the link, dropdown button, and dropdown menu look good.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
12 months agoBug 34401: Fix inconsistencies in Item search fields page titles, breadcrumbs, and...
Owen Leonard [Wed, 4 Oct 2023 10:51:14 +0000 (10:51 +0000)]
Bug 34401: Fix inconsistencies in Item search fields page titles, breadcrumbs, and headers

This patch fixes some inconsistencies in the item search fields
administration page, making sure the page title, breadcrumb navigation,
and page headers are consistent with each other.

The patch makes some changes to the way new item search fields are added
in order to keep the display consistent with other similar interfaces:
The "add" form is no longer shown dynamically from the page listing item
search fields. Clicking the "New search field" toolbar button will now
take you to the same template used for editing existing search fields.
This allows us to put the correct context into page title, breadcrumbs,
and headings.

To test, apply the patch and go to Administration -> Item search fields.
Test the process of adding a new search field and editing an existing
search field.

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>
12 months agoBug 34966: Terminology - fix add item form (& to and)
David Nind [Sat, 30 Sep 2023 06:27:39 +0000 (06:27 +0000)]
Bug 34966: Terminology - fix add item form (& to and)

This patch updates the add item form in the staff interface to
change the 'Add & duplicate' button to 'Add and duplicate'.

In our terminology guide, & should only be used when
it is part of a proper noun or a common abbreviation:
https://wiki.koha-community.org/wiki/Terminology

Test plan:
1. In the staff interface, search for and select a record.
2. Select New > New item.
3. Note that "Add & duplicate" is one of the action buttons at the
bottom of the add item form.
4. Apply the patch.
5. Refresh the page.
6. Note that the action button is now labelled 'Add and duplicate'.
7. Sign off! 8-)

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katariina Hanhisalo <katariina.hanhisalo@xamk.fi>
Signed-off-by: Reetta Pihlaja <reetta.pihlaja@siilinjarvi.fi>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
12 months agoBug 34800: Adding openhub links for Koha contributors
Aleisha Amohia [Fri, 15 Sep 2023 03:41:56 +0000 (03:41 +0000)]
Bug 34800: Adding openhub links for Koha contributors

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>
12 months agoBug 34395: Fix inconsistencies in Authority types page titles, breadcrumbs, and header
Owen Leonard [Fri, 25 Aug 2023 15:00:20 +0000 (15:00 +0000)]
Bug 34395: Fix inconsistencies in Authority types page titles, breadcrumbs, and header

This patch fixes some inconsistencies in the authority
types administration page, making sure the page title, breadcrumb
navigation, and page headers are consistent with each other.

Test each page to confirm that page title, heading, and breadcrumbs are
consistent:

- Administration -> Authority types
  - New authority type
  - Edit authority type
  - Delete an authority type which is not used
  - Delete an authority type which is in use
  - Authority type MARC structure
    - New tag
    - Edit tag
    - Delete tag
    - View subfields
    - Edit subfields

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
12 months agoBug 34399: Fix inconsistencies in Record overlay rules page titles, breadcrumbs,...
Owen Leonard [Tue, 3 Oct 2023 17:53:25 +0000 (17:53 +0000)]
Bug 34399: Fix inconsistencies in Record overlay rules page titles, breadcrumbs, and headers

This patch fixes some inconsistencies in the record overlay rules
page, making sure the page title, breadcrumb navigation, and page
headers are consistent with each other.

Test the record matching rules page to confirm that page title, heading,
and breadcrumbs are consistent.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
12 months agoBug 34405: Fix inconsistencies in EDI accounts/Library EAN page titles, breadcrumbs...
Owen Leonard [Fri, 6 Oct 2023 11:24:49 +0000 (11:24 +0000)]
Bug 34405: Fix inconsistencies in EDI accounts/Library EAN page titles, breadcrumbs, and headers

This patch fixes some inconsistencies in templates for EDI accounts
and Library EANs, making sure the page title, breadcrumb navigation, and
page headers are consistent with each other.

To test, apply the patch and check these views:

- Administration -> EDI accounts
  - New EDI account
  - Edit EDI account
  - Confirm deletion of EDI account
- Administration -> Library EANs
  - New library EAN
  - Edit library EAN
  - Confirm deletion of EDI account
    - With an account for a specific library
    - With an account for any library

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
12 months agoBug 30719: DBRev 23.06.00.036
Tomas Cohen Arazi [Tue, 17 Oct 2023 17:40:13 +0000 (14:40 -0300)]
Bug 30719: DBRev 23.06.00.036

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
12 months agoBug 30719: Rename `batch` for `ill_batch` in Koha::Illrequest
Tomas Cohen Arazi [Tue, 17 Oct 2023 16:40:09 +0000 (13:40 -0300)]
Bug 30719: Rename `batch` for `ill_batch` in Koha::Illrequest

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
12 months agoBug 30719: Remove unused Koha::Illbatch->requests_count method
Tomas Cohen Arazi [Tue, 17 Oct 2023 14:51:24 +0000 (11:51 -0300)]
Bug 30719: Remove unused Koha::Illbatch->requests_count method

This patch removes this stray method from the original implementation.

To test:
1. Apply this patch
2. Run:
   $ git grep requests_count
=> SUCCESS: Notice the only ILL-related mantions are API related, which
is returned by using the 'requests+count' embed, which is unrelated to
this particular method
3. Run:
   $ prove t/db_dependent/api/v1/ill_batches.t \
     t/db_dependent/Illbatches.t
=> SUCCESS: Tests pass!
4. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
12 months agoBug 30719: Remove unused (and wrong) key in Koha::Illrequest->strings_map()
Tomas Cohen Arazi [Tue, 17 Oct 2023 14:16:07 +0000 (11:16 -0300)]
Bug 30719: Remove unused (and wrong) key in Koha::Illrequest->strings_map()

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
12 months agoBug 30719: (QA follow-up) Updating remaining naming
Pedro Amorim [Wed, 11 Oct 2023 08:38:57 +0000 (08:38 +0000)]
Bug 30719: (QA follow-up) Updating remaining naming

Update statuscode -> status_code on the js files
Update remaining batch_id -> ill_batch_id
Update batch object in Illrequest.pm strings_map

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
12 months agoBug 30719: (QA follow-up) Pick better column names and cleanup
Tomas Cohen Arazi [Tue, 10 Oct 2023 19:02:38 +0000 (16:02 -0300)]
Bug 30719: (QA follow-up) Pick better column names and cleanup

This patch takes on normalizing the attribute names, embeds, and also
makes the whole API more kosher, in terms of using accessors for related
objects, using the standard structure for strings_map, etc.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
12 months agoBug 30719: (QA follow-up) Rename illbatchstatuses
Pedro Amorim [Tue, 10 Oct 2023 10:47:21 +0000 (10:47 +0000)]
Bug 30719: (QA follow-up) Rename illbatchstatuses

illbatchstatuses endpoint is now ill/batchstatuses

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
12 months agoBug 30719: (QA follow-up) Rewrite remaining ill batches endpoints
Pedro Amorim [Mon, 9 Oct 2023 15:54:54 +0000 (15:54 +0000)]
Bug 30719: (QA follow-up) Rewrite remaining ill batches endpoints

get, add and update rewrite

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
12 months agoBug 30719: (QA follow-up) Rewrite Illbatches list endpoint
Pedro Amorim [Mon, 9 Oct 2023 15:29:58 +0000 (15:29 +0000)]
Bug 30719: (QA follow-up) Rewrite Illbatches list endpoint

Update accessors
Add +strings embed
Add x-koha-embed to batches list andpoint
Add embed to API call from the front-end
Update table to get data from _strings
Add x-koha-embed to tests
Add strings_map to Illbatch
Add to_api_mapping to Illbatch

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
12 months agoBug 30719: (QA follow-up) Rename illbatches endpoint to ill/batches
Pedro Amorim [Mon, 9 Oct 2023 12:23:57 +0000 (12:23 +0000)]
Bug 30719: (QA follow-up) Rename illbatches endpoint to ill/batches

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
12 months agoBug 30719: Atomic update fixes
Tomas Cohen Arazi [Wed, 4 Oct 2023 19:53:41 +0000 (15:53 -0400)]
Bug 30719: Atomic update fixes

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
12 months agoBug 30719: (QA follow-up) Fix "Request Status" capitalization
Katrin Fischer [Fri, 8 Sep 2023 14:22:57 +0000 (14:22 +0000)]
Bug 30719: (QA follow-up) Fix "Request Status" capitalization

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
12 months agoBug 30719: (QA follow-up) c->validation fixes
Pedro Amorim [Fri, 8 Sep 2023 13:32:43 +0000 (13:32 +0000)]
Bug 30719: (QA follow-up) c->validation fixes

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
12 months agoBug 30719: (QA follow-up) Squash:
Pedro Amorim [Thu, 29 Jun 2023 13:57:06 +0000 (13:57 +0000)]
Bug 30719: (QA follow-up) Squash:

    This is a squash of 25 QA patches located at:
    https://github.com/PTFS-Europe/koha/commits/new_30719

Bug 30719: (QA follow-up) Batch column should be hidden by default
Bug 30719: (QA follow-up) Fix wrong tt filter type
Bug 30719: (QA follow-up) Make atomicupdate idempotent
Bug 30719: (QA follow-up) Use COMMENT syntax in database files
Bug 30719: (QA follow-up) Fix tiny boolean is_system
Bug 30719: (QA follow-up) Add missing CONSTRAINT entries from kohastructure.sql to the atomicupdate file
Bug 30719: (QA follow-up) Add missing koha_object_class and
koha_objects_class methods
Bug 30719: (QA follow-up) Swap search to find
Bug 30719: (QA follow-up) Fix tests
Bug 30719: (QA follow-up) API terminology - id -> batch_id
Bug 30719: (QA follow-up) API terminology - borrowernumber -> patron_id
Bug 30719: (QA follow-up) API terminology - branchcode -> library_id
Bug 30719: (QA follow-up) Make mandatory illbatch_statuses translatable
Bug 30719: (QA follow-up) Improve translatability
Bug 30719: (QA follow-up) Fix capitalization of Interlibrary Loan
Bug 30719: (QA follow-up) Change Branch to Library in ILL batches table
Bug 30719: (QA follow-up) Add template WRAPPER to batch statuses breadrcrumbs
Bug 30719: (QA follow-up) Utilize patron_to_html function to display patron info in batches table
Bug 30719: (QA follow-up) Add mandatory batch statuses to the atomicupdate
Bug 30719: (QA follow-up) Add page-section to the batch statuses list page
Bug 30719: (QA follow-up) Style Save button on batch status edit page
Bug 30719: (QA follow-up) Add question mark to label string, rephrase new ILL batch button
Bug 30719: (QA follow-up) Add noExport class to action columns in batch list table and batch modal table
Bug 30719: (QA follow-up) Add page-section and headers to ILL batch table
Bug 30719: (QA follow-up) Perltidy

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
12 months agoBug 30719: DBIC schema
Tomas Cohen Arazi [Fri, 12 May 2023 17:11:24 +0000 (17:11 +0000)]
Bug 30719: DBIC schema

Signed-off-by: Edith Speller <Edith.Speller@ukhsa.gov.uk>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
12 months agoBug 30719: Tests
Pedro Amorim [Fri, 12 May 2023 17:10:00 +0000 (17:10 +0000)]
Bug 30719: Tests

Co-authored-by: Andrew Isherwood <andrew.isherwood@ptfs-europe.com>
Signed-off-by: Edith Speller <Edith.Speller@ukhsa.gov.uk>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
12 months agoBug 30719: ILL Batch Statuses
Pedro Amorim [Fri, 12 May 2023 17:09:39 +0000 (17:09 +0000)]
Bug 30719: ILL Batch Statuses

- UI adding support for batch statuses in batch UI
- Admin UI for managing batch statuses
- API specs

Co-authored-by: Andrew Isherwood <andrew.isherwood@ptfs-europe.com>
Signed-off-by: Edith Speller <Edith.Speller@ukhsa.gov.uk>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
12 months agoBug 30719: ILL Batches
Pedro Amorim [Fri, 12 May 2023 17:06:01 +0000 (17:06 +0000)]
Bug 30719: ILL Batches

- Add batch column to requests table
- Establish if there are any availability or metadata enrichment plugins and pass that to the template
- Verify if we have any backend that can support batches, if not, don't show the option
- Updates to the ILL toolbar
- New ILL batch modal
- New Koha classes
- API specs

Co-authored-by: Andrew Isherwood <andrew.isherwood@ptfs-europe.com>
Signed-off-by: Edith Speller <Edith.Speller@ukhsa.gov.uk>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
12 months agoBug 30719: DB and API
Pedro Amorim [Fri, 12 May 2023 16:59:21 +0000 (16:59 +0000)]
Bug 30719: DB and API

- Adds 'batch' accessor to Illrequest object
- New illbatches and illbatch_statuses tables
- New foreign key 'batch_id' in illrequests table
- Atomic update file
- Default illbatch_statuses
- Add 'add' ill_requests api method
- Add POST method in ill_requests path
- Add 'batch_id property to ill_request api definition
- Updated swagger.yml with new batches and batchstatuses endpoints

Co-authored-by: Andrew Isherwood <andrew.isherwood@ptfs-europe.com>
Signed-off-by: Edith Speller <Edith.Speller@ukhsa.gov.uk>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
12 months agoBug 26314: (QA follow-up) Improve POD and fix links for UseControlNumber off
Katrin Fischer [Fri, 15 Sep 2023 13:55:07 +0000 (13:55 +0000)]
Bug 26314: (QA follow-up) Improve POD and fix links for UseControlNumber off

When UseControlNumber is off, we previously did a search on the title index,
but this was not actually correct. It might work when we have a dependent
title and the title also appears on 245$p, but there is a better way:

The title of the set record will be found in:
* 773$3 for a dependent title
* 800/810/811/830 for an independent title

The search indices to use are host-item and title-series.

As we are not only looking for 773, POD was adjusted to reflect that.

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
12 months agoBug 26314: (QA follow-up) Resolve new QA script failures
Martin Renvoize [Fri, 8 Sep 2023 14:36:20 +0000 (15:36 +0100)]
Bug 26314: (QA follow-up) Resolve new QA script failures

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>
12 months agoBug 26314: Update for changes to bug 11175 methodology
Martin Renvoize [Wed, 27 Oct 2021 07:50:47 +0000 (08:50 +0100)]
Bug 26314: Update for changes to bug 11175 methodology

This moves the show_volumes calculation back out of C4::XSLT into the
controller scripts and refined the search query builder slightly based
on the XSLT equivilent.

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>
12 months agoBug 26314: (follow-up) Make title search explicit
Martin Renvoize [Mon, 18 Oct 2021 17:06:32 +0000 (18:06 +0100)]
Bug 26314: (follow-up) Make title search explicit

This patch updates the get_volumes_query search returned when
UseControlNumber is disabled such that it matches the query produced by
XSLT sheets by replacing the ->title accessor with the more specific
->subfield('245', "a") accessor to just take subfield `a` into account.

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>
12 months agoBug 26314: (follow-up) Use clean_search_term
Martin Renvoize [Wed, 1 Sep 2021 15:12:18 +0000 (16:12 +0100)]
Bug 26314: (follow-up) Use clean_search_term

This patch uses the now public clean_search_term from bug 28316 to
sanitize the title string and prevent crashes in elastic search when
title contain reserved characters.

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>
12 months agoBug 26314: Only display volumes link when required
Martin Renvoize [Mon, 9 Aug 2021 10:39:56 +0000 (11:39 +0100)]
Bug 26314: Only display volumes link when required

This patch makes C4::XSLT query for volumes the same way it would do
with the generated link (i.e. based on UseControlNumber) and passes
a flag to the XSLT so it displays (or not) the 'Show volumes' link.

To test:
1. Apply the first patch
2. Have a known record without volumes
3. Open the record in the OPAC
=> FAIL: It shows the 'Show volumes' link
4. Have a record known to have volumes
5. Open the record in the OPAC
=> SUCCESS: It shows the 'Show volumes' link
6. Apply this patch and restart_all
7. Reload the above records
=> SUCCESS: It shows the link where it has to, and hides it where it
   shouldn't be displayed.
8. Repeat for Intranet
9. Sign off :-D

Signed-off-by: Michaela Sieber <michaela.sieber@kit.edu>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
12 months agoBug 16223: DBRev 23.06.00.035
Tomas Cohen Arazi [Wed, 11 Oct 2023 15:13:00 +0000 (12:13 -0300)]
Bug 16223: DBRev 23.06.00.035

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
12 months agoBug 16223: Tidy
Tomas Cohen Arazi [Wed, 11 Oct 2023 15:01:14 +0000 (12:01 -0300)]
Bug 16223: Tidy

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
12 months agoBug 16223: Mark lift_after_payment as boolean in schema
Tomas Cohen Arazi [Wed, 11 Oct 2023 14:38:37 +0000 (11:38 -0300)]
Bug 16223: Mark lift_after_payment as boolean in schema

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
12 months agoBug 16223: DBIC schema
Tomas Cohen Arazi [Wed, 11 Oct 2023 14:33:38 +0000 (11:33 -0300)]
Bug 16223: DBIC schema

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
12 months agoBug 16223: (QA follow-up) Adjust DB changes
Tomas Cohen Arazi [Wed, 11 Oct 2023 14:32:25 +0000 (11:32 -0300)]
Bug 16223: (QA follow-up) Adjust DB changes

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
12 months agoBug 16223: (QA follow-up) Add filter, remove superfluous condition
Marcel de Rooy [Fri, 15 Sep 2023 09:01:06 +0000 (09:01 +0000)]
Bug 16223: (QA follow-up) Add filter, remove superfluous condition

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
12 months agoBug 16223: Require fee limit only if "Lift after payment" is set as "Yes"
Emmi Takkinen [Fri, 17 Mar 2023 07:55:39 +0000 (09:55 +0200)]
Bug 16223: Require fee limit only if "Lift after payment" is set as "Yes"

Fee limit should only be required if restriction is
meant to be lifted after payment. This patch makes
"Fee limit" input field required based on value of
"Lift after payment" select field.

To test:
1. Create a new restriction.
2. "Lift after payment" should be set as "No".
3. Change value as "Yes".
=> "Fee limit" should now have "Required" text
after input field.
4. Try to save restriction.
=> Text "This field is required" should be
displayed after "Fee limit".
5. Change "Lift after payment" back to "No".
=> Both texts should now be lifted.

Also test with existing restriction and make sure
restrictions are still saved without problems.

Sponsored-by: Koha-Suomi Oy
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
12 months agoBug 16223: (QA follow-up) Move trigger to apply
Martin Renvoize [Fri, 11 Nov 2022 09:54:05 +0000 (09:54 +0000)]
Bug 16223: (QA follow-up) Move trigger to apply

This patch moves the del_restrictions_after_payment from before the
actual credit application call inside Koha::Account::pay to after the
application of credits to debits in Koha::Account::Line::apply.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
12 months agoBug 16223: (QA follow-up) Remove GetDebarments
Martin Renvoize [Fri, 11 Nov 2022 09:49:50 +0000 (09:49 +0000)]
Bug 16223: (QA follow-up) Remove GetDebarments

We remove the GetDebarments routine in 31095.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
12 months agoBug 16223: Add ability to define liftable restrictions
Emmi Takkinen [Thu, 22 Sep 2022 09:19:03 +0000 (12:19 +0300)]
Bug 16223: Add ability to define liftable restrictions

Some libraries debar Patrons at the end of the year for having unpaid fines,
like in Bug 15157. Currently librarians have to manually remove this type of
debarments after Patron has paid his/her fines.

This patch adds ability to create restrictions which are lifted after
patron pays ceratain amount of fines.

To test:
1. Apply this patch.
2. Restart your services if needed.
3. Navigate to page restrictions.pl.
=> Note that table has two new colums in it, "Lift after payment?" and "Fee limit".
4. Add new restriction which has "Lift after payment?" set
as Yes and fee limit as 5.
5. Create fees for a patron so they exceed fee limit e.g. 10
6. Add restriction made in step 2. for the patron
7. Pay patrons fees partially so that they go under fee limit
=> Note that patrons restriction should now be lifted.

Also prove t/db_dependent/Patron/Borrower_Debarments.t.

Sponsored-by: Koha-Suomi Oy
Signed-off-by: Anneli Österman <anneli.osterman@koha-suomi.fi>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
12 months agoBug 16223: Add new columns to table restriction_types
Emmi Takkinen [Wed, 14 Sep 2022 11:51:51 +0000 (14:51 +0300)]
Bug 16223: Add new columns to table restriction_types

This patch adds two new columns, lift_after_payment and fee_limit,
to table restriction_types. These colums are used to control
lifting patrons restrictions after paying their fees.

To test:
1. Apply this patch.
2. Update your database via updatedatabase.pl.
=> Confirm your table restriction_types has two new columns.

Sponsored-by: Koha-Suomi Oy
Signed-off-by: Anneli Österman <anneli.osterman@koha-suomi.fi>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
12 months agoBug 33087: OPACHoldsIfAvailableAtPickup considers On order as available
Hammat Wele [Thu, 14 Sep 2023 14:19:14 +0000 (14:19 +0000)]
Bug 33087: OPACHoldsIfAvailableAtPickup considers On order as available

if OPACHoldsIfAvailableAtPickup is set to "Don't allow" (i.e. if patrons cannot place holds on items that are available at their library), patrons cannot place holds on items that are on order (or any negative not for loan value) for pickup at their library.

Technically, those items are not "available", so they shouldn't be affected by this system preference.

To replicate:

Prerequisites :

-  Have at least two libraries (I used the sample libraries)

-  Have a patron in one of the libraries (I used Henry Acevedo), make sure you know the user id and password for that patron

-  Make sure the circulation rules allow holds for the patron category

1. Set OPACHoldsIfAvailableAtPickup to "Don't allow"

   1.1. Go to Administration > Global system preference
   1.2. Search for OPACHoldsIfAvailableAtPickup
   1.3. Change the value to "Don't allow"
   1.4. Click "Save all Circulation preferences"

2. Make an item "On order" at the patron's library (Henry Acevedo is at Midway)

   2.1. If needed, create a bibliographic record and item
   2.2. Edit the item to assign the "On order" not for loan status
   2.3. Change the home and holding library to the patron's library (Midway)
   2.4. Click "Save changes"

3. Try to place a hold on the item through the OPAC

   3.1. In the OPAC, log in as the patron
   3.2. Search for the item
   3.3. Click "Place hold"

   --> Notice the patron's library is greyed out in the pickup location drop-down menu"

4. Apply the patch

5. Repeat step 3

   --> Notice you can select the patron's library in the pickup location drop-down menu and place a hold with it

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
12 months agoBug 26558: Make guarantor information persist despite an error
Emmi Takkinen [Wed, 14 Dec 2022 06:36:01 +0000 (08:36 +0200)]
Bug 26558: Make guarantor information persist despite an error

When one tries to create an account with patron guarantor and
error occurs (already used username, wrong age etc.), guarantor
information is lost. This patch always saves added patron
guarantor information to the template param new_guarantors.

To test:
1. Create a new account but cause an error that will keep the
account from saving (enter the wrong age for a category or
give the patron a username that's already being used).
2. Search for and select a guarantor.
3. Try to save the account and wait for the "The following
fields are wrong. Please fix them." message.
=> Note that the guarantor information is gone and you need
to search for and select the guarantor again.
4. Apply this patch.
5. Repeat steps 1.-3.
=> Note that guarantor information hasn't been lost.

This patch also removes code block from duplicate patron
check because we now save param new_guarantors even if
error doesn't occur.

To test:
1. Create a new account but cause a duplicate patron error.
2. Search for and select a guarantor.
3. Try to save the account.
=> Guarantor information should persist.

Sponsored-by: Koha-Suomi Oy
Signed-off-by: Sam Lau <samalau@gmail.com>
Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
12 months agoBug 32740: Add a new option patron home library to OverdueNoticeFrom
Hammat Wele [Fri, 27 Jan 2023 21:05:38 +0000 (21:05 +0000)]
Bug 32740: Add a new option patron home library to OverdueNoticeFrom

This patch add 'patron home library' option to the OverdueNoticeFrom preference. When it's selected notification messages for overdues will be bundled and sent from the borrowing user's home library

To Test
1. Create 3 libraries B1, B2 and B3
    1.1. Go to Koha administration, click on Libraries
    1.2. Click New library
    1.3. Fill the Library Code (ex. B1), Name(ex. B1) and email(ex. b1@test.com) fields.
2. Create a user belonging to B1
    2.1. Go to patron module, click on New patron and patron
    2.2. Fill the Surname,Card number,Primary email,Card number field and select B1 as Library.
3. Create 2 notices : the first belongs to B2 and the second belong to B3
    3.1. Go to Cataloging module and click on new
    3.2. field the required field (000 subfield 0, 003 subfield 0,  005 subfield 0, 008 subfield 0, 040 subfield c,245 subfield a, and 942 subfield c )
    3.3. Click on save
    3.4. In the item form, Select Home library = B2 and Current library = B2 and type a Barcode.
    3.5. Repeat 3.1 3.2 3.3 3.4 to create a second notice belong to B3
4. Have (or create) a default notice for all branches in Notices and Slips Module
5. Make sure you connected to branch B2 or Switch to branch B2
6. checkout item I2 (belonging to B2) to the user created in step 2 (specifying as due date the day before (1 day overdue))
7. switch to branch B3
8. checkout item I3 (belonging to B3) to the user created in step 2 (specifying as due date the day before (1 day overdue))
9. make sure you have defined 'Overdue notice/status triggers' for that patron category, ie with Delay=1 so that 'Overdue Notice' is selected and 'Email' is checked.
Note: we have a user belong to B1, two item: I2 belong to B2, I3 belong to B3 and the user has borrowed I2 from B2 and I3 from B3.
10. Test
    10.1. Search for OverdueNoticeFrom in System preferences and select item home library
    10.2. from cli run 'perl ./misc/cronjobs/overdue_notices.pl'
        => Two new entries will be generated in message_queue DB table, coming from different branches that have the SAME list of overdue items.
        => The sender address is the item home library address for each entry.
11. Apply the patch
12. Search for OverdueNoticeFrom in System preferences
        => There is now 'patron home library' in the options list
13. Select patron home library
14. from cli run 'perl ./misc/cronjobs/overdue_notices.pl'
        => You will see that only one message had been created. Its content shows both B2 and B3 overdue items
        => The sender address matches B1 address (the patron home library).
15. Search for OverdueNoticeFrom in System preferences and select cron
16. from cli run './misc/cronjobs/overdue_notices.pl --frombranch patron-homebranch'
    => you will get the same result at step 14

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Hinemoea Viault <hinemoea.viault@inlibro.com>
Was failing the qa script, so I perltidied the changed lines.
Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
12 months agoBug 26978: Add item type option to batch extend due date tool
Hinemoea Viault [Tue, 6 Jun 2023 16:23:10 +0000 (12:23 -0400)]
Bug 26978: Add item type option to batch extend due date tool

Signed-off-by: Sam Lau <samalau@gmail.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
12 months agoBug 34160: Hyperlink item barcode to the item more details editor from the holds...
Kyle M Hall [Thu, 29 Jun 2023 19:20:32 +0000 (15:20 -0400)]
Bug 34160: Hyperlink item barcode to the item more details editor from the holds queue viewer

Sometimes librarians fail to find an item on the shelf for a hold and need to mark the item as lost. In these cases it would be helpful to link the barcode to the item's "more details" form in the same way we do for the standard details item barcode hyperlink.

Test Plan:
1) View the holds queue, note the item barcode is not a hyperlink
2) Apply this patch
3) Reload the page, note the item barcode is a hyperlink to the more
   details page for that item!

Signed-off-by: Phil Ringnalda <phil@chetcolibrary.org>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
12 months agoBug 33170: Refactor MARCItemFieldsToOrder to make adding more fields trivial
Kyle Hall [Wed, 8 Mar 2023 14:53:07 +0000 (09:53 -0500)]
Bug 33170: Refactor MARCItemFieldsToOrder to make adding more fields trivial

There is no need for this code to have a hard coded list of fields directly in the code.
Any invalid keys would be skipped anyway.
If we refactor this code then adding new fields will be much simpler.

Test Plan:
1) Set up your MARCItemFieldsToOrder, verify everything is working
2) Apply this patch
3) Restart all the things!
4) Verify there has been no change to the MARCItemFieldsToOrder
   functionality

Signed-off-by: Andrew Fuerste-Henry <andrewfh@dubcolib.org>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
12 months agoBug 32335: (QA follow-up) Add 'btn-primary' instead of 'btn-default' class to dialog...
Pedro Amorim [Thu, 7 Sep 2023 15:38:00 +0000 (15:38 +0000)]
Bug 32335: (QA follow-up) Add 'btn-primary' instead of 'btn-default' class to dialog Save buttons

Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
12 months agoBug 32335: (QA follow-up) Add 'Actions' label to 'Actions' column
Pedro Amorim [Thu, 7 Sep 2023 15:37:29 +0000 (15:37 +0000)]
Bug 32335: (QA follow-up) Add 'Actions' label to 'Actions' column

Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
12 months agoBug 32335: Allow stock rotation items to be advanced when in transit
Nick Clemens [Wed, 23 Nov 2022 13:24:12 +0000 (13:24 +0000)]
Bug 32335: Allow stock rotation items to be advanced when in transit

This patch adjusts the logic so that we check:
1 - If there are less than 2 stages we disable the 'Move to next stage' button
2 - If the item is not in transit, we show move to next normally
3 - If the item is in transit (and there is more than 1 stage) the button is enabled with a note about transfer

To test:
1 - Setup a rota with multiple stages
2 - Add an item
3 - Advance to next stage
4 - Observe 'Move to next stage' button is disabled
5 - Check item in at destination
6 - Reload rota - observe 'Move to next stage' is enabled
7 - Apply patch
8 - Click 'Move to next stage'
9 - Note button is not disabled
10 - Hover and confirm note about transit
11 - Click 'Move to next stage'
12 - Checkin item at wrong branch, confirm it is correctly directed to correct stage

Signed-off-by: Sam Lau <samalau@gmail.com>
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
12 months agoBug 33239: (QA follow-up) Tidy and improve description
Kyle M Hall [Fri, 1 Sep 2023 17:02:26 +0000 (13:02 -0400)]
Bug 33239: (QA follow-up) Tidy and improve description

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
12 months agoBug 33239: Add the ability to run borrowers-force-messaging-defaults.pl only on a...
Fridolin Somers [Thu, 16 Mar 2023 02:50:40 +0000 (16:50 -1000)]
Bug 33239: Add the ability to run borrowers-force-messaging-defaults.pl only on a specified message name

Test plan:
1) Select a patron A
2) Change all the message prefs away from defaults.
3) Run misc/maintenance/borrowers-force-messaging-defaults.pl --doit --message-name Item_due
    Verify that patron A prefs changed only for 'Item due'

Signed-off-by: Sam Lau <samalau@gmail.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
12 months agoBug 33843: Use filter_by_last_update in Koha::Notice::Util
Marcel de Rooy [Fri, 26 May 2023 08:19:36 +0000 (08:19 +0000)]
Bug 33843: Use filter_by_last_update in Koha::Notice::Util

Resolve FIXME in sub _get_domain_count by using new logic
from bug 33837.

Test plan:
Run t/db_dependent/Koha/Notice_Util.t.
This triggers the _get_domain_count call using the filter.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
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>
12 months agoBug 33837: Remove datetime parameter
Jonathan Druart [Fri, 21 Jul 2023 12:32:11 +0000 (14:32 +0200)]
Bug 33837: Remove datetime parameter

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
[EDIT] Perltidied one line in cleanup_database.pl.

Bug 33837: Perl tidy block in Objects.t

WARN   t/db_dependent/Koha/Objects.t
   WARN   tidiness
                The file is less tidy than before (bad/messy lines before: 319, now: 320)

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>
12 months agoBug 33837: Replace days_inclusive by min_days
Marcel de Rooy [Fri, 26 May 2023 07:26:15 +0000 (07:26 +0000)]
Bug 33837: Replace days_inclusive by min_days

Instead of passing days and days_inclusive, this patch adds
min_days as replacement. Since days_inclusive is not widely
used, this can be done easily. It removes the confusion
whether days_inclusive impacted other parameters or not.

Test plan:
Run t/db_dependent/Koha/Objects.t
Run t/db_dependent/Koha/Old/Checkouts.t
Run t/db_dependent/Koha/Patrons.t (verifying the change in the
Koha::Patrons module for filtering by expiration date).

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>
12 months agoBug 33837: filter_by_last_update: Add older_than and younger_than
Marcel de Rooy [Wed, 17 May 2023 11:22:08 +0000 (11:22 +0000)]
Bug 33837: filter_by_last_update: Add older_than and younger_than

Test plan:
Run t/db_dependent/Koha/Objects.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>
12 months agoBug 33837: Add unit test
Marcel de Rooy [Thu, 25 May 2023 14:25:32 +0000 (14:25 +0000)]
Bug 33837: Add unit test

Test plan:
Run t/db_dependent/Koha/Objects.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>
12 months agoBug 33837: Add datetime comparison to filter_by_last_update
Marcel de Rooy [Mon, 15 May 2023 09:48:58 +0000 (09:48 +0000)]
Bug 33837: Add datetime comparison to filter_by_last_update

Test plan:
Verify that filter_by_last_update still works as expected by
running cleanup_database.pl with --messages DAYS parameter.
Look at the oldest messages.message_date (or insert one).
Run with -days X where today - X is before that date.
Run with -days Y where today - Y is just after it.

Note: misc/cronjobs/cleanup_database.pl -confirm -messages -1 -v
will remove all messages including one you inserted just now.

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>
12 months agoBug 21246: DBRev 23.06.00.034
Tomas Cohen Arazi [Wed, 11 Oct 2023 13:06:51 +0000 (10:06 -0300)]
Bug 21246: DBRev 23.06.00.034

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
12 months agoBug 21246: Set ShowLastPatronCount to 1 on update
Katrin Fischer [Fri, 28 Jul 2023 09:14:59 +0000 (09:14 +0000)]
Bug 21246: Set ShowLastPatronCount to 1 on update

Setting the new preference to 1 will allow us to keep the
current behaviour on update. The library can then actively
decide to increase the number to whatever they prefer.

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
12 months agoBug 21246: (QA follow-up) Add new syspref to control how many previous patrons are...
Kyle M Hall [Mon, 24 Jul 2023 16:22:57 +0000 (12:22 -0400)]
Bug 21246: (QA follow-up) Add new syspref to control how many previous patrons are displayed

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Tidied the atomicupdate file.
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
12 months agoBug 21246: Extend the 'Last patron' navigation feature to 'Last 10 patrons'
Kyle M Hall [Thu, 29 Jun 2023 19:07:04 +0000 (15:07 -0400)]
Bug 21246: Extend the 'Last patron' navigation feature to 'Last 10 patrons'

This retains the "last patron" link, but extends it to add a dropdown
containg the last 10 patrons.

A future enhancement to control how many patrons to retain would
complement this well.

1) Enable showLastPatron
2) Visit two patrons details pages
3) Note "Last patron" link displays and links to the last visited patron
4) Log out
5) Apply this patch
6) Log in
7) Visit the patron details page for a few patrons
8) Note the "Last patron" link behaves as is did previously
9) Note the split button has a pulldown with the other previous patrons
10) Verify that only the last 10 patrons are retained in the pulldown
11) Verify that if you visit a patron who is already in the list
    they get moved to the top of the list

Signed-off-by: Sam Lau <samalau@gmail.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
12 months agoBug 28130: (QA follow-up) Tidy
Nick Clemens [Fri, 21 Jul 2023 13:00:10 +0000 (13:00 +0000)]
Bug 28130: (QA follow-up) Tidy

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
12 months agoBug 28130: (QA follow-up) Use schema result to fetch alerts to allow for prefetch
Nick Clemens [Fri, 21 Jul 2023 12:56:51 +0000 (12:56 +0000)]
Bug 28130: (QA follow-up) Use schema result to fetch alerts to allow for prefetch

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
12 months agoBug 28130: Manage subscription alerts on OPAC
Aleisha Amohia [Wed, 24 May 2023 21:53:38 +0000 (21:53 +0000)]
Bug 28130: Manage subscription alerts on OPAC

This patch adds an 'Alert subscriptions' tab to the patron's account on the OPAC, so they can easily view or cancel email alerts they have subscribed to.

To test:

1. Subscribe to email alerts for one or more subscriptions via the OPAC
2. Go to your account, notice the new 'Alert subscriptions' menu option, click here
3. Confirm your subscribed alerts show here. Confirm the table sorting works etc (JS enabled).
4. Test unsubscribing from email alerts, make sure the confirmation pop-up works as expected (JS enabled).
5. Confirm that, when unsubscribing, you are redirected back to this page.
6. Confirm the menu option disappears from the left sidebar navigation if you have no alert subscriptions.

Sponsored-by: Bibliotheksservice-Zentrum Baden-Wuerttemberg
Signed-off-by: Christian Stelzenmüller <christian.stelzenmueller@bsz-bw.de>
Signed-off-by: Sam Lau <samalau@gmail.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
12 months agoBug 28130: Manage a patron's subscription alerts
Aleisha Amohia [Tue, 23 May 2023 05:09:10 +0000 (05:09 +0000)]
Bug 28130: Manage a patron's subscription alerts

This enhancement adds an 'Alert subscriptions' page to a patron account to easily view or cancel email alerts the patron has subscribed to.

To test:

1. Go to Cataloging. Create a biblio.
2. Go to Tools -> Notices & slips. Create a notice under the "Serials (new issue)" module, if you don't already have one.
3. Go to Serials. Create a subscription. Link the biblio you just created. Add info like the callnumber, location, library. Choose your notice under Patron notification. Fill out the remaining details and save your subscription.
4. Open this record in the OPAC. Under the Subscriptions tab, click the button to "Subscribe to email notification on new issues"
5. Go back to the staff interface. Go to your patron account.
6. Notice there is a new "Alert subscriptions" tab in the left sidebar menu. The number in brackets should say 1, for the subscription you just enabled email alerts.
7. Click into the page. Confirm your subscription shows in the table.
8. Click the button to unsubscribe. A confirmation should pop up. Confirm you can cancel the unsubscribe action. Then confirm you can unsubscribe using this button.
9. Confirm tests pass t/db_dependent/Koha/Patron.t

Sponsored-by: Bibliotheksservice-Zentrum Baden-Wuerttemberg
Signed-off-by: Christian Stelzenmüller <christian.stelzenmueller@bsz-bw.de>
Signed-off-by: Sam Lau <samalau@gmail.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
13 months agoBug 33204: (QA follow-up) Improve option description
Kyle M Hall [Fri, 1 Sep 2023 16:47:47 +0000 (12:47 -0400)]
Bug 33204: (QA follow-up) Improve option description

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
13 months agoBug 33204: Add the ability to filter on patron library for borrowers-force-messaging...
Fridolin Somers [Sat, 11 Mar 2023 06:32:56 +0000 (20:32 -1000)]
Bug 33204: Add the ability to filter on patron library for borrowers-force-messaging-defaults.pl

Like filter on category Bug 19454, it would be helpful to filter on a specified library for misc/maintenance/borrowers-force-messaging-defaults.pl

Test plan:
1) Select two patrons A and B in say libraries L1 and L2.
2) Change the msg prefs for A and B away from defaults.
3) Run misc/maintenance/borrowers-force-messaging-defaults.pl -doit -library L1
    Verify that patron A changed and patron B did not.
4) Run with both category and library filters

Signed-off-by: Sam Lau <samalau@gmail.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
13 months agoBug 34064: Tidy script
Tomas Cohen Arazi [Tue, 10 Oct 2023 13:51:38 +0000 (10:51 -0300)]
Bug 34064: Tidy script

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
13 months agoBug 34064: Add SQL::Translator dependency to cpanfile
David Cook [Wed, 5 Jul 2023 05:47:54 +0000 (05:47 +0000)]
Bug 34064: Add SQL::Translator dependency to cpanfile

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
13 months agoBug 34064: Remove no_batch_alters option
David Cook [Tue, 20 Jun 2023 06:20:00 +0000 (06:20 +0000)]
Bug 34064: Remove no_batch_alters option

This change removes the no_batch_alters option.

When working with real world databases, you really want to use batch
alters to group together changes. Otherwise, the output becomes
too overwhelming/unwieldy.

On real world databases, I'm noticing big discrepancies, although
I think most of the time this is a difference in the collation
at the column level.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
13 months agoBug 34064: Add an audit script to compare database with kohastructure.sql
David Cook [Tue, 20 Jun 2023 04:18:09 +0000 (04:18 +0000)]
Bug 34064: Add an audit script to compare database with kohastructure.sql

This script can take a connected database handle and compare that database
schema against kohastructure.sql to see what changes the database would
need in order to match kohastructure.sql

NOTE: It uses SQL::Translation::Diff, which is installed with DBIx::Class.

WARNING: The diff doesn't seem to compare comments, so that difference
won't appear in the output. If we wanted, we could easily enhance the
audit_database.pl script to also compare comments.

WARNING: The output is a proposed series of SQL commands. While they
are useful to review, they won't always duplicate the changes done
by updatedatabase.pl, so it's important to carefully analyze the output.
The key purpose of this audit script is to just highlight the differences
between the two.

Test plan:
0. Apply patch
1. vi ./installer/data/mysql/kohastructure.sql
2. Comment out some columns, change NULL status, or whatever you like
3. perl misc/maintenance/audit_database.pl \
    --filename /kohadevbox/koha/installer/data/mysql/kohastructure.sql
4. Note that the output includes SQL commands to change the database
to match the new kohastructure.sql

5a. Try using koha-foreach and note that the database name appears above
the database comparison
5b. koha-foreach "perl misc/maintenance/audit_database.pl \
    --filename /kohadevbox/koha/installer/data/mysql/kohastructure.sql"

Signed-off-by: Emmi Takkinen <emmi.takkinen@koha-suomi.fi>
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
13 months agoBug 34075: DBRev 23.06.00.033
Tomas Cohen Arazi [Tue, 10 Oct 2023 13:46:06 +0000 (10:46 -0300)]
Bug 34075: DBRev 23.06.00.033

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
13 months agoBug 34075: Improve JS code
Jonathan Druart [Wed, 19 Jul 2023 07:32:15 +0000 (09:32 +0200)]
Bug 34075: Improve JS code

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
13 months agoBug 34075: (follow-up) Fixes for QA tool errors
Owen Leonard [Fri, 23 Jun 2023 13:03:40 +0000 (13:03 +0000)]
Bug 34075: (follow-up) Fixes for QA tool errors

- Added missing filter to template variable
- Correct spelling in atomicupdate

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
13 months agoBug 34075: Add DefaultAuthorityTab system preference
Nick Clemens [Wed, 21 Jun 2023 12:41:21 +0000 (12:41 +0000)]
Bug 34075: Add DefaultAuthorityTab system preference

This patch adds a new system preference, DefaultAuthorityTab.
When set, this will choose the default display on the authorities details
page.

To test:
1 - Apply patch, update database
2 - View an authority detail
3 - You should default to the 0XX or first tab
4 - Set DefaultAuthorityTab to a number that there is no tab for in your authority
5 - Reload and verify details page loads the first tba
6 - Set DefaultAuthorityTab to 1XX or another tab that exists in your record
7 - Reload the details and confirm the correct tab is selected

Signed-off-by: Sam Lau <samalau@gmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
13 months agoBug 31731: (QA follow-up) Add pull down to DefaultLongOverdueLostValue and DefaultLon...
Katrin Fischer [Sun, 16 Jul 2023 11:29:19 +0000 (11:29 +0000)]
Bug 31731: (QA follow-up) Add pull down to DefaultLongOverdueLostValue and DefaultLongOverdueChargeValue preferences

Adds LOST pull downs to 2 more preferences.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
13 months agoBug 31731: Offer user a dropdown of authorized values instead of a text field in...
Owen Leonard [Mon, 10 Jul 2023 13:46:48 +0000 (13:46 +0000)]
Bug 31731: Offer user a dropdown of authorized values instead of a text field in preferences

This patch updates the system preferences interface so that preferences
which ask for a single authorized value can offer a dropdown menu of
choices instead of a text field.

The patch also updates a few existing preferences to use the new
feature: BundleLostValue, BundleNotLoanValue, and
ClaimReturnedLostValue.

To test, apply the patch and restart services.

- Go to Administration -> System preferences and search for "authorized
  value."
- The search results should include the entries for BundleLostValue,
  BundleNotLoanValue, and ClaimReturnedLostValue.
- Confirm that the dropdowns show the correct authorized value category
  (LOST or NOT_LOAN)
- Confirm that setting or unsetting each of the preferences works
  correctly.

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>
13 months agoBug 29033: Add C4::Context->multivalue_preference
Tomas Cohen Arazi [Wed, 15 Sep 2021 18:56:59 +0000 (15:56 -0300)]
Bug 29033: Add C4::Context->multivalue_preference

I've seen several places in which a syspref is retrieved and then
splitted using split and the fact they are pipe-separated strings.

It seems it would be simple (and handy) to add a method to do that.

To test:
1. Apply this patch
2. Run:
   $ kshell
  k$ prove t/Context.t
=> SUCCESS: Tests pass, a pipe-separated syspref is correctly retrieved
as an arrayref.
3. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
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>
13 months agoBug 25560: DBRev 23.06.00.032
Tomas Cohen Arazi [Tue, 10 Oct 2023 13:21:15 +0000 (10:21 -0300)]
Bug 25560: DBRev 23.06.00.032

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
13 months agoBug 25560: Unit tests
Alex Buckley [Mon, 1 Aug 2022 18:58:19 +0000 (18:58 +0000)]
Bug 25560: Unit tests

Test plan:
1. Run tests
sudo koha-shell <instancename>
prove t/db_dependent/Circulation/issue.t

Sponsored-By: Waikato Institute of Technology, NZ
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
13 months agoBug 25560: Define item-type specific rules in UpdateNotForLoanStatusOnCheckin
Alex Buckley [Tue, 2 Aug 2022 05:05:39 +0000 (17:05 +1200)]
Bug 25560: Define item-type specific rules in UpdateNotForLoanStatusOnCheckin

This enhancement respects the 'item-level_itypes' syspref, so will look
at the authoritative item type when determining to update the notforloan
status.

Test plan:
1. Set -1 to 'Ordered', and 1 to 'Not for Loan' in Administration > Authorised values > NOT_LOAN

2. Make sure the 'item-level_itypes' syspref is set to 'specific item'

3. Add the following rules in UpdateNotForLoanStatusOnCheckin system
preference:
-1: 0

4. Apply patch & update database
cd installer/data/mysql
sudo koha-shell <instancename>
./updatedatabase.pl

5. Restart plack

6. Observe the UpdateNotForLoanStatusOnCheckin syspref values have
updated to the following format:
_ALL_:
 -1: 0

7. Check in an 'Ordered' item of any item type and confirm it is changed
to 'Available for loan' (NOT_LOAN=0)

8. Reset the UpdateNotForLoanStatusOnCheckin syspref to:
_ALL_:
 -1: 0

CD:
 -1: 2
 2: 0

9. Check-in an 'ordered' (NOT_LOAN=-1) CD item (item level itype='CD') and observe the item's notforloan status updates to 'Staff collection' (NOT_LOAN=2). This is because the _ALL_ rule does not override all other rules.

10. Check-in a 'Staff collection' (NOT_LOAN=2) CD item (item level itype='CD') and
observe the item's notforloan status updates to 'Available for loan'
(NOT_LOAN=0)

11. Check-in a 'Staff collection' (NOT_LOAN=2) DVD item (item level itype='DVD') and observe
the items notforloan status does not change

12. Check-in an 'ordered' (NOT_LOAN=-1) DVD item (item level itype='DVD') and observe the items notforloan status updates to 'Available for loan' (NOT_LOAN=0)

Sponsored-By: Waikato Institute of Technology, NZ
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
13 months agoBug 25560: Template changes
Alex Buckley [Tue, 2 Aug 2022 05:04:34 +0000 (17:04 +1200)]
Bug 25560: Template changes

Sponsored-by: Waikato Institute of Technology, New Zealand
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
13 months agoBug 25560: Database changes
Alex Buckley [Tue, 2 Aug 2022 03:05:33 +0000 (15:05 +1200)]
Bug 25560: Database changes

Sponsored-by: Waikato Institute of Technology, New Zealand
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
13 months agoBug 33426: Add DataTables saveState to suggestion.tt
emlam [Wed, 5 Apr 2023 19:51:33 +0000 (15:51 -0400)]
Bug 33426: Add DataTables saveState to suggestion.tt

To test:
1. In the staff client, go to Purchase Suggestion management page and
   add a suggestion if needed to make the table display.
2. Make some changes to the table settings (hide/show columns, change
   sort column, and/or change number of rows to display)
3. Navigate to a different page.
4. Navigate back to Purchase Suggestions page. Note that the table
   settings have been reset.
5. Apply patch and restart_all
6. Repeat steps 1-4. Note that this time the changes to the table
   settings were preserved.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
13 months agoBug 31692: Tidy and rebase fix
Tomas Cohen Arazi [Tue, 10 Oct 2023 12:53:19 +0000 (09:53 -0300)]
Bug 31692: Tidy and rebase fix

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
13 months agoBug 31692: (follow-up) Adjust reserves.item_level_hold
Lari Taskula [Thu, 3 Nov 2022 20:50:33 +0000 (20:50 +0000)]
Bug 31692: (follow-up) Adjust reserves.item_level_hold

Original patch missed handling reserves.item_level_hold column.

To test:
1. prove t/db_dependent/Koha/Hold.t

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>