]> git.koha-community.org Git - koha.git/log
koha.git
2 years agoBug 31157: (QA follow-up) Update descriptions and wording of configuration options
Katrin Fischer [Fri, 22 Jul 2022 15:57:25 +0000 (15:57 +0000)]
Bug 31157: (QA follow-up) Update descriptions and wording of configuration options

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 31157: Allow selection for overdue from address in the UI
Martin Renvoize [Thu, 14 Jul 2022 16:11:45 +0000 (17:11 +0100)]
Bug 31157: Allow selection for overdue from address in the UI

This patch adds a new system preference to allow systems librarians the
option to pick wich address to use for overdues notices.

We default to 'cron' to allow existing uses of '--frombranch' on the
command line to continue to function but now allow end users to override
this option via the new OverdueNoticeFrom preference.

Signed-off-by: Caroline Cyr La Rose <caroline.cyr-la-rose@inlibro.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 15187: (QA follow-up) Fix test permissions
Tomas Cohen Arazi [Fri, 22 Jul 2022 18:11:58 +0000 (15:11 -0300)]
Bug 15187: (QA follow-up) Fix test permissions

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 15187: (QA follow-up) Add unit test
Martin Renvoize [Wed, 6 Jul 2022 11:52:05 +0000 (12:52 +0100)]
Bug 15187: (QA follow-up) Add unit test

This patch adds a unit test for the newly introduced filter.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 15187: Index 880 in Zebra the same as Elasticsearch
David Cook [Mon, 2 May 2022 07:34:34 +0000 (07:34 +0000)]
Bug 15187: Index 880 in Zebra the same as Elasticsearch

This patch modifies the MARC21 export to Zebra, so that 880 fields
are rewritten as their linked fields, in the same way that we
already do with Elasticsearch, so that the alternate graphic
representation of fields are indexed accordingly. (ie 880 $6245-01
Chinese titles will be indexed into the title index using the 245 rules)

Test plan:
0. Apply patch
1. Turn on ICU indexing
1b. vi /etc/koha/zebradb/etc/default.idx
1c. Replace charmap word-phrase-utf.chr with icuchain words-icu.xml
1d. Replace charmap word-phrase-utf.chr with icuchain phrases-icu.xml
1e. Restart Zebra server
1f. Re-index Zebra
2. Add record with a 880 $6 245-01 $a 教牧書信 field.
3. Search for this record using a title index with the Chinese title
4. Note that the record is correctly retrieved

(Note: This test probably works better using author or series as they
 present as links on the detail page which makes the fix more obviously
 useful.)

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>
2 years agoBug 26689: Prepend letter codes.
Martin Renvoize [Wed, 29 Jun 2022 16:26:30 +0000 (17:26 +0100)]
Bug 26689: Prepend letter codes.

This patch prepends the credit_type_code and debit_type_code with
CREDIT_ and DEBIT_ respectively when doing a lookup on the notice letter
code.

Test plan
1) As previous patches, however instead of just naming your notice to
   match the credit_type_code or debit_type_code use
   CREDIT_credit_type_code and DEBIT_debit_type_code respectively.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 26689: Check for specific template then fallback - printinvoice
Martin Renvoize [Fri, 12 Mar 2021 16:09:22 +0000 (16:09 +0000)]
Bug 26689: Check for specific template then fallback - printinvoice

This patch adds a check for a more specific ACCOUNT_DEBIT template
(named to match the debit_type_code of the credit line) prior to
falling back to the ACCOUNT_DEBIT template.

Test plan
1/ On a patrons account page use the print option on a series of debit
lines with differing credit types (Overdue, Payout)
2/ Note that the same template 'ACCOUNT_DEBIT' is used for all types
3/ Apply the patch
4/ Run step 1 again and note all still print using ACCOUNT_DEBIT
5/ Add a new notice template under the 'circulation' module with a code
that matches one of your account debit types (OVERDUE, PAYOUT)
6/ Run step 1 again and note that where you have added a specific notice
for that debit type it has been used.

Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 26689: Check for specific template then fallback - printfeercpt
Martin Renvoize [Fri, 12 Mar 2021 14:38:31 +0000 (14:38 +0000)]
Bug 26689: Check for specific template then fallback - printfeercpt

This patch adds a check for a more specific ACCOUNT_CREDIT template
(named to match the credit_type_code of the credit line) prior to
falling back to the ACCOUNT_CREDIT template.

Test plan
1/ On a patrons account page use the print option on a series of credit
lines with differing credit types (Payment, Lost Item Return, Writeoff)
2/ Note that the same template 'ACCOUNT_CREDIT' is used for all types
3/ Apply the patch
4/ Run step 1 again and note all still print using ACCOUNT_CREDIT
5/ Add a new notice template under the 'circulation' module with a code
that matches one of your account credit types (PAYMENT, WRITEOFF,
LOST_FOUND)
6/ Run step 1 again and note that where you have added a specific notice
for that credit type it has been used.

Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 30678: (follow-up) Change call in opac scripts
Marcel de Rooy [Tue, 10 May 2022 13:50:38 +0000 (13:50 +0000)]
Bug 30678: (follow-up) Change call in opac scripts

Test plan:
See first patch. Add orgcode OCoLC.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 30678: (follow-up) Add oclc_number routine and friends
Marcel de Rooy [Mon, 9 May 2022 10:19:57 +0000 (10:19 +0000)]
Bug 30678: (follow-up) Add oclc_number routine and friends

As requested by QA, we should match the orgcode.
Adding a few small routines in a Util module.

Test plan:
Run t/Koha/Util/MARC.t

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 30678: Adjust pref description
Marcel de Rooy [Wed, 4 May 2022 14:38:29 +0000 (14:38 +0000)]
Bug 30678: Adjust pref description

Test plan:
Look up pref OPACSearchForTitleIn.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 30678: Add OCLC_NO as option to OPACSearchForTitleIn
Marcel de Rooy [Wed, 4 May 2022 14:30:28 +0000 (14:30 +0000)]
Bug 30678: Add OCLC_NO as option to OPACSearchForTitleIn

We need to pass OCLC_NO as key to C4::Output::parametrized_url.
We get it from MARC21 035$a and strip the organizational code.

Test plan:
Add e.g. 62385712 in 035$a in a record.
Add e.g. following link to pref OPACSearchForTitleIn:
    <a  href="https://worldcat.org/search?q={OCLC_NO}" target="_blank">WorldCat (via OCLC number)</a>
Open that record on detail page. Click More searches. Follow that link.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 30858: (follow-up) Add enumchron to CSV export and fix CSS class
Katrin Fischer [Mon, 18 Jul 2022 20:53:46 +0000 (20:53 +0000)]
Bug 30858: (follow-up) Add enumchron to CSV export and fix CSS class

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>
2 years agoBug 30858: Add serial enumeration/chronology to item search
Lucas Gass [Thu, 26 May 2022 16:34:12 +0000 (16:34 +0000)]
Bug 30858: Add serial enumeration/chronology to item search

To test:
1. Apply patch
2. Go to  Catalog > Item search and do a search for items that you know contain a items.enumchron
3. The result set should now show the items.enumchron
4. Make sure you can properly "Export results to.."

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>
2 years agoBug 31121: Fix date formatting in cashup summary modal
Martin Renvoize [Fri, 8 Jul 2022 14:46:04 +0000 (15:46 +0100)]
Bug 31121: Fix date formatting in cashup summary modal

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 31204: Clearly indicate edit buttons are for record modification
Lucas Gass [Wed, 20 Jul 2022 16:53:28 +0000 (16:53 +0000)]
Bug 31204: Clearly indicate edit buttons are for record modification

To test:
1. Apply patch
2. Do a search and select some records
3. On the toolbar (#selection_ops) open the Edit dropdown.
4. The labels should read 'Batch edit records' and 'Batch delete records'.

Note: To see both you must have batchmod and batchdelete permission.

Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk>
Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 30838: (QA follow-up) Add unit tests
Martin Renvoize [Wed, 6 Jul 2022 10:54:35 +0000 (11:54 +0100)]
Bug 30838: (QA follow-up) Add unit tests

Two tests added, one in t/db_dependent/Circulation.t to catch the
initial setting of to_address at enqueue time and a second in
t/db_dependent/Letters.t to catch the correcting at send time.

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 30838: (QA follow-up) Add missing semicolon
Kyle Hall [Tue, 28 Jun 2022 11:27:17 +0000 (07:27 -0400)]
Bug 30838: (QA follow-up) Add missing semicolon

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 30838: Set to_address to smsalertnumber at send
Martin Renvoize [Tue, 24 May 2022 11:57:09 +0000 (12:57 +0100)]
Bug 30838: Set to_address to smsalertnumber at send

It may be helpful to know exactly what number was used for the sms alert
that was sent. As such, we should ensure it's set at the time of
sending.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 30838: Don't fallback through phone numbers for sms
Martin Renvoize [Tue, 24 May 2022 11:32:45 +0000 (12:32 +0100)]
Bug 30838: Don't fallback through phone numbers for sms

This patch removes the fallback handling for smsalartnumber as the
to_address in notices. We ignore the to_address field in the message
queue at send time for sms anyway and use smsalertnumber exclusively so
having this field populated is just confusing to the end user

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 31086: DBRev 22.06.00.020
Tomas Cohen Arazi [Fri, 22 Jul 2022 17:41:15 +0000 (14:41 -0300)]
Bug 31086: DBRev 22.06.00.020

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 31086: DBIC update
Tomas Cohen Arazi [Fri, 22 Jul 2022 17:39:02 +0000 (14:39 -0300)]
Bug 31086: DBIC update

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 31086: (QA follow-up) Use plain SQL in db_rev
Tomas Cohen Arazi [Fri, 22 Jul 2022 17:36:39 +0000 (14:36 -0300)]
Bug 31086: (QA follow-up) Use plain SQL in db_rev

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 31086: Notify of problematic holds during upgrade
Nick Clemens [Fri, 22 Jul 2022 12:31:55 +0000 (12:31 +0000)]
Bug 31086: Notify of problematic holds during upgrade

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 31086: (QA follow-up) Improve atomicupdate to be more resilient
Martin Renvoize [Fri, 22 Jul 2022 09:05:55 +0000 (10:05 +0100)]
Bug 31086: (QA follow-up) Improve atomicupdate to be more resilient

We now populate the branchcode field with the first available branch on
the system if we find it to be NULL before we set the NOT NULL

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 31086: (QA follow-up) Add unit tests
Martin Renvoize [Tue, 12 Jul 2022 15:22:46 +0000 (16:22 +0100)]
Bug 31086: (QA follow-up) Add unit tests

This patch adds the unit tests for the change to Koha::Hold::store.

We test for and catch the exception introduced for both the create and
update cases.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 31086: (QA follow-up) Fix failing tests
Martin Renvoize [Tue, 12 Jul 2022 15:21:30 +0000 (16:21 +0100)]
Bug 31086: (QA follow-up) Fix failing tests

This test was missed first time around, branchcode needed adding to all
the calls to AddReserve.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 31086: (QA follow-up) Remove DEFAULT from column
Martin Renvoize [Tue, 12 Jul 2022 14:39:37 +0000 (15:39 +0100)]
Bug 31086: (QA follow-up) Remove DEFAULT from column

There's no need to have a default here, and in fact it doesn't make
sense.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 31086: Update existing unit tests
Nick Clemens [Fri, 1 Jul 2022 15:30:33 +0000 (15:30 +0000)]
Bug 31086: Update existing unit tests

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>
2 years agoBug 31086: Prevent placing hold with no pickup location
Nick Clemens [Fri, 1 Jul 2022 14:46:26 +0000 (14:46 +0000)]
Bug 31086: Prevent placing hold with no pickup location

To test:
1 - Apply patch
2 - Repeat test on previous patch
3 - You should get a warning popup when attempting to save hold
4 - Reload page
5 - Inspect the HTML and manualy set #pickup value of selected option to ""
6 - Attempt to save hold
7 - You get the popup
8 - Place a hold normally (with location) and verify it works

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>
2 years agoBug 31086: Throw an exception when a hold is stored with no branchcode
Nick Clemens [Fri, 1 Jul 2022 14:44:09 +0000 (14:44 +0000)]
Bug 31086: Throw an exception when a hold is stored with no branchcode

To test:
1 - Apply first 2 patches
2 - On staff client, find a biblio, place hold, select a patron
3 - Before creating hold, right click on 'Pickup location'
4 - Inspect the element
5 - In the console find the top <li> for pickup, and right click
6 - Select 'Delete node'
7 - Save hold
8 - You get an exception/error

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>
2 years agoBug 31086: DB update
Nick Clemens [Fri, 1 Jul 2022 14:43:09 +0000 (14:43 +0000)]
Bug 31086: DB update

This update sets branchcode as NOT NULL
default set to 0 as borrowernumber is

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>
2 years agoBug 31138: Don't ignore DataTables errors and raise them to the end-user
Jonathan Druart [Tue, 12 Jul 2022 08:09:25 +0000 (10:09 +0200)]
Bug 31138: Don't ignore DataTables errors and raise them to the end-user

DataTables is not raising error to the end user, it's only displaying a generic message in the console.
This leads to lot of questions on IRC or the mailing list ("the table is empty").
We can do better and display what went wrong.

We could also imagine add a link to the wiki for the more common problems (won't be implemented here however).

Test plan:
Revert "Bug 31104: Put each link on a separate header" and search for a
patron using a very long string
You should get an alert with the reponse of the server.
In my case:
"""
Something went wrong when loading the table.
414: Request-URI Too Long
"""

You can also make the REST API returns a 500 (bad specs or simply with a
die statement).

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>
2 years agoBug 23838: (QA follow-up) Move include files
Tomas Cohen Arazi [Fri, 22 Jul 2022 15:46:30 +0000 (12:46 -0300)]
Bug 23838: (QA follow-up) Move include files

As talked with Martin, this patches were originally developed before we
added the modals/ and str/ dirs, but we need to align it with current
way of doing it. This patch does that.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 23838: Add 'view' link to item detail page
Tomas Cohen Arazi [Fri, 22 Jul 2022 15:16:32 +0000 (12:16 -0300)]
Bug 23838: Add 'view' link to item detail page

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 23838: (QA follow-up) Rename patron-renewal => checkout-renewal
Tomas Cohen Arazi [Fri, 22 Jul 2022 15:15:46 +0000 (12:15 -0300)]
Bug 23838: (QA follow-up) Rename patron-renewal => checkout-renewal

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 23838: Use $patron_to_html formater
Martin Renvoize [Fri, 22 Jul 2022 09:56:40 +0000 (10:56 +0100)]
Bug 23838: Use $patron_to_html formater

This patch updates the renewals modal to correctly format the staff
member who renewed the checkout.

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 23838: (follow-up) Add missing template filter
Owen Leonard [Tue, 26 Apr 2022 16:56:12 +0000 (16:56 +0000)]
Bug 23838: (follow-up) Add missing template filter

Quieting an issue highlighted by the QA tool.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 23838: Use $datetime formater
Martin Renvoize [Fri, 18 Mar 2022 14:53:41 +0000 (14:53 +0000)]
Bug 23838: Use $datetime formater

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 23838: Add renewals modal
Andrew Isherwood [Fri, 18 Oct 2019 07:56:21 +0000 (08:56 +0100)]
Bug 23838: Add renewals modal

This patch adds the display of the renewals modal when appropriate. A
"View" link is displayed next to renewals count where appropriate.
Clicking the link opens the modal that displays the logged renewals.

Sponsored-by: Loughborough University
Signed-off-by: Myka Kennedy Stephens <mkstephens@lancasterseminary.edu>
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Bouzid Fergani <bouzid.fergani@inlibro.com>
Signed-off-by: Ben Veasey <B.T.Veasey@lboro.ac.uk>
Rescued-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
I rescued this patchset by squashing previous work and updating it to
utilise the new renewals API routes introduced in bug 30275.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 31128: Add effective_not_for_loan_status into items response
Martin Renvoize [Mon, 11 Jul 2022 12:07:28 +0000 (13:07 +0100)]
Bug 31128: Add effective_not_for_loan_status into items response

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 31128: Unit tests
Martin Renvoize [Mon, 11 Jul 2022 12:46:05 +0000 (13:46 +0100)]
Bug 31128: Unit tests

This patch adds unit tests for the new effective_not_for_loan_status
which I add to the items api responses in this patchset.

Test plan
1) Run the unit test without applying the next commit, it should fail
2) RUn the test again after applying the next commit, it should pass

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 31213: Auto search simple term quoted
Nick Clemens [Thu, 21 Jul 2022 18:16:22 +0000 (18:16 +0000)]
Bug 31213: Auto search simple term quoted

This patch does a second search if the first had no results and was a simple single term search

We simply quote the term, rebuild the query, and rerun the search

This targets both Zebra and ES, but is more relevant for ES

To test:
0 - Have Koha running using ES
1 - Add titles your system "Ivy + Bean" "The 6:20 Man"
2 - Search for these titles without quotes - NO results under ES
3 - Search with quotes - you find them
4 - Apply patch, restart all
5 - Search again without quotes
6 - Success!
7 - Confirm search still works under Zebra

Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 30458: Include librarian (manager_id) in accountline when using "Payout amount...
Kyle Hall [Tue, 5 Apr 2022 13:40:51 +0000 (09:40 -0400)]
Bug 30458: Include librarian (manager_id) in accountline when using "Payout amount" button

When using the "Payout amount" button, accountlines.manager_id is not
populated. This is not the case with the "Issue payout" buttons.

Test Plan:
1) Create a manual credit
2) Issue a payout using the "Payout amount" button
3) Inspect the payout accountline, note it has no manager_id
4) Apply this patch, restart all the things!
5) Repeat steps 1 and 2
6) Note the new payout accountline has a manager_id!

Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk>
JK: Fix commit title

Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 30471: Correct display of default rules
Nick Clemens [Wed, 6 Apr 2022 13:49:58 +0000 (13:49 +0000)]
Bug 30471: Correct display of default rules

To test:
1 - Browse to 'Administration->Circulation and fines rules'
2 - Make sure you are editing 'Standard rules for all libraries'
3 - Set 'Lost item fee refund on return policy' to 'Refund lost item charge and charge new overdue fine'
4 - Swtich to edit rules for a specific library, click on the dropdown for 'Lost item fee refund on return policy' and note default says 'Use default (Refund lost item charge and restore overdue fine)'
5 - Switch default/all libraries rule to 'Refund lost item charge and restore overdue fine'
6 - On specific branch note the default option is now 'Use default (Refund lost item charge and charge new overdue fine)'
7 - Apply patch and repeat, note the default descriptions now display correctly

Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk>
Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 29001: (QA follow-up) Remove code duplication
Joonas Kylmälä [Thu, 21 Jul 2022 17:57:20 +0000 (17:57 +0000)]
Bug 29001: (QA follow-up) Remove code duplication

Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 29001: Fix framework edition when subfields are reordered
Jonathan Druart [Tue, 19 Jul 2022 15:00:29 +0000 (17:00 +0200)]
Bug 29001: Fix framework edition when subfields are reordered

There is a flaw when subfields are ordered, the inputs are not retrieved
correctly.
We should not rely on the order but use an id instead.
Test plan:
Create, edit subfields
Modify values from the different subfields
Confirm that values are correctly saved

Signed-off-by: Thibault Kero <thibault.keromnes@univ-paris8.fr>
Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 31202: Don't remove optional SIP fields with a value of "0"
Kyle Hall [Wed, 20 Jul 2022 16:32:58 +0000 (12:32 -0400)]
Bug 31202: Don't remove optional SIP fields with a value of "0"

If the value of a SIP field is "0", that evaluates to false, so any calls to maybe_add with a value of "0" will not get added to the SIP response message.

Test Plan:
1) Apply this patch
2) prove t/db_dependent/SIP/Message.t

Signed-off-by: Michal Urban <michalurban177@gmail.com>
JK: Adjust commit title

Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 25449: (QA follow-up) Fix basic_workflow.t
Martin Renvoize [Thu, 21 Jul 2022 06:47:20 +0000 (07:47 +0100)]
Bug 25449: (QA follow-up) Fix basic_workflow.t

Now that we have made item.itype a required field, we need to ensure we
set it for the corresponding selenium test.. this wasn't entirely easy
as the html select is hidden by select2. I had to find the select2 span,
trigger a click event to open it and then find and click an option.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 25449: Fix basic_workflow.t
Jonathan Druart [Wed, 20 Jul 2022 15:39:22 +0000 (17:39 +0200)]
Bug 25449: Fix basic_workflow.t

We need to create an itemtype for the biblio, then the item form will
have 942$c prefilled by default

STRACE: /usr/share/perl5/Try/Tiny.pm:123 in Selenium::Remote::Driver::catch {...}
        /usr/share/perl5/Selenium/Remote/Driver.pm:361 in Try::Tiny::try
        (eval 1726):1 in Selenium::Remote::Driver::__ANON__
        (eval 1728):2 in Selenium::Remote::Driver::__ANON__
        /usr/share/perl5/Selenium/Remote/Driver.pm:953 in Selenium::Remote::Driver::_execute_command
        t/db_dependent/selenium/basic_workflow.t:224 in Selenium::Remote::Driver::get_title

Error while executing command: unexpected alert open: Dismissed user prompt dialog: Form not submitted because of the following problem(s)
------------------------------------------------------------------------------------

- 1 mandatory fields empty (highlighted) at /usr/share/perl5/Selenium/Remote/Driver.pm line 411.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 31201: Prevent Pseudonymization.t to fail
Jonathan Druart [Wed, 20 Jul 2022 15:44:05 +0000 (17:44 +0200)]
Bug 31201: Prevent Pseudonymization.t to fail

It's failing if selenium/patrons_search.t failed before, they are using
the same code and the selenium tests didn't clean correctly

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 31186: Fix the hidingrules test for result numbering
Marcel de Rooy [Tue, 19 Jul 2022 11:27:55 +0000 (11:27 +0000)]
Bug 31186: Fix the hidingrules test for result numbering

We should not test the $hidingrules variable but the number
of keys it contains.

Test plan:
Clear OpacHiddenItems.
Check with and without this patch search result numbering on
the OPAC.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 27045: (follow-up) Fix delimiter in header rows
Katrin Fischer [Sat, 16 Jul 2022 11:23:54 +0000 (11:23 +0000)]
Bug 27045: (follow-up) Fix delimiter in header rows

The header rows still showed \t because the newly defined
variable wasn't used there.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 27045: Fix other exports using CSV profiles
Jonathan Druart [Fri, 20 Nov 2020 14:33:14 +0000 (15:33 +0100)]
Bug 27045: Fix other exports using CSV profiles

This patch corrects the export of the 2 other reports
using CSV profiles:

* Late issues (serials)
* Basket (acquisitions)

To test:
1) Late issues
* Update the late issues sample report to use tab as separator
* Create a subscription
* Go to serial collection and 'generate next' to get some late issues
* Go to Claims
* Export the late issues and verify format is correct
* Verify exported file has tabs

2) Basket summary
* Create an order with several order lines
* Create an SQL type CSV profile for basket export using tab as separator
  Example: aqorders.quantity|aqordres.listprice|Title=biblio.title
* Export the basket using your configured CSV profile
* Verify exported file has tabs

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 27045: Fix items lost report export if delimiter is tab
Jonathan Druart [Fri, 20 Nov 2020 14:33:02 +0000 (15:33 +0100)]
Bug 27045: Fix items lost report export if delimiter is tab

When choosing tabulation as the delimiter for a CSV profile
for the lost item report, the tabs appear in the file as \t
instead of as proper tabs.

title\tauthor\tstocknumber\tcallnumber
"E Street shuffle :"\"Heylin, Clinton."\\

To test:
* Upate the existing sample lost item CSV profile to use tabs as
  separator
* Make sure you have some lost items in your database or create some
* Go to Reports > Lost items
* Run the report
* Check all or some of the checkboxes in the result list
* Export using the link on top and the CSV profile
* Verify the tabs are not exported correctly
* Apply patch
* Verify tabs now are proper tabs instead of \t

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 31192: Check for item before calling is_bundle
Martin Renvoize [Wed, 20 Jul 2022 08:29:39 +0000 (09:29 +0100)]
Bug 31192: Check for item before calling is_bundle

The code in here is weird.. we really aught to check for the item before
anything else and throw an error to screen if we don't find one... but
my patch takes the simple option, and the one taken elsewhere in the
script.. to just check for item being defined before calling a method
upon it.

Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 30268: Check mandatory fields in addorderiso2709.pl
Julian Maurice [Wed, 9 Mar 2022 15:42:50 +0000 (16:42 +0100)]
Bug 30268: Check mandatory fields in addorderiso2709.pl

Test plan:
1. Make sure you have mandatory item subfields in the MARC bibliographic
   framework used in acquisitions ("ACQ" if it exists, the default framework
   otherwise).
2. Use the "Stage MARC records for import" tool to upload a file. Do not import
   the bibliographic records.
3. Create a new acquisition basket ("Create items when:" must be set to
   "placing an order") and add a new order from a staged file
4. Select the file you just uploaded
5. In the "Items information" tab, make sure at least one mandatory subfield is
   empty
6. Try to submit the form. If there are errors about other mandatory fields
   (like the fund for instance), fix those errors and resubmit. There should be
   an error message about mandatory item subfields.
7. Enter a value for the mandatory item subfields and resubmit the form. Verify
   that the order and the item have been correctly created.

Signed-off-by: Thibault Kero <thibault.keromnes@univ-paris8.fr>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 30333: Move view actions on acquisitions receipt summary page into menu
Owen Leonard [Tue, 22 Mar 2022 11:25:12 +0000 (11:25 +0000)]
Bug 30333: Move view actions on acquisitions receipt summary page into menu

This patch moves the "views" group of links (MARC, Card, and Order) into
a menu button. The patch also makes some corrections to the modal markup
and handling to fix a display error.

To test you must have a basket or baskets with multiple titles on order,
both received and pending.

- Apply the patch and go to Acquisitions -> Vendor -> Receive shipment
  -> Receive a new shipment (or open an existing invoice).
- In the list of pending orders:
  - Test the 'View' menu for multiple titles. The 'Order,' 'MARC,' and
    'Card' menu items should work correctly.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 7660: Use first available categorycode when none passed in
Nick Clemens [Mon, 18 Jul 2022 11:49:57 +0000 (11:49 +0000)]
Bug 7660: Use first available categorycode when none passed in

The code that populates the patron messaging preferences on initial form load
expects to have a category selected. Currently we only have one if one was
passed to the form. When creating an account from a parent, we don't have a
category explicitly selected - so we can just select the first of the possible
categories

To test:
 1 - In KTD set 'Juvenile' category to have some messaging preferences
 2 - Find a patron, say Edna Acosta, and 'Add guarantee'
 3 - In new form preferences are blank, cancel
 4 - Apply patch, restart all
 5 - Go to Edna, click 'Add guarantee'
 6 - Preferences are populated!
 7 - Cancel
 8 - Go to 'Patrons' module
 9 - Click "+ New patron"
10 - Confirm messaging preferences load correctly when not adding child

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>
2 years agoBug 30570: Compiled CSS
Tomas Cohen Arazi [Wed, 20 Jul 2022 13:05:29 +0000 (10:05 -0300)]
Bug 30570: Compiled CSS

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 30570: Replace the use of jQueryUI tabs in OPAC templates
Owen Leonard [Wed, 6 Jul 2022 11:36:11 +0000 (11:36 +0000)]
Bug 30570: Replace the use of jQueryUI tabs in OPAC templates

This patch switches to Bootstrap tabs anywhere in the OPAC where
jQueryUI tabs were used.

To test, apply the patch and rebuild the OPAC CSS
(https://wiki.koha-community.org/wiki/Working_with_SCSS_in_the_OPAC_and_staff_client).

- Test the item type/collection/shelvinglocation tabs on the advanced
  search page. Test that it works correctly with different variations of
  the OpacAdvancedSearchTypes system preference.
- Search for an authority record and view the details. The "Notes"
  tab should be styled correctly.
- Locate a bibliographic record and view the detail page. Verify
  that tabs are working, including all the options:
- Holdings
- Other holdings ( If OpacSeparateHoldings is enabled)
- Descriptions ( MARC notes )
- Subscriptions
- Serial collection (UNIMARC, untested)
- Components ( If ShowComponentRecords is enabled. Link to sample
  record:
  https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=78023 )
- Comments
- Editions (OPACFRBRizeEditions)
- Html5media ( If HTML5MediaEnabled is on. Link to sample records:
  (https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=10685)
- Images ( If OPACLocalCoverImages is enabled )

Bonus points for testing these tabs for which I don't have
credentials:
- Syndetics TOC
- Syndetics Excerpt
- Syndetics Reviews
- Syndetics AuthorNotes
- LibraryThing for Libraries (with LibraryThingForLibrariesTabbedView
  set to "in tabs."
- NovelistSelect

- Check tabs on these patron-related pages:
  - Checkout history
  - Search history
  - Patron summary. The following tabs are
    ✓ Checkouts
    ✓ Relatives' checkouts
    ✓ Overdues
    ✓ Fines
    ✓ Relatives' fines
    ✓ Holds
    ✓ Recalls
    ✓ Article requests
    ✓ Overdrive

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Bug 30570: (follow-up) Correct rebase errors

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 30039: (QA follow-up) Change published on to publication date
Katrin Fischer [Mon, 18 Jul 2022 20:18:50 +0000 (20:18 +0000)]
Bug 30039: (QA follow-up) Change published on to publication date

As the issue might not have been published yet, but should have
been that seemed a better fit.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 30039: Add published on column to claims.pl
Lucas Gass [Mon, 7 Feb 2022 19:02:53 +0000 (19:02 +0000)]
Bug 30039: Add published on column to claims.pl

To test:
1. Have a vendor setup
2. Go to serials and add a new serial w/ that vendor.
3. When creating a serial make this first issues sometime in the past.
4. Go to Claims, choose your vendor and load the table.
5. No published on column.
6. Apply patch
7. Try step 4 again and now you should see a published on column.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 26377: Simplify JS code
Jonathan Druart [Tue, 31 May 2022 09:18:08 +0000 (11:18 +0200)]
Bug 26377: Simplify JS code

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 26377: Show when loading the page if needed
Jonathan Druart [Tue, 31 May 2022 09:16:57 +0000 (11:16 +0200)]
Bug 26377: Show when loading the page if needed

Prevent a blink

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 26377: Clearly label parts of subscription-add.pl that relate to optional item...
Owen Leonard [Thu, 12 May 2022 16:25:05 +0000 (16:25 +0000)]
Bug 26377: Clearly label parts of subscription-add.pl that relate to optional item records

This patch modifies the form for adding a new subscription so that the
collection and item type fields are shown only when the subscription is
configured to create an item when receiving.

To test, apply the patch and go to Serials -> New subscription.

- When the page first loads, the "Do not create an item record when
  receiving this serial" radio button should be selected.
- Under the "Location" field there should be no item type or collection
  field.
- Select the "Create an item when receiving this serial" radio button.
- The item type and collection fields should appear.
- Test that the values are correctly saved when you add or edit a
  subscription.
- If you edit a subscription which had item type and collection defined,
  and you switch to "Do not create an item..." the record should save with
  empty values for those fields.
- Confirm that existing subscriptions open with the correct settings
  applied: Only records with "Create an item..." checked should open
  with the item type and collection fields displayed.

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>
2 years agoBug 31020: Fix PassItemMarcToXSLT in system preferences description
Fridolin Somers [Thu, 23 Jun 2022 01:04:47 +0000 (15:04 -1000)]
Bug 31020: Fix PassItemMarcToXSLT in system preferences description

Bug 28373 added system preference PassItemMarcToXSLT is referenced is all XSLT system preferences.
But it only applies on results pages.
The only use in perl code is in C4::Search :
 > $marcrecord->delete_fields( @fields ) unless C4::Context->preference('PassItemMarcToXSLT');

I've tested by adding in all XSLT files :
  <strong>ITEMS <xsl:value-of select="count(marc:datafield[@tag=952])"/> </strong>
Number of items only appears in OPAC and staff interface results pages.

In fact only search pages get MARC record from search engine, in which items datas have been embedded for indexing.
In other pages MARC record does not embed items datas.

This patch adds "MARC21 952, UNIMARC 995" to be explicit we talk about
MARC datas not item tags build in XML recieved by XSLT.

Test plan :
1) Apply patch
2) Search for PassItemMarcToXSLT in system preferencies
3) Look at description of PassItemMarcToXSLT
4) Check PassItemMarcToXSLT only apprears in OPACXSLTResultsDisplay and XSLTResultsDisplay

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 27546: (follow-up) Avoid index clash
Nick Clemens [Fri, 6 May 2022 12:40:00 +0000 (12:40 +0000)]
Bug 27546: (follow-up) Avoid index clash

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 27546: (follow-up) Escape new search string
Nick Clemens [Tue, 26 Apr 2022 10:56:52 +0000 (10:56 +0000)]
Bug 27546: (follow-up) Escape new search string

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 27546: Add 'Search within results' search box
Nick Clemens [Thu, 21 Jan 2021 14:23:35 +0000 (14:23 +0000)]
Bug 27546: Add 'Search within results' search box

This enhancement adds a new input above the search results allowing one to search within the results. The search
box will take a query and add it as a limit to the previous search

These patches make a slight change to the search header, passing the dropdown selection as a parameter rather thandirectly.

Searching this way is functionally equivaled to adding 'AND' with the new term to original results.

To test:
1 - Apply patch
2 - Search on staff client wiht a term that returns results
3 - Note the new 'Search within results box'
4 - Add a search term
5 - Note new results and confirm they are as expected
6 - Enable IntranetCatalogSearchPulldown and confirm the dropdown works as expected
7 - Edit your search - the reinfements appear in the limits section and can be removed

Signed-off-by: Barbara Johnson <barbara.johnson@bedfordtx.gov>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 30933: DBRev 22.06.00.019
Tomas Cohen Arazi [Wed, 20 Jul 2022 12:16:47 +0000 (09:16 -0300)]
Bug 30933: DBRev 22.06.00.019

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 30909: Retain permanent_location if mapped
Jonathan Druart [Tue, 7 Jun 2022 09:27:04 +0000 (11:27 +0200)]
Bug 30909: Retain permanent_location if mapped

If items.permanent_location is mapped to a MARC subfields we must retain
the value, not using items.location

Test plan:
1 - Map permanent_location to a marc field
2 - Expose that field in the item editor
3 - Change the location of the item and retain the permanent location on saving
4 - note that permanent location has not changed

Test the different other situation, when adding and editing: Empty the field, change only location, change only permanent_location, etc.

Signed-off-by: andrew <andrewfh@dubcolib.org>
Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 31179: (QA follow-up) Set field as hidden for tests
Nick Clemens [Tue, 19 Jul 2022 15:26:51 +0000 (15:26 +0000)]
Bug 31179: (QA follow-up) Set field as hidden for tests

We want the tests to pass in the case where field is set to visibile in Koha

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 31179: (QA follow-up) POD fix
Nick Clemens [Tue, 19 Jul 2022 15:17:56 +0000 (15:17 +0000)]
Bug 31179: (QA follow-up) POD fix

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 31179: Don't copy invisible subfields when duplicating items
Jonathan Druart [Tue, 19 Jul 2022 14:09:46 +0000 (16:09 +0200)]
Bug 31179: Don't copy invisible subfields when duplicating items

Duplicate item is intended to duplicate the visible cataloging fields of an item, however,
currently it is duplicating the complete internal record of the item

To recreate:
1 - find an item in Koha staff client, copy the barcode
2 - Issue this item to a patron
3 - Return to the record
4 - Edit items
5 - Click 'Actions->Duplicate' for the item in question
6 - Save the item
7 - Note in the items table above for that 'Total checkouts' 'Due date'
 etc. have not been copied to new item

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 30933: Add lists methods for disowning
Tomas Cohen Arazi [Tue, 19 Jul 2022 17:49:52 +0000 (14:49 -0300)]
Bug 30933: Add lists methods for disowning

This patch aims to tidy things a bit by doing the following changes:

* Koha::Virtualshelf gets the 'transfer_ownership' method
* Koha::Virtualshelves gets the 'disown_or_delete' method
* Koha::Patron->delete gets rewritten/simplified by using
  disown_or_delete

The idea is to capture the current behavior in more fine grained
methods. So current tests should be passing as they do now.

To test:
1. Run:
   $ kshell
  k$ prove t/db_dependent/Koha/Patrons.t \
           t/db_dependent/Virtualshelves.t
=> SUCCESS: Tests pass
2. Apply this patches
3. Repeat 1
=> SUCCESS: Tests still pass!
4. Run:
  k$ prove t/db_dependent/Koha/Virtualshelf.t \
           t/db_dependent/Koha/Virtualshelves.t
=> SUCCESS: Tests pass!
5. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 30933: Unit tests
Tomas Cohen Arazi [Tue, 19 Jul 2022 17:49:24 +0000 (14:49 -0300)]
Bug 30933: Unit tests

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 30933: (follow-up) Use cannot_be_transferred in shelves scripts
Marcel de Rooy [Wed, 22 Jun 2022 12:14:37 +0000 (12:14 +0000)]
Bug 30933: (follow-up) Use cannot_be_transferred in shelves scripts

Test plan:
Verify if transfer shared list on OPAC still works as expected.
Same for intranet counterpart for public lists.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
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>
2 years agoBug 30933: (follow-up) Consolidate transfer checks
Marcel de Rooy [Tue, 21 Jun 2022 14:41:42 +0000 (14:41 +0000)]
Bug 30933: (follow-up) Consolidate transfer checks

Adding shelf->cannot_be_transferred with unit tests.

Note: This follow-up actually refers to comment42 on the
preceding report 25498.
Furthermore, we could still improve later on using error code
more effectively (adding codes). Here we concentrate on moving
the checks to module level.

Test plan:
Run t/db_dependent/Virtualshelves.t

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
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>
2 years agoBug 30933: Adjust pref description, include ListOwnerDesignated
Marcel de Rooy [Mon, 20 Jun 2022 11:48:25 +0000 (11:48 +0000)]
Bug 30933: Adjust pref description, include ListOwnerDesignated

Test plan:
View the pref on the System preferences, Patrons tab.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
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>
2 years agoBug 30933: Change for patron->delete
Marcel de Rooy [Mon, 20 Jun 2022 10:03:59 +0000 (10:03 +0000)]
Bug 30933: Change for patron->delete

Test plan:
Run t/db_dependent/Koha/Patrons.t
Set pref ListOwnershipUponPatronDeletion to transfer.
Set pref ListOwnerDesignated to some valid borrowernumber.
Pick a user with public or shared list, delete from interface.
Pick a user with public or shared list, delete by script. (*)
Verify in both cases that new list owner is the designated one.

(*) Tip: Create another branch. Move the patron to be deleted to that
branch. And delete by script with:
    misc/cronjobs/delete_patons.pl -c -v -library YOUR_CODE

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
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>
2 years agoBug 30933: Database revision (new pref)
Marcel de Rooy [Tue, 21 Jun 2022 11:29:09 +0000 (11:29 +0000)]
Bug 30933: Database revision (new pref)

Adds pref ListOwnerDesignated.
Generalize description of ListOwnershipUponPatronDeletion a bit.

Test plan:
Run updatedatabase.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
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>
2 years agoBug 25498: (follow-up) Show error message when no sharee has email
Marcel de Rooy [Wed, 20 Jul 2022 11:45:23 +0000 (11:45 +0000)]
Bug 25498: (follow-up) Show error message when no sharee has email

Test plan:
Share a list with a patron that has no email address.
Try to transfer ownership. Verify that you get the error message.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 25498: (follow-up) Change for autocomplete change of 30578
Marcel de Rooy [Tue, 19 Jul 2022 12:18:21 +0000 (12:18 +0000)]
Bug 25498: (follow-up) Change for autocomplete change of 30578

Test plan:
Check if the patron search still works on the intranet shelves form
when transferring ownership.

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>
2 years agoBug 25498: (QA follow-up) Rename virtualshelfshare->patron
Marcel de Rooy [Fri, 17 Jun 2022 06:58:09 +0000 (06:58 +0000)]
Bug 25498: (QA follow-up) Rename virtualshelfshare->patron

This patron is a 'sharee' (not the sharer).

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 25498: Transfer ownership shared list on OPAC
Marcel de Rooy [Mon, 13 Jun 2022 09:40:07 +0000 (09:40 +0000)]
Bug 25498: Transfer ownership shared list on OPAC

Test plan:
Pick or create a shared list. Login as owner.
Transfer to one of the other members.
Verify that you do no longer have Transfer, but see Remove share.
Login as the other member. Transfer it back.

Bonus: Working with two tabs, you can open the Transfer form and
in the meantime delete the list, the patron or remove the share.
Or change permissions. Submit after that and check the error message.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
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>
2 years agoBug 25498: Show transfer button for shared lists on OPAC
Marcel de Rooy [Fri, 10 Jun 2022 09:42:41 +0000 (09:42 +0000)]
Bug 25498: Show transfer button for shared lists on OPAC

Test plan:
Pick or create a shared list.
Verify that OPAC only shows the Transfer button when you are the
owner of a shared list.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
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>
2 years agoBug 25498: Add a transfer form for public lists
Marcel de Rooy [Fri, 10 Jun 2022 08:26:16 +0000 (08:26 +0000)]
Bug 25498: Add a transfer form for public lists

Test plan:
[1] Valid transfer:
    Log in with staff patron C having edit_public_lists.
    Pick a public list. Choose Transfer. Select a patron.
    Submit and check if transfer was successful.
[2] Permission problem:
    Pick a staff user D. Temporary enable edit_public_lists.
    Add another private tab. Login with D.
    Pick a public list. Transfer. Choose another patron. Wait.
    Switch tab: remove added permission from D.
    Switch tab again: Submit transfer form. Error? Close tab.
[3] Bonus test - Shelf disappeared:
    Pick a public list. Transfer. Choose another patron. Wait.
    Open another tab. Delete the selected public list.
    Close tab. Submit the transfer. Not exist error?
[4] Bonus test - Patron not found:
    Pick a public list. Transfer. Choose another patron. Wait.
    Open another tab. Delete selected patron.
    Close tab. Submit transfer. Patron not found error?

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
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>
2 years agoBug 25498: Add transfer button on intranet
Marcel de Rooy [Thu, 9 Jun 2022 12:59:43 +0000 (12:59 +0000)]
Bug 25498: Add transfer button on intranet

Note: Adjusting shelves_results template too for not allowing delete
when you do not have delete_public_lists (or higher). If you are the
owner, you are allowed to edit or delete. But transfer specifically
needs edit_public_lists (or higher).

Note: Removed a few useless POD lines to make qa tools happy.

Test plan:
Check if you see the transfer button on public lists only when having
permission edit_public_lists (or higher). And never on private lists.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
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>
2 years agoBug 11889: DBRev 22.06.00.018
Tomas Cohen Arazi [Tue, 19 Jul 2022 14:21:00 +0000 (11:21 -0300)]
Bug 11889: DBRev 22.06.00.018

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 11889: (QA follow-up) Spelling
Martin Renvoize [Thu, 9 Jun 2022 14:39:36 +0000 (15:39 +0100)]
Bug 11889: (QA follow-up) Spelling

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 11889: (follow-up) We did not need get_shared_shelves after all
Marcel de Rooy [Thu, 9 Jun 2022 09:12:18 +0000 (09:12 +0000)]
Bug 11889: (follow-up) We did not need get_shared_shelves after all

Test plan:
Run t/db_dependent/Virtualshelves.t

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 11889: (follow-up) Get rid of FIXME in Koha::Patron
Marcel de Rooy [Thu, 9 Jun 2022 07:24:31 +0000 (07:24 +0000)]
Bug 11889: (follow-up) Get rid of FIXME in Koha::Patron

Instead of get_lists, I added ->virtualshelves.

I removed the addition of the suffix to the shelf name here; if we
really want that (doubts), we should do it pref based. Removing a
staff member with public lists would result in weird names with
shelf numbers on the OPAC. (Should be very easy to restore.)

Used this opportunity to refactor the patron->delete subtest a bit:
switching to build_object, removing the 'retrieved patrons',
differentiating between staff patron and patron for sharing,
adding a few tests.

Test plan:
Enable transfer ownership. Delete a patron with lists in interface.
Check what happened.
Run t/db_dependent/Koha/Patrons.t.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 11889: (QA follow-up) Fix tests
Marcel de Rooy [Wed, 8 Jun 2022 14:35:31 +0000 (14:35 +0000)]
Bug 11889: (QA follow-up) Fix tests

We need some changes for 28959 changing category to public.
Added the userenv mocking.

Note: A follow-up does a bit more refactoring here. But they
should pass at least now.

Test plan:
Run t/db_dependent/Virtualshelves.t
Run t/db_dependent/Koha/Patrons.t

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 11889: (QA follow-up) Changes for wantarray move in ->search
Marcel de Rooy [Wed, 8 Jun 2022 14:47:05 +0000 (14:47 +0000)]
Bug 11889: (QA follow-up) Changes for wantarray move in ->search

See bug 29844.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 11889: (QA follow-up) Convert to new atomicupdate style
Marcel de Rooy [Wed, 8 Jun 2022 14:14:43 +0000 (14:14 +0000)]
Bug 11889: (QA follow-up) Convert to new atomicupdate style

The first patch contained an old .sql atomic update.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 11889: (QA follow-up) Add POD ground work
Marcel de Rooy [Wed, 8 Jun 2022 14:05:42 +0000 (14:05 +0000)]
Bug 11889: (QA follow-up) Add POD ground work

Make QA tools a fraction happier ;)

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 11889: (follow-up) Tests and new get_shared_shelves
Aleisha Amohia [Mon, 20 Feb 2017 21:51:39 +0000 (21:51 +0000)]
Bug 11889: (follow-up) Tests and new get_shared_shelves

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
This is a manual reconstruction of an older patch, that git
did not want to apply anymore (sha trouble etc.)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 11889: (QA follow-up) Add entry to sysprefs.sql
Marcel de Rooy [Thu, 16 Feb 2017 09:30:35 +0000 (10:30 +0100)]
Bug 11889: (QA follow-up) Add entry to sysprefs.sql

Also changes the insert in the atomic update to an insert ignore, as
we generally do for inserting sysprefs (see updatedatabase).

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Cédric Vita <cedric.vita@dracenie.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 11889: (follow-up) Remove share if you are the new owner
Marcel de Rooy [Thu, 16 Feb 2017 09:04:27 +0000 (10:04 +0100)]
Bug 11889: (follow-up) Remove share if you are the new owner

This will probably be exceptional. But if the staff member already had
a share for a private list of the patron he deletes now, he will be
the new owner and we should remove the share record.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Cédric Vita <cedric.vita@dracenie.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>