koha.git
7 months agoBug 28688: Add renew option to membership_expiry.pl
Marcel de Rooy [Wed, 14 Jun 2023 13:34:11 +0000 (13:34 +0000)]
Bug 28688: Add renew option to membership_expiry.pl

Test plan:
[1] Pick an account to expire soon.
[2] Choose MembershipExpiryDaysNotice so that it will be selected.
    (Note: You can extend the selection with -before or -after.)
[3] Run misc/cronjobs/membership_expiry.pl -c -v -renew
[4] Check new expiry date in the notice. Does it correspond with
    enrollment period of category and pref BorrowerRenewalPeriodBase?
[5] If the patron category has an enrollment fee, check account too.
[6] Reset dateexpiry of this patron to original date.
[7] Run misc/cronjobs/membership_expiry.pl -c -v
[8] Check if you got an expiry notice instead and dateexpiry did not
    change.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
[EDIT] Removed $fees and $substitute in favor of notice approach

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
7 months agoBug 28688: Add new notice MEMBERSHIP_RENEWED
Marcel de Rooy [Thu, 15 Jun 2023 08:51:32 +0000 (08:51 +0000)]
Bug 28688: Add new notice MEMBERSHIP_RENEWED

Test plan:
Run new install or upgrade.
Check for this notice under Tools/Notices.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
[EDIT] Enrollment fee via object instead of substitute hash.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
7 months agoBug 34828: Remove useless variable
Tomas Cohen Arazi [Tue, 10 Oct 2023 11:33:54 +0000 (08:33 -0300)]
Bug 34828: Remove useless variable

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
7 months agoBug 34828: Make normalized_oclc use Koha::Biblio::Metadata::Extractor
Jonathan Druart [Thu, 5 Oct 2023 09:48:59 +0000 (11:48 +0200)]
Bug 34828: Make normalized_oclc use Koha::Biblio::Metadata::Extractor

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
7 months agoBug 34828: Add Koha::Biblio::Metadata::Extractor::MARC
Jonathan Druart [Thu, 5 Oct 2023 07:44:42 +0000 (09:44 +0200)]
Bug 34828: Add Koha::Biblio::Metadata::Extractor::MARC

and inherit from it

The new usage is now:

1. With a Koha::Biblio object
my $extractor = Koha::Biblio::Metadata::Extractor->new({biblio => $biblio});
$extractor->get_normalized_upc;

or

2. With a MARC::Record
my $extractor = Koha::Biblio::Metadata::Extractor->new({metadata=> $biblio->metadata->record});
$extractor->get_normalized_upc;

Note that there are "Inconsistent hierarchy during C3 merge of class"
warnings raised by the QA script. We could remove them by replacing the
'use' by 'require' in Koha::Biblio::Metadata::Extractor::MARC (in ->new)
but that's suboptimal.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
7 months agoBug 34828: Move to Koha::Biblio::Metadata::Extractor
Jonathan Druart [Thu, 5 Oct 2023 06:30:05 +0000 (08:30 +0200)]
Bug 34828: Move to Koha::Biblio::Metadata::Extractor

We are not directly linked with the other Koha::Metadata* packages.
Better to isolate this under Koha::Biblio::Metadata (at least for now).

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
7 months agoBug 34828: Introduce Koha::MetadataExtractor and ->get_normalized_upc
Tomas Cohen Arazi [Mon, 18 Sep 2023 12:35:16 +0000 (09:35 -0300)]
Bug 34828: Introduce Koha::MetadataExtractor and ->get_normalized_upc

This patch introduces a new pattern for the different ->get_<thing>
methods we've been adding. The aim is that code will look more like:

my $metadata_extractor = Koha::MetadataExtractor->new;

while ( my $biblio = $biblios->next ) {
    my $record = $biblio->record;
    my $schema = $biblio->record_schema;

    $data->{$biblio->id}->{normalized_upc} =
$metadata_extractor->get_normalized_upc( { record => $record, schema =>
$schema } );
    $data->{$biblio->id}->{normalized_ean} =
$metadata_extractor->get_normalized_ean( { record => $record, schema =>
$schema } );
}

The key is that we are actually reusing the MARC::Record, and code for
each schema is organized cleanly so easier to maintain.

For the class names, I chose to add the 'MARC' name in the path, so we
don't need to refactor anything if we want to add support for another
serialization formats.

To test:
1. Apply this patch
2. Run:
   $ ktd --shell
  k$ qa -c 1
=> SUCCESS: Tests pass!
3. Sign off :-D

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
7 months agoBug 34657: DBRev 23.06.00.029
Tomas Cohen Arazi [Mon, 9 Oct 2023 19:30:41 +0000 (16:30 -0300)]
Bug 34657: DBRev 23.06.00.029

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
7 months agoBug 34467: OAI GetRecord bad encoding for Unimarc
Frédéric Demians [Thu, 3 Aug 2023 08:59:01 +0000 (10:59 +0200)]
Bug 34467: OAI GetRecord bad encoding for Unimarc

For some Unimarc biblio records, the OAI Server returns a bad XML
document, ie a document with extended characters, such as accents, not
encoded in UTF8. It seems to come from somewhere in MARC::Record library
trying to deduce biblio record endoding from some fields. It may work
for MARC21 records. It doesn't for Unimarc records. So it's necessary to
send to the method transforming record into XML the marcflavour. This
way there is no encoding guessing from Unimarc biblio records content.

https://bugs.koha-community.org/show_bug.cgi?id=34467
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>
7 months agoBug 34336: Remove the dependency for Test::DBIx::Class
Marcel de Rooy [Fri, 6 Oct 2023 06:52:28 +0000 (06:52 +0000)]
Bug 34336: Remove the dependency for Test::DBIx::Class

The module is removed from t.
We only have 01-test_dbic.t and we do not need it any longer.

Test plan:
git grep for Test::DBIx::Class. You should only see release notes.

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>
7 months agoBug 34667: Update MARC21 default framework to Update 36 (June 2023)
Caroline Cyr La Rose [Wed, 30 Aug 2023 20:49:49 +0000 (16:49 -0400)]
Bug 34667: Update MARC21 default framework to Update 36 (June 2023)

This patch updates the default MARC21 framework to reflect the changes brought by Update 36 (June 2023).

To test:
1. Apply patch and restart
2. Go to Administration > MARC bibliographic framework
3. Click Actions next to the default framework and choose MARC structure
4. Check for the changes detailed in the update https://www.loc.gov/marc/bibliographic/bdapndxg.html

- There should be one new subfield in field 041
  - 3 Materials specified (NR)

- There should be a new field 361, named STRUCTURED OWNERSHIP AND CUSTODIAL HISTORY
  - This field should be repeatable
  - Subfields:
    - 0 Authority record control number or standard number (R)
    - 1 Real World Object URI (R)
    - 3 Materials specified (NR)
    - 5 Institution to which field applies (NR)
    - 6 Linkage (NR)
    - 7 Data provenance (R)
    - 8 Field link and sequence number (R)
    - a Name (NR)
    - f Ownership and custodial history evidence term (R)
    - k Formatted date (NR)
    - l Date (NR)
    - o Type of ownership and custodial history information (R)
    - s Shelf mark of copy described (NR)
    - u Uniform Resource Identifier (R)
    - x Nonpublic note (R) **This should not be visible in the OPAC
    - y Identifier of the copy described (NR)
    - z Public note (R)

- There should be three new subfields in field 653
  - 0 Authority record control number or standard number (R)
  - 1 Real World Object URI (R)
  - 5 Institution to which field applies (NR)

- There should be two new subfields in field 658
  - 0 Authority record control number or standard number (R)
  - 1 Real World Object URI (R)

- There should be four new subfields in field 720
  - 0 Authority record control number or standard number (R)
  - 1 Real World Object URI (R)
  - 5 Institution to which field applies (NR)
  - 7 Data provenance (R)

- There should be a new field 857, named ELECTRONIC ARCHIVE LOCATION AND ACCESS
  - This field should be repeatable
  - Subfields
    - 2 Access method (NR)
    - 3 Materials specified (NR)
    - 5 Institution to which field applies (NR)
    - 6 Linkage (NR)
    - 7 Access status (NR)
    - 8 Field link and sequence number (R)
    - b Name of archiving agency (NR)
    - c Name of Web archive or digital archive repository (NR)
    - d Date range of archived material (NR)
    - e Data provenance (R)
    - f Archive completeness (NR)
    - g Persistent identifier (R)
    - h Non-functioning Uniform Resource Identifier (R)
    - l Standardized information governing access (R)
    - m Contact for access assistance (R)
    - n Terms governing access (R)
    - q Electronic format type (R)
    - r Standardized information governing use and reproduction (R)
    - s File size (R)
    - t Terms governing use and reproduction (R)
    - u Uniform Resource Identifier (R)
    - x Nonpublic note (R)
    - y Link text (R)
    - z Public note (R)

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>
7 months agoBug 34665: Update MARC21 default framework to Update 35 (Dec. 2022)
Caroline Cyr La Rose [Wed, 30 Aug 2023 19:13:34 +0000 (15:13 -0400)]
Bug 34665: Update MARC21 default framework to Update 35 (Dec. 2022)

This patch updates the default MARC21 framework to reflect the changes brought by Update 35 (December 2022).

To test:
1. Apply patch and restart
2. Go to Administration > MARC bibliographic framework
3. Click Actions next to the default framework and choose MARC structure
4. Check for the changes detailed in the update https://www.loc.gov/marc/up35bibliographic/bdapndxg.html

- There should be one new subfield in field 856
  - g Persistent identifier (R)
  - Subfield h should now be named Non-functioning Uniform Resource Identifier
  - Subfield q should now be repeatable

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>
7 months agoBug 34659: Update MARC21 default framework to Update 34 (July 2022)
Caroline Cyr La Rose [Wed, 30 Aug 2023 18:44:58 +0000 (14:44 -0400)]
Bug 34659: Update MARC21 default framework to Update 34 (July 2022)

This patch updates the default MARC21 framework to reflect the changes brought by Update 34 (July 2022).

To test:
1. Apply patch and restart
2. Go to Administration > MARC bibliographic framework
3. Click Actions next to the default framework and choose MARC structure
4. Check for the changes detailed in the update https://www.loc.gov/marc/up34bibliographic/bdapndxg.html

- There should be one new subfield in field 041
  - 7 Data provenance (R)

- There should be one new subfield in field 082
  - 7 Data provenance (R)

- There should be one new subfield in field 083
  - 7 Data provenance (R)

- There should be one new subfield in field 084
  - 7 Data provenance (R)

- There should be one new subfield in field 100
  - 7 Data provenance (R)

- There should be one new subfield in field 110
  - 7 Data provenance (R)

- There should be one new subfield in field 111
  - 7 Data provenance (R)

- There should be one new subfield in field 130
  - 7 Data provenance (R)

- There should be one new subfield in field 210
  - 7 Data provenance (R)

- There should be one new subfield in field 240
  - 7 Data provenance (R)

- There should be one new subfield in field 245
  - 7 Data provenance (R)

- There should be one new subfield in field 246
  - 7 Data provenance (R)

- There should be one new subfield in field 247
  - 7 Data provenance (R)

- There should be one new subfield in field 250
  - 7 Data provenance (R)

- There should be one new subfield in field 255
  - 7 Data provenance (R)

- There should be one new subfield in field 256
  - 7 Data provenance (R)

- There should be one new subfield in field 264
  - 7 Data provenance (R)

- There should be one new subfield in field 300
  - 7 Data provenance (R)

- There should be one new subfield in field 335
  - 7 Data provenance (R)

- There should be one new subfield in field 336
  - 7 Data provenance (R)

- There should be one new subfield in field 340
  - q Reduction ratio designator (R)
  - Subfield f should now be named Reduction ratio value

- There should be one new subfield in field 348
  - 7 Data provenance (R)

- There should be one new subfield in field 370
  - 7 Data provenance (R)

- There should be one new subfield in field 377
  - 7 Data provenance (R)

- There should be one new subfield in field 380
  - 7 Data provenance (R)

- There should be one new subfield in field 381
  - 7 Data provenance (R)

- There should be one new subfield in field 382
  - 7 Data provenance (R)

- There should be one new subfield in field 383
  - 7 Data provenance (R)

- There should be one new subfield in field 384
  - 7 Data provenance (R)

- There should be one new subfield in field 385
  - 7 Data provenance (R)

- There should be one new subfield in field 386
  - 7 Data provenance (R)

- There should be a new field 387, named REPRESENTATIVE EXPRESSION CHARACTERISTICS
  - This field should be repeatable
  - Subfields:
    - 0 Authority record control number or standard number (R)
    - 1 Real World Object URI (R)
    - 2 Source of term (NR)
    - 3 Materials specified (NR)
    - 6 Linkage (NR)
    - 7 Data provenance (R)
    - 8 Field link and sequence number (R)
    - a Aspect ratio of representative expression (R)
    - b Color content of representative expression (R)
    - c Content type of representative expression (R)
    - d Date of capture of representative expression (R)
    - e Date of representative expression (R)
    - f Duration of representative expression (R)
    - g Intended audience of representative expression (R)
    - h Language of representative expression (R)
    - i Place of capture of representative expression (R)
    - j Projection of cartographic content of representative expression (R)
    - k Scale of representative expression (R)
    - l Script of representative expression (R)
    - m Sound content of representative expression (R)

- There should be one new subfield in field 388
  - 7 Data provenance (R)

- There should be one new subfield in field 490
  - 7 Data provenance (R)

- There should be one new subfield in field 500
  - 7 Data provenance (R)

- There should be one new subfield in field 501
  - 7 Data provenance (R)

- There should be one new subfield in field 502
  - 7 Data provenance (R)

- There should be one new subfield in field 505
  - 7 Data provenance (R)

- Field 507 should now be named SCALE NOTE FOR VISUAL MATERIALS

- There should be one new subfield in field 508
  - 7 Data provenance (R)

- There should be one new subfield in field 510
  - 7 Data provenance (R)

- There should be one new subfield in field 515
  - 7 Data provenance (R)

- There should be one new subfield in field 518
  - 7 Data provenance (R)

- There should be one new subfield in field 520
  - 7 Data provenance (R)

- There should be one new subfield in field 533
  - y Data provenance (R)

- There should be one new subfield in field 546
  - 7 Data provenance (R)

- There should be one new subfield in field 550
  - 7 Data provenance (R)

- There should be one new subfield in field 555
  - 7 Data provenance (R)

- There should be one new subfield in field 583
  - 7 Data provenance (R)

- There should be one new subfield in field 600
  - 7 Data provenance (R)

- There should be one new subfield in field 610
  - 7 Data provenance (R)

- There should be one new subfield in field 611
  - 7 Data provenance (R)

- There should be one new subfield in field 630
  - 7 Data provenance (R)

- There should be one new subfield in field 648
  - 7 Data provenance (R)

- There should be one new subfield in field 650
  - 7 Data provenance (R)

- There should be one new subfield in field 651
  - 7 Data provenance (R)

- There should be one new subfield in field 653
  - 7 Data provenance (R)

- There should be one new subfield in field 655
  - 7 Data provenance (R)

- There should be one new subfield in field 700
  - 7 Data provenance (R)

- There should be one new subfield in field 710
  - 7 Data provenance (R)

- There should be one new subfield in field 711
  - 7 Data provenance (R)

- There should be one new subfield in field 751
  - 7 Data provenance (R)

- There should be one new subfield in field 760
  - l Data provenance (R)

- There should be one new subfield in field 762
  - l Data provenance (R)

- There should be one new subfield in field 765
  - l Data provenance (R)

- There should be one new subfield in field 767
  - l Data provenance (R)

- There should be one new subfield in field 770
  - l Data provenance (R)

- There should be one new subfield in field 772
  - l Data provenance (R)

- There should be one new subfield in field 773
  - l Data provenance (R)

- There should be one new subfield in field 774
  - l Data provenance (R)

- There should be one new subfield in field 775
  - l Data provenance (R)

- There should be one new subfield in field 776
  - l Data provenance (R)

- There should be one new subfield in field 777
  - l Data provenance (R)

- There should be one new subfield in field 780
  - l Data provenance (R)

- There should be one new subfield in field 785
  - l Data provenance (R)

- There should be one new subfield in field 786
  - l Data provenance (R)

- There should be one new subfield in field 787
  - l Data provenance (R)

- There should be a new field 788, named PARALLEL DESCRIPTION IN ANOTHER LANGUAGE OF CATALOGING
  - This field should be repeatable
  - Subfields:
    - 4 Relationship (R)
    - 5 Institution to which field applies (NR)
    - 6 Linkage (NR)
    - 8 Field link and sequence number (R)
    - a Main entry heading (NR)
    - b Edition (NR)
    - d Place, publisher, and date of publication (NR)
    - e Language of cataloging (NR)
    - i Relationship information (R)
    - l Data provenance (R)
    - n Note (R)
    - s Uniform title (NR)
    - t Title (NR)
    - w Record control number (R)
    - x International Standard Serial Number (NR)

- There should be one new subfield in field 800
  - y Data provenance (R)

- There should be one new subfield in field 810
  - y Data provenance (R)

- There should be one new subfield in field 811
  - y Data provenance (R)

- There should be one new subfield in field 830
  - y Data provenance (R)

- There should be one new subfield in field 856
  - e Data provenance (R)
  - Subfield l is renamed Standardized information governing access (R)
  - Subfield n is renamed Terms governing access (R)
  - Subfield r is renamed Standardized information governing use and reproduction (R)
  - Subfield t is renamed Terms governing use and reproduction (R)

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>
7 months agoBug 34658: Update to 007 value builder to reflect changes brought by Update 33 (Nov...
Caroline Cyr La Rose [Wed, 30 Aug 2023 15:39:48 +0000 (11:39 -0400)]
Bug 34658: Update to 007 value builder to reflect changes brought by Update 33 (Nov. 2021)

This patch updates the terms used in the 007 value builder in
concordance with the MARC21 format update 33.

To test:
1. Apply patch and restart
2. Go to Cataloguing > New recordGo to Cataloguing > New record
3. Click the small tag editor icon next to 007
3. Change Material type to Sound recording
   --> Position 13 should now be named Original capture and storage technique
4. Open the 13 Original capture and storage technique drop-down menu
   --> The values should be renamed

a - Acoustical capture, analog direct storage
b - Electrical capture, analog direct storage
d - Electrical capture, digital storage
e - Electrical capture, analog electrical storage
u - Unknown capture and storage
z - Other **Unchanged
| - No attempt to code **Unchanged

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>
7 months agoBug 34658: Update MARC21 default framework to Update 33 (Nov. 2021)
Caroline Cyr La Rose [Wed, 30 Aug 2023 15:38:32 +0000 (11:38 -0400)]
Bug 34658: Update MARC21 default framework to Update 33 (Nov. 2021)

iThis patch updates the default MARC21 framework to reflect the changes brought by Update 33 (November 2021).

To test:
1. Apply patch and restart
2. Go to Administration > MARC bibliographic framework
3. Click Actions next to the default framework and choose MARC structure
4. Check for the changes detailed in the update https://www.loc.gov/marc/up33bibliographic/bdapndxg.html

- There should be a new subfield in field 340
  - l Binding (R)

- There should be a new subfield in field 344
  - j Original capture and storage technique (R)

- There should be two new subfields in field 490
  - y Incorrect ISSN (R)
  - z Canceled ISSN (R)
  **Note that subfield 7 was added in a later update and is therefore not included in this patch

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>
7 months agoBug 34649: (fixup) Update MARC21 default framework to Update 32 (June 2021)
Caroline Cyr La Rose [Wed, 30 Aug 2023 14:39:14 +0000 (10:39 -0400)]
Bug 34649: (fixup) Update MARC21 default framework to Update 32 (June 2021)

Fixes a small typo that prevented the yaml from loading correctly

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>
7 months agoBug 34649: Updated code list for 008 value builder for continuing resources
Caroline Cyr La Rose [Tue, 29 Aug 2023 21:53:23 +0000 (17:53 -0400)]
Bug 34649: Updated code list for 008 value builder for continuing resources

This patch updates the code list for 008/21 for continuing resources in
concordance with Update 32 to the MARC21 format.

g - Magazine
h - Blog
j - Journal
r - Repository
s - Newsletter
t - Directory

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>
7 months agoBug 34649: Update MARC21 default framework to Update 32 (June 2021)
Caroline Cyr La Rose [Tue, 29 Aug 2023 21:52:26 +0000 (17:52 -0400)]
Bug 34649: Update MARC21 default framework to Update 32 (June 2021)

This patch updates the default MARC21 framework to reflect the changes brought by Update 32 (June 2021).

To test:
1. Apply patch and restart
2. Go to Administration > MARC bibliographic framework
3. Click Actions next to the default framework and choose MARC structure
4. Check for the changes detailed in the update https://www.loc.gov/marc/up32bibliographic/bdapndxg.html

- There should be two new subfields in field 022
  - 0 Authority record control number or standard number (NR)
  - 1 Real World Object URI (R)

- There should be three new subfields in field 046
  - 3 Materials specified (NR)
  - x Nonpublic note (R) (this one should be hidden from the OPAC)
  - z Public note (R)
  **Note that subfield 7 was added in a later update and is therefore not included in this patch

- Subfield 082$2 should now be named Edition information

- Subfield 083$2 should now be named Edition information

- There should be a new field 334, named MODE OF ISSUANCE
  - This field should be repeatable
  - Subfields:
    - 0 Authority record control number or standard number (R)
    - 1 Real World Object URI (R)
    - 2 Source (NR)
    - 6 Linkage (NR)
    - 8 Field link and sequence number (R)
    - a Mode of issuance term (NR)
    - b Mode of issuance code (NR)

- There should be one new subfield in field 344
  - i Sound content (R)
  **Note that subfield j was added in a later update and is therefore not included in this patch

- Field 348 should now be named NOTATED MUSIC CHARACTERISTICS
  - There should be two new subfields
    - c Form of musical notation term (R)
    - d Form of musical notation code (R)
    **Note that subfield 7 was added in a later update and is therefore not included in this patch

- There should be a new field 353, named SUPPLEMENTARY CONTENT CHARACTERISTICS
  - This field should be repeatable
  - Subfields:
    - 0 Authority record control number or standard number (R)
    - 1 Real World Object URI (R)
    - 2 Source (NR)
    - 3 Materials specified (NR)
    - 6 Linkage (NR)
    - 8 Field link and sequence number (R)
    - a Supplementary content term (NR)
    - b Supplementary content code (NR)

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>
7 months agoBug 34648: (fixup) Update MARC21 frameworks to Update 31 (December 2020)
Caroline Cyr La Rose [Thu, 31 Aug 2023 13:03:55 +0000 (09:03 -0400)]
Bug 34648: (fixup) Update MARC21 frameworks to Update 31 (December 2020)

Added missing 881$a subfield.

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>
7 months agoBug 34648: (follow up) updated comment
Caroline Cyr La Rose [Tue, 29 Aug 2023 21:11:12 +0000 (17:11 -0400)]
Bug 34648: (follow up) updated comment

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>
7 months agoBug 34648: Update MARC21 frameworks to Update 31 (December 2020)
Caroline Cyr La Rose [Tue, 29 Aug 2023 21:02:32 +0000 (17:02 -0400)]
Bug 34648: Update MARC21 frameworks to Update 31 (December 2020)

This patch updates the default MARC21 framework to reflect the changes brought by Update 30 (Dec. 2020).

To test:
1. Apply patch and restart
2. Go to Administration > MARC bibliographic framework
3. Click "Actions" next to the default framework and choose "MARC structure"
4. Check for the changes detailed in the update https://www.loc.gov/marc/up31bibliographic/bdapndxg.html

- Field 043 should now be repeatable

- There should be a new field 335, named EXTENSION PLAN
  - This field should be repeatable
  - Subfields:
    - 0 Authority record control number or standard number (R)
    - 1 Real World Object URI (R)
    - 2 Source (NR)
    - 3 Materials specified (NR)
    - 6 Linkage (NR)
    - 8 Field link and sequence number (R)
    - a Extension plan term (NR)
    - b Extension plan code (NR)
    **Note that subfield 7 was added in a later update and is therefore not included in this patch

- Field 345 should now be named MOVING IMAGE CHARACTERISTICS
  - There should be two new subfields
    - c Aspect ratio value (R)
    - d Aspect ratio designator (R)

- There should be two new subfields in field 384
  - 0 Authority record control number or standard number (R)
  - 1 Real World Object URI (R)

- The following subfields of field 856 should have an [OBSOLETE] mention and be hidden (shown in OPAC and intranet, but not editor)
  - b Access number [OBSOLETE]
  - h Processor of Request [OBSOLETE]
  - i Instruction [OBSOLETE]
  - j Bits per second [OBSOLETE]
  - k Password [OBSOLETE]
  - l Logon [OBSOLETE]
  - n Name of location of host [OBSOLETE]
  - r Settings [OBSOLETE]
  - t Terminal emulation [OBSOLETE]

- There should be a new field 881, named MANIFESTATION STATEMENTS
  - This field should be repeatable
  - Subfields:
    - 3 Materials specified (NR)
    - 6 Linkage (NR)
    - 8 Field link and sequence number (R)
    - a Manifestation statement, high-level/general (R)
    - b Manifestation identifier statement (R)
    - c Manifestation title and responsibility statement (R)
    - d Manifestation edition statement (R)
    - e Manifestation production statement (R)
    - f Manifestation publication statement (R)
    - g Manifestation distribution statement (R)
    - h Manifestation manufacture statement (R)
    - i Manifestation copyright statement (R)
    - j Manifestation frequency statement (R)
    - k Manifestation designation of sequence statement (R)
    - l Manifestation series statement (R)
    - m Manifestation dissertation statement (R)
    - n Manifestation regional encoding statement (R)

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>
7 months agoBug 34549: Strip non-XML chars during TransformHtmlToMarc
David Cook [Thu, 17 Aug 2023 04:28:29 +0000 (04:28 +0000)]
Bug 34549: Strip non-XML chars during TransformHtmlToMarc

This patch strips non-XML characters from inputs during
TransformHtmlToMarc.

To test:
0. Apply patch
1. koha-plack --restart kohadev
2. Go to http://localhost:8081/cgi-bin/koha/cataloguing/addbiblio.pl
3. Fill out record and use the text from "Text file containing control characters"
as the title
4. Click Save
5. Note that your record displays without any warnings like the following:
Error: invalid data, cannot decode metadata object
parser error : PCDATA invalid Char value 27

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
[EDIT] Squashed the tidy patch. Still needed a few spaces to satisfy qa tools.
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
7 months agoBug 34982: Add pagination to the currencies table
Jonathan Druart [Wed, 4 Oct 2023 09:42:44 +0000 (11:42 +0200)]
Bug 34982: Add pagination to the currencies table

Otherwise we only display the first 20.

Test plan:
Create more than 20 currencies and confirm that you can know
filter the table and see all the currencies.

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>
7 months agoBug 34558: Update custom.sql for it-IT webinstaller
Zeno Tajoli [Thu, 17 Aug 2023 12:04:12 +0000 (14:04 +0200)]
Bug 34558: Update custom.sql for it-IT webinstaller

It is an update of this file, here there are the specific customization for
italian users. There are simple changes on defaults values.

To test it:
1 - Start a web installation with italian language.
2 - Select Marc21 as biblio format
3 - Select all optional .sql files
4 - Conclude the installation.
5 - Go to MySQL command line and do:
    SELET value FROM systempreferences where variable = 'BorrowersTitles'
    You see: 'Sig|Sig.ra|Sig.na'
6 - Apply the patch.
7 - Drop and recreate the mysql db
8 - Redone the installation with italian language.
9 - Use the same options written above.
10 - Conclude the installation.
11 - Go to MySQL command line and do:
    SELECT value FROM systempreferences where variable = 'BorrowersTitles'
    You see: 'Sig|Sig.ra|Dott.|Dott.ssa'
12 - Refactor is OK

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>
7 months agoBug 34393: (follow-up) QA fixes and further refinement
Owen Leonard [Wed, 4 Oct 2023 11:12:14 +0000 (11:12 +0000)]
Bug 34393: (follow-up) QA fixes and further refinement

This patch addresses issues discovered during testing and fixes a couple
of issues which were missed.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
7 months agoBug 34393: Fix inconsistencies in MARC bibliographic framework page titles, breadcrum...
Owen Leonard [Mon, 2 Oct 2023 18:41:15 +0000 (18:41 +0000)]
Bug 34393: Fix inconsistencies in MARC bibliographic framework page titles, breadcrumbs, and header

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

The file admin/marc_subfields_structure.pl is modified so that it
provides the framework name to the template.

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

- MARC bibliographic frameworks
  - New framework
  - Edit framework
  - Delete a framework which is not used
  - Delete a framework which is in use
  - Framework MARC structure
    - New tag
    - Edit tag
    - Delete tag
    - View subfields
    - Edit subfields

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>
7 months agoBug 34677: (QA follow-up) Update description of RELTERMS authorised value
Katrin Fischer [Fri, 6 Oct 2023 14:30:23 +0000 (14:30 +0000)]
Bug 34677: (QA follow-up) Update description of RELTERMS authorised value

The patch as is kind of undid the change of bug 34679. The new
proposal is a mix of this and the old version with a link that
opens in a new tab.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
7 months agoBug 34677: (follow-up) Additional updates to match the LOC list
David Nind [Sat, 23 Sep 2023 20:16:08 +0000 (20:16 +0000)]
Bug 34677: (follow-up) Additional updates to match the LOC list

This patch makes additional updates to the RELTERMS authorized
value list to make it match the MARC Code List for Relators
at https://www.loc.gov/marc/relators/relaterm.html and
https://www.loc.gov/marc/relators/relacode.html

It also updates the description displayed in the
authorized values list.

Test plan:
1. Apply the patch.
2. Reload the values (reset_all if using KTD).
3. Go to Administration > Authorized values.
4. Note that the description for RELTERMS is changed
   (now says 'MARC Code List for Relators
    (https://www.loc.gov/marc/relators/).' instead of
    'French terms of relations').
5. Check that the changes listed are incorporated
   into the RELTERMS authorized values list.

Additions:
prv - Provider
rcd - Recordist
stg - Setting

Changes:
aui - Author of introduction -> Author of introduction, etc.
aus - Author of screenplay -> Screenwriter
coe - Contestant -appellee -> Contestant-appellee
cot - Contestant -appellant -> Contestant-appellant
cou - Court-governed -> Court governed
dpb -> dbp - Distribution place
dgg - Degree grantor -> Degree granting institution
osp - On-screen presenter -> Onscreen presenter
pte - Plaintiff -appellee -> Plaintiff-appellee
rcp - Recipient -> Addressee
red - Redactor -> Redaktor
wde - Wood-engraver -> Wood engraver

Removals:
-grt - Graphic technician

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>
7 months agoBug 34677: (follow-up) Update transposed value
David Nind [Fri, 1 Sep 2023 19:47:37 +0000 (19:47 +0000)]
Bug 34677: (follow-up) Update transposed value

Update sdg Stage director to sgd (May 31, 2013 technical notice).

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>
7 months agoBug 34677: Update to MARC21 relator terms list (August 8, 2023 technical notice)
Caroline Cyr La Rose [Thu, 31 Aug 2023 17:20:47 +0000 (13:20 -0400)]
Bug 34677: Update to MARC21 relator terms list (August 8, 2023 technical notice)

This patch adds missing relator codes/terms to the marc21_relatorterms.yaml file in accordance with the August 8, 2023 technical notice.

https://www.loc.gov/marc/relators/tn230808rel.html

To test:
1. Apply patch and restart
2. Go to Administration > Authorized values > RELTERMS
   --> New terms should be there

anc - Announcer
aue - Audio engineer
aup - Audio producer
bka - Book artist
cad - Casting director
cop - Camera operator
dbd - Dubbing director
djo - DJ
edd - Editorial director
fon - Founder
mka - Makeup artist
mup - Music programmer
mxe - Mixing engineer
nan - News anchor
onp - Onscreen participant
rap - Rapporteur
rxa - Remix artist
sde - Sound engineer
sfx - Special effects provider
swd - Software developer
tau - Television writer
tlg - Television guest
tlh - Television host
vfx - Visual effects provider

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>
7 months agoBug 34677: Update to MARC21 relator terms list (Apr. 26, 2021 technical notice)
Caroline Cyr La Rose [Thu, 31 Aug 2023 17:08:54 +0000 (13:08 -0400)]
Bug 34677: Update to MARC21 relator terms list (Apr. 26, 2021 technical notice)

This patch adds missing relator codes/terms to the marc21_relatorterms.yaml file in accordance with the April 26, 2021 technical notice.

https://www.loc.gov/marc/relators/tn210426rel.html

To test:
1. Apply patch and restart
2. Go to Administration > Authorized values > RELTERMS
   --> New term should be there

Addition:
pad - Place of address

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>
7 months agoBug 34677: Update to MARC21 relator terms list (Dec. 14, 2020 technical notice)
Caroline Cyr La Rose [Thu, 31 Aug 2023 17:04:52 +0000 (13:04 -0400)]
Bug 34677: Update to MARC21 relator terms list (Dec. 14, 2020 technical notice)

This patch adds missing relator codes/terms to the marc21_relatorterms.yaml file in accordance with the December 21, 2020 technical notice.

https://www.loc.gov/marc/relators/tn201214src.html

To test:
1. Apply patch and restart
2. Go to Administration > Authorized values > RELTERMS
   --> New term should be there

Addition:
dgc - Degree committee member

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>
7 months agoBug 34677: Update to MARC21 relator terms list (Feb 21, 2014 technical notice)
Caroline Cyr La Rose [Thu, 31 Aug 2023 17:01:15 +0000 (13:01 -0400)]
Bug 34677: Update to MARC21 relator terms list (Feb 21, 2014 technical notice)

This patch adds missing relator codes/terms to the marc21_relatorterms.yaml file in accordance with the February 21, 2014 technical notice.

https://www.loc.gov/marc/relators/tn140221rel.html

To test:
1. Apply patch and restart
2. Go to Administration > Authorized values > RELTERMS
   --> New terms should be there and modified terms should be changed

Additions:
dgs - Degree supervisor
med - Medium
mtk - Minute taker
vac - Voice actor
wst - Writer of supplementary textual content
win - Writer of introduction
wpr - Writer of preface

Changes:
orm - Organizer

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>
7 months agoBug 34677: Update to MARC21 relator terms list (May 31, 2013 technical notice)
Caroline Cyr La Rose [Thu, 31 Aug 2023 16:53:30 +0000 (12:53 -0400)]
Bug 34677: Update to MARC21 relator terms list (May 31, 2013 technical notice)

This patch adds missing relator codes/terms to the marc21_relatorterms.yaml file in accordance with the May 31, 2013 technical notice.

https://www.loc.gov/marc/relators/tn130531rel.html

To test:
1. Apply patch and restart
2. Go to Administration > Authorized values > RELTERMS
   --> New terms should be there and deprecated terms should have been removed

Additions:
abr - Abridger
apl - Appellant
ape - Appellee
adi - Art director
ato - Autographer
brl - Braille embosser
brd - Broadcaster
cas - Caster
cor - Collection registrar
cou - Court-governed
crt - Court reporter
edc - Editor of compilation
edm - Editor of moving image work
enj - Enacting jurisdiction
fds - Film distributor
fmk - Filmmaker
fmd - Film director
fmp - Film producer
his - Host institution
isb - Issuing body
jud - Judge
jug - Jurisdiction governed
osp - On-screen presenter
pan - Panelist
pra - Praeses
pre - Presenter
prn - Production company
prs - Production designer
rdd - Radio director
rpc - Radio producer
rsr - Restorationist
sll - Seller
sgd - Stage director
tld - Television director
tlp - Television producer
wac - Writer of added commentary
wat - Writer of added text
wal - Writer of added lyrics

Deprecated relators:
clb - Collaborator
voc - Vocalist

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
7 months agoBug 34562: Update more pop-up windows with consistent footer markup
Owen Leonard [Thu, 17 Aug 2023 10:52:12 +0000 (10:52 +0000)]
Bug 34562: Update more pop-up windows with consistent footer markup

This patch updates a few more pop-up window templates to standardize the
markup of footer controls. The patch also updates the way catalog.js
triggers the "Add to list" pop-up so that it uses the same
window-opening JS function that similar pages do, since the default
gives us consistent popup features.

To test, apply the patch and perform a catalog search in the staff
interface which will return multiple results.

- Check the box next to one or more results.
- Click the "Add to list" button.
  - Test the various options here: Add to an existing list, a new list,
    or choose "More lists."
  - In each case the pop-up window which appears should have a
    consistent fixed footer with "Save" and "Cancel" buttons.
  - Confirm that these controls can be navigated to using the tab key.
  - Confirm that each one works correctly.

- Go to Administration -> Z39.50/SRU servers -> New SRU server.
  - Click the "Modify" button by the "SRU Search fields mapping" field.
  - Inspect and test the resulting pop-up window.
  - Switch the "Record type" dropdown to "Authority," click the
    "Modify" button again, and test this version of the pop-up window
    too.

Signed-off-by: Émily-Rose Francoeur <emily-rose.francoeur@inLibro.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
7 months agoBug 34390: (follow-up) Add single quotes around credit type
David Nind [Tue, 3 Oct 2023 00:00:13 +0000 (00:00 +0000)]
Bug 34390: (follow-up) Add single quotes around credit type

For consistency with other bugs - adds single quotes around the
credit type code.

Signed-off-by: David Nind <david@davidnind.com>
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>
7 months agoBug 34390: Fix inconsistencies in credit types titles, breadcrumbs, and header
Owen Leonard [Mon, 2 Oct 2023 15:59:08 +0000 (15:59 +0000)]
Bug 34390: Fix inconsistencies in credit types titles, breadcrumbs, and header

Fix inconsistencies in credit types titles, breadcrumbs, and header

This patch fixes a couple of inconsistencies in the credit types
administration page, making sure the page title, breadcrumb
navigation, and page headers are consistent with each other.

To test, apply the patch and go to Administration -> Credit types. Test
each variation of the page:

- Main page
- New credit type
- Modify credit type

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>
7 months agoBug 34873: Fix inconsistencies between "Sending your cart/list" headings
Owen Leonard [Fri, 22 Sep 2023 18:33:36 +0000 (18:33 +0000)]
Bug 34873: Fix inconsistencies between "Sending your cart/list" headings

This patch modifies the templates for the popup windows which are shown
when you send a cart or a list via email in the staff interface.

To test, apply the patch and log into the staff interface.

- Perform a catalog search which will return results.
- Select one or more results and add them to the cart.
- Click the cart icon in the header menu to open the Cart popup.
- Click "Send". Compare this pop-up window to the version shown when
  sending a list:

- Open the Lists page and view the contents of a list.
- Click the "Send list" button in the toolbar.
- This popup should look correct and be consistent with the Cart
  version.

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>
7 months agoBug 34796: Improve translation of title tags: Tools - Additional tools
Owen Leonard [Thu, 14 Sep 2023 16:33:48 +0000 (16:33 +0000)]
Bug 34796: Improve translation of title tags: Tools - Additional tools

This patch modifies templates for tools under the "Additional tools"
heading so that title tags can be more easily translated. The patch also
makes some modifications to titles, breadcrumb navigation, and page
headers in order to make them more consistent with each other and with
other similar pages.

To test, apply the patch and go to Tools. Test each page below and each
variation of the page to confirm that titles, breadcrumbs, and page
headers look correct.

- Calendar
- CSV profiles
  - Main page
    - New CSV profile
    - Modify CSV profile
    - Confirm deletion of CSV profile
- Log viewer
  - Search results
- News, HTML customizations, and pages
  - Create and modify each content type: news, pages, HTML
    customizations
- Task scheduler
- Quote editor
  - Main page
  - New quote
  - Edit quote
  - Import quotes
- Uploads
  - Main page
  - Upload file
  - Delete file
  - Search for file
- Access files
- OPAC problem reports (with OPACReportProblem enabled)

Signed-off-by: Stina Hallin <stina.hallin@ub.lu.se>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
7 months agoBug 33819: Add page numbers to opac results breadcrumb
Matt Blenkinsop [Wed, 24 May 2023 14:57:20 +0000 (14:57 +0000)]
Bug 33819: Add page numbers to opac results breadcrumb

This patch adds the page number to the breadcrumb in the opac search results to ensure that it is unique to the content on the page. Currently it is not compliant to Accessibility guidelines as the breadcrumb is identical on every page despite the content being different.

To test:
1) Apply patch
2) Run a search in the OPAC that will return more than 20 results.
3) The breadcrumb should say "Results of search for 'search term', page x of y"
4) Run a search that will return less than 20 results
5) The breadcrumb should say "Results of search for 'search term'

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>
7 months agoBug 34661: Update UNIMARC cataloging plugins with consistent footers
Owen Leonard [Wed, 30 Aug 2023 16:31:03 +0000 (16:31 +0000)]
Bug 34661: Update UNIMARC cataloging plugins with consistent footers

This patch updates UNIMARC cataloging plugin templates so that they have
consistent fixed footers in the plugin popup window. Plugins for the
following UNIMARC fields have been updated:

000 (Leader) 123$f    128$a    181$b
100$a        123$g    128$b    182$2
105$a        123$i    128$c    182$a
106$a        123$j    130$a    182$c
110$a        124$a    135$a    183$2
115$a        124$b    140$a    183$a
115$b        124$c    141$a    210$c
116$a        124$d    146$a    225$a
117$a        124$e    146$c    225$a
120$a        124$f    146$d    283$2
121$a        124$g    146$e    283$a
121$b        125$a    146$f    325$h
122$a        125$b    146$h    325$j
123$a        126$a    146$i
123$d        126$b    181$2
123$e        127$a    181$a

Most of these will be pre-configured in a test system with default
UNIMARC data. In KTD you can use the 'reset_all_unimarc' command.

Go to Cataloging -> New record and test the plugin link for each of the
fields listed above.

  - In each case, confirm that the correct popup window is shown when
    you click the plugin link.
  - Confirm that clicking the "Cancel" button closes the window without
    copying any data to the field in the MARC editor.
    * Note that if the plugin is also triggered by cursor focus in the
      input field, some data may be automatically filled anyway.
  - Confirm that filing in data and clicking "Submit" will copy the
    correct information into the field.

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>
7 months agoBug 34566: Update MARC21 cataloging plugins with consistent footers
Owen Leonard [Wed, 30 Aug 2023 16:00:15 +0000 (16:00 +0000)]
Bug 34566: Update MARC21 cataloging plugins with consistent footers

This patch updates MARC21 cataloging plugin templates so that submit and
cancel controls are consistently displayed in a fixed footer.

To test, apply the patch and go to Cataloging.

- Create or edit a bibliographic record
- Test the cataloging plugins for these fields:
  - 000 (Leader)
  - 006
  - 007
  - 008
  - In each case, confirm that the correct popup window is shown when
    you click the plugin link.
  - Confirm that clicking the "Cancel" button closes the window without
    copying any data to the field in the MARC editor.
    * Note that if the plugin is also triggered by cursor focus in the
      input field, some data may be automatically filled anyway.
  - Confirm that filing in data and clicking "Submit" will copy the
    correct information into the field.

- Go to Authorities and create or edit an authority record.
- Test the plugin for these fields:
  - 000 (Leader)
  - 008
 - Perform the same tests as above.

I don't think the marc21_field_008_classifications is used at all, but
the template has been updated anyway. To test, edit your authority
record to use the plugin:

 - Administration -> Authority types -> Default -> MARC structure -> 008
   -> Subfields -> Edit.
 - Under Advanced constraints -> Plugin, select
   "marc21_field_008_classifcations.pl"
 - Re-test the behavior of the authority editor's tag 008 plugin to
   confirm that this plugin is used and works correctly.

Signed-off-by: Émily-Rose Francoeur <emily-rose.francoeur@inLibro.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
7 months agoBug 34630: Update MARC21 cataloging plugin templates with consistent body class
Owen Leonard [Wed, 30 Aug 2023 15:41:28 +0000 (15:41 +0000)]
Bug 34630: Update MARC21 cataloging plugin templates with consistent body class

This patch updates cataloging plugin templates to remove the inline
style "padding:1em" from the body tag. This style conflicts with fixed
Bootstrap footers.

A "value_builder" class is added to the body tag instead, the style
added to staff-global.scss. There shouldn't be any visible change to the
appearance of the pages.

To test, apply the patch and rebuild the staff interface CSS and clear
your browser cache if necessary.

- Go to Cataloging -> New record.
- In a default MARC21 installation you can test various plugin popups to
    confirm that they display correctly:
    - 000
    - 006
    - 007
    - 008

To visually confirm each affected template, the plugins can be loaded in
their own tab for testing the appearance of the page. I have a list of
direct links here:

https://gitlab.com/-/snippets/2555254
Signed-off-by: Émily-Rose Francoeur <emily-rose.francoeur@inLibro.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
7 months agoBug 34657: (QA follow-up) Fix plugin link in UNIMARC default framework
Katrin Fischer [Sat, 7 Oct 2023 15:41:36 +0000 (15:41 +0000)]
Bug 34657: (QA follow-up) Fix plugin link in UNIMARC default framework

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
7 months agoBug 34657: Merge cataloging plugins for UNIMARC 123d, e, f, and g
Owen Leonard [Wed, 30 Aug 2023 14:53:01 +0000 (14:53 +0000)]
Bug 34657: Merge cataloging plugins for UNIMARC 123d, e, f, and g

This patch removes some UNIMARC cataloging plugins which were
essentially duplicates of each other and renaming the remaining version
to reflect that it's for use with multiple subfields.

UNIMARC 123$d, e, f, and g can all be filled with
unimarc_field_123defg.pl

It's easiest to test if you have UNIMARC sample data. In KTD, run
'reset_all_unimarc'

- Apply the patch and run the database update process.
- Go to Cataloging and create or edit a bibliographic record.
- Under tab 1, look for tag 123.
- Test the plugin link for subfields d, e, f, and g
  - In each case the popup window should have the heading "UNIMARC field
    123d/e/f/g builder"
  - Fill out the form each time and confirm that the values are copied
    to the correct field in the MARC editor window.

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>
7 months agoBug 34270: Upgrade and prune jQueryUI assets in the staff interface
Owen Leonard [Thu, 13 Jul 2023 13:41:21 +0000 (13:41 +0000)]
Bug 34270: Upgrade and prune jQueryUI assets in the staff interface

This patch updates jQueryUI assets in the staff interface with an
upgraded and trimmed version which includes only support for jQueryUI
autocomplete.

Global staff interface CSS has been modified to remove unused
jQueryUI-related styles and to accommodate the updated assets.

The patch also removes some unused jQueryUI image assets from the OPAC
templates.

To test, apply the patch and rebuild the staff interface CSS. Test the
"Check out" form in the header to confirm that it still looks correct
and works correctly.

Signed-off-by: Émily-Rose Francoeur <emily-rose.francoeur@inLibro.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
7 months agoBug 34457: Added cardnumber view to hold details page
Laura Escamilla [Fri, 4 Aug 2023 17:29:20 +0000 (17:29 +0000)]
Bug 34457: Added cardnumber view to hold details page

Signed-off-by: Rebecca Coert <rcoert@arlingtonva.us>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
7 months agoBug 34035: Move translatable strings out of opac-bottom.inc: Tags
Owen Leonard [Fri, 16 Jun 2023 13:39:40 +0000 (13:39 +0000)]
Bug 34035: Move translatable strings out of opac-bottom.inc: Tags

This patch removes the definition of JS variables in opac-bottom.inc
related to the tags feature. These strings can be wrapped in the __()
function inside tags.js and they'll get picked up for translation.

Some other tags-related JS variable definitions are removed from
templates in favor of embedding them directly in the <script> block.

To test you must have TagsEnabled set to "Allow." Apply the patch and
log in to the OPAC.

- Perform a catalog search and select some items in the result list.
  - Add the items to the cart and open the cart.
    - Check a box next to one of the titles in the cart.
    - Click the "Tag" link
    - Submit the "New tag" form without entering a tag. You should see
      "No tag was specified."
    - Perform the same test on the search results page both using the
      checkboxes and by clicking the "Add tag" link on an individual
      result.
  - Perform the same test on the bibliographic detail page.
  - When adding tags from the cart, result list, or detail page, confirm
    that the "Tags added: X" message is always displayed.
  - Test adding a tag to a title which is already attached to that
    title.
  - Test adding HTML markup, e.g. "<script>"
  - Test adding HTML markup and plain text, e.g. "<script>Foo"

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>
7 months agoBug 34035: (preparatory cleanup) Convert indentation to spaces.
Owen Leonard [Fri, 16 Jun 2023 13:05:58 +0000 (13:05 +0000)]
Bug 34035: (preparatory cleanup) Convert indentation to spaces.

This patch converts tabs to spaces in tags.js. No other changes are
made.

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>
7 months agoBug 34034: Move translatable strings out of opac-bottom.inc: OverDrive and OpenLibrary
Owen Leonard [Fri, 16 Jun 2023 12:47:29 +0000 (12:47 +0000)]
Bug 34034: Move translatable strings out of opac-bottom.inc: OverDrive and OpenLibrary

This patch removes some string variable definitions from
opac-bottom.inc. The strings can now be picked up for translation from
the corresponding <script> block.

To test you must enable OpenLibrarySearch and enter OverDrive
credentials to enable OverDrive search integration.

- Perform a search in the OPAC.
- As the results page loads you should see at the top "Searching
  OverDrive..." and "Searching OpenLibrary..."
- When the searches complete you should see "Found X results in the
  library's Y collection" for each service.
- Try to trigger an error message by entering the wrong (non-zero) value
  for the OverDriveLibraryID preference.
- The search results page should show "Error searching OverDrive
  collection"

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>
7 months agoBug 34031: Move various translatable strings out of opac-bottom.inc
Owen Leonard [Fri, 16 Jun 2023 11:36:10 +0000 (11:36 +0000)]
Bug 34031: Move various translatable strings out of opac-bottom.inc

This patch moves some JS variable definitions out of opac-bottom.inc.
These variables where defined so that they could be picked up for
translation, but they can now be moved to the corresponding <script>
blocks.

Many other of these variables are not used at all and have been removed.

To test you should have EnableOpacSearchHistory, OPACPrivacy, and
opacreadinghistory enabled. Apply the patch and log into the OPAC as a
user with suggestions, search history, and checkout history.

- Click your user menu at the top of the page and click the "Clear" link
  for search history. You should see a confirmation, "Are you sure you
  want to delete your search history?" Confirming should trigger your
  search history deletion.
- From your user summary page, click "Privacy." Under "Immediate
  deletion," clicking any of the delete buttons should trigger a
  confirmation, "Warning: Cannot be undone. Please confirm once again"
- From your user summary page, click "Purchase suggestions."
  - Without checking any checkbox, click the "Delete selected" button at
    the bottom. You should see an alert, "No suggestion was selected."

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>
7 months agoBug 34026: (QA follow-up) Remove NO_COCE_JACKET
Katrin Fischer [Sun, 8 Oct 2023 13:54:00 +0000 (13:54 +0000)]
Bug 34026: (QA follow-up) Remove NO_COCE_JACKET

As already noted in Owen's commit message, this variable
appears to be unused.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
7 months agoBug 34026: Move translatable cover-handling strings out of opac-bottom.inc
Owen Leonard [Thu, 15 Jun 2023 18:56:25 +0000 (18:56 +0000)]
Bug 34026: Move translatable cover-handling strings out of opac-bottom.inc

This patch removes several instances from opac-bottom.inc where we
define strings for translation and use in separate JavaScript files. The
JavaScript files are updated to use the __() function to mark strings
for translation.

Note: Definition of the variable NO_COCE_JACKET is removed because it is
unused.

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

- In the staff interface, enable OPAC cover image services:
  - OPACAmazonCoverImages
  - BakerTaylorEnabled
  - GoogleJackets
  - OpenLibraryCovers

- In the OPAC, perform a search and confirm that there are no JS errors
  on the search results page related to cover images.
- Check the bibliographic detail page as well.

To confirm that the strings are being picked up for translation, run the
update process for another language, e.g.

perl misc/translator/translate update fr-FR

Then check the newly-built po file: fr-FR-messages-js.po. It should
list the updated files:

 koha-tmpl/opac-tmpl/bootstrap/js/amazonimages.js:8
 koha-tmpl/opac-tmpl/bootstrap/js/amazonimages.js:10
 koha-tmpl/opac-tmpl/bootstrap/js/bakertaylorimages.js:7
 koha-tmpl/opac-tmpl/bootstrap/js/google-jackets.js:77
 koha-tmpl/opac-tmpl/bootstrap/js/openlibrary.js:63

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>
7 months agoBug 33983: Move translatable strings out of OPAC's datatables.inc into JavaScript
Owen Leonard [Fri, 16 Jun 2023 14:22:08 +0000 (14:22 +0000)]
Bug 33983: Move translatable strings out of OPAC's datatables.inc into JavaScript

This patch removes the definition of translatable strings out of
the OPAC datatables.inc file and into datatables.js using the new JS
i81n function.

To test apply the patch and test some DataTable-driven tables in the
OPAC. A list of possible examples:

- Cart
- Bibliographic detail page
  - Place hold (with OPAC item level holds enabled in circulation rules)
    - Show more options ->
      - A specific item
- Bibliographic detail page for a serial record ->
  - More details ->
    - Full history
- Most popular
- Self checkout
- Logged in user ->
  - Charges
  - Curbside pickups
  - Messaging
  - Checkout history
  - Suggestions
  - Holds history
  - Tags
  - Recalls history
  - Search history
  - ILL requests

DataTables functionality should be unaffected. Check that the strings
defined for translation are still working. For instance the "Clear
filter" label on user summary checkouts, or the "No matching records
found" text displayed when you search a table for a string that doesn't
exist.

TESTING TRANSLATABILITY

- Update a translation, e.g. fr-FR:

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

- Open the corresponding .po file for JavaScript strings, in this case
  misc/translator/po/fr-FR-messages-js.po
- Locate strings pulled from
  koha-tmpl/intranet-tmpl/prog/js/members.js for translation, e.g.:

  msgid "Clear filter"

- Edit the corresponding "msgstr" string however you want (it's just for
  testing).
- Install the updated translation:

  > perl translate install fr-FR

- Switch to your newly translated language and repeat the test plan
  above. The translated strings should appear.

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>
7 months agoBug 34921: Tabs on Additional Content page need space above
Owen Leonard [Wed, 27 Sep 2023 12:36:15 +0000 (12:36 +0000)]
Bug 34921: Tabs on Additional Content page need space above

This patch adds a separator element, <hr /> between the additional
contents form and the tabs for visual clarity. Using an element is a
little hackish but it's a simple solution.

To test, apply the patch and go to Tools -> News -> New entry.

There should be a clear gap between the top form and the tabs below.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
7 months agoBug 34153: (QA follow-up) Tidy code
Kyle M Hall [Wed, 20 Sep 2023 10:23:36 +0000 (06:23 -0400)]
Bug 34153: (QA follow-up) Tidy code

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Rebased-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
7 months agoBug 34153: Add ability to allow items with additional materials notes to be checked...
Kyle M Hall [Thu, 29 Jun 2023 12:06:51 +0000 (08:06 -0400)]
Bug 34153: Add ability to allow items with additional materials notes to be checked out via SIP

At this time, any item with an additional materials date is blocked from checkout via SIP with a screen message to take the item to a circulation desk for checkout.
Some libraries wish to allow patrons to check out items via SIP even if the item has additional materials.

Test Plan:
1) Create an item with an additional materials note
2) Attempt to check it out via SIP
3) Note the failure and message
4) Enable the new SIP account option "allow_additional_materials_checkout"
5) Restart the SIP server
6) Attempt the checkout again
7) Note the checkout success and new AF field message!
8) prove t/db_dependent/SIP/Message.t

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Rebased-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
7 months agoBug 34153: Add tests
Kyle M Hall [Wed, 20 Sep 2023 06:47:48 +0000 (08:47 +0200)]
Bug 34153: Add tests

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
7 months agoBug 34722: Prevent other items from displaying to fill item-level recalls
Aleisha Amohia [Wed, 6 Sep 2023 00:13:48 +0000 (00:13 +0000)]
Bug 34722: Prevent other items from displaying to fill item-level recalls

This patch prevents other items attached to a record from being displayed as 'recalled' by item-level recalls.

To test:
1. Ensure UseRecalls system preference is enabled and circulation rules relevant to recalls are configured. Set 'on shelf recalls allowed' circulation rule 'if any unavailable' for ease of testing.
2. Search for a record that has multiple items, or create one with multiple items. Check out two of the items (Item A and Item B) to a patron, Patron A.
3. Log into the OPAC as another patron, Patron B. Search for the record and place a recall. Choose to recall a specific item and select Item A.
4. Go back to the staff interface and view the catalogue detail page for the record. Notice that every item has a 'recalled by...' message, even though Item A was specifically recalled.
5. Log into the OPAC as another patron, Patron C. Search for the record and place a recall. Choose to recall a specific item, notice every item has a 'recalled by...' message. Select Item B and Confirm.
6. In your terminal, the 'Other items are not returned for item-level recalls' test should fail when running
prove t/db_dependent/Koha/Item.t

7. Apply the patch and restart services

8. Confirm tests at t/db_dependent/Koha/Item.t now pass
9. Refresh the staff interface, confirm only Items A and B have the recalled message and the recall patron information for each item is accurate
10. Log into the OPAC as another patron, Patron D. Search for the record and place a recall. Choose to recall a specific item. Confirm only Items A and B have the recalled message.

Sponsored-by: Toi Ohomai Institute of Technology
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Perltidied new code.
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
7 months agoBug 34923: Allow direct input of hold dates on opac-reserve.tt
Lucas Gass [Tue, 26 Sep 2023 19:04:17 +0000 (19:04 +0000)]
Bug 34923: Allow direct input of hold dates on opac-reserve.tt

To test:
1. Turn on AllowHoldDateInFuture and OPACAllowHoldDateInFuture
2. Make a hold in OPAC and notice you cannot directly input a date in either the "Hold starts on date:" field or the "Hold not needed after:" field.
3. APPLY PATCH
4. Clear your browser cache and try again. You should be able to directly input dates.

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>
7 months agoBug 34859: Remove unnecessary params from reports-home.pl
David Cook [Thu, 21 Sep 2023 01:27:45 +0000 (01:27 +0000)]
Bug 34859: Remove unnecessary params from reports-home.pl

This change removes unnecessary syspref template parameters
and tidies the code.

Test plan:
0. Apply the patch and koha-plack --reload kohadev
1. Go to
/cgi-bin/koha/admin/preferences.pl?op=search&searchfield=IntranetNav
2. Add the following and save:
<li><a href="#">Awesome</a></li>
3. Go to
/cgi-bin/koha/admin/preferences.pl?op=search&searchfield=intranetstylesheet
4. Add the following and save:
http://bad
5. Go to
/cgi-bin/koha/admin/preferences.pl?op=search&searchfield=intranetcolorstylesheet
6. Add the following and save:
http://bad2
7. Go to /cgi-bin/koha/reports/reports-home.pl
8. Note the "Awesome" link in the top navbar
9. Note in the console that there are two errors where http://bad
and http://bad2 can't be resolved

Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
7 months agoBug 33395: Patron search results - show number of overdues and checkouts when patrons...
David Nind [Sat, 23 Sep 2023 01:10:31 +0000 (01:10 +0000)]
Bug 33395: Patron search results - show number of overdues and checkouts when patrons have overdues

This fixes the display of patron search results, so that it shows
the number of checkouts when a patron has overdue items. For
example: 1 / 2

Bug 30063 changed the display to show only the number of overdue
items in bold and red, without the total number of items checked
out.

Test plan:
1. Check out two items to a patron - make one overdue (click the
   checkout setting options and then specify a due date a month
   ago).
2. Check out another item to another patron.
3. Search for patrons so that the two patrons you checked out
   items to are listed in the results.
4. Note the display for the 'Checkouts' column:
   4.1 For patrons without any checkouts: 0 / 0
   4.2 For the patron from step 2 with one checkout: 0 / 1
   4.3 For the patron from step 1 with one overdue and one
       checkout: 1 (in bold and red)
5. Apply the patch.
6. Refresh the page of results (step 3).
7. Note that for the patron from step 1, the display now shows:
   1 / 2 (with the 1 in bold and red).
8. Sign off! 8-)

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
7 months agoBug 34300: Add holds column to order table
Wainui Witika-Park [Tue, 18 Jul 2023 01:24:16 +0000 (01:24 +0000)]
Bug 34300: Add holds column to order table

Adds the ability to easily place a hold on an ordered item from a basket

To test:
    1) Apply patch
    2) Go to acquisitions
    3) Go to an existing basket, or create a new one
    4) Add an order to the basket
    4) Notice there is a "Place hold" column in the Orders table
    5) Click the link for an item which allows you to place a hold easily on the biblio
    6) On the columns settings, toggle the "Place hold" column to hide it, and make sure it gets hidden

Sponsored-by: Pymble Ladies’ College
Signed-off-by: Lisette Scheer <lisette.scheer@bywatersolutions.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
7 months agoBug 9525: DBRev 23.06.00.028
Tomas Cohen Arazi [Wed, 4 Oct 2023 18:07:38 +0000 (14:07 -0400)]
Bug 9525: DBRev 23.06.00.028

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
7 months agoBug 9525: DBIC schema
Tomas Cohen Arazi [Wed, 4 Oct 2023 18:03:10 +0000 (14:03 -0400)]
Bug 9525: DBIC schema

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
7 months agoBug 9525: Atomic update fixes
Tomas Cohen Arazi [Wed, 4 Oct 2023 17:59:26 +0000 (13:59 -0400)]
Bug 9525: Atomic update fixes

This patch modernizes the atomic update, makes it follow the current
pattern of checking the column existence, and printing a message about
the column being created.

It also adds the COMMENT statement so tests pass later.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
7 months agoBug 9525: (QA follow-up) Tidy
Nick Clemens [Thu, 28 Sep 2023 13:59:24 +0000 (13:59 +0000)]
Bug 9525: (QA follow-up) Tidy

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
7 months agoBug 9525: (QA follow-up) Clarify how float groups are selected in circulation rules
Nick Clemens [Wed, 26 Apr 2023 15:06:53 +0000 (15:06 +0000)]
Bug 9525: (QA follow-up) Clarify how float groups are selected in circulation rules

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
7 months agoBug 9525: (QA follow-up) Fix QA complaints
Nick Clemens [Wed, 26 Apr 2023 15:02:54 +0000 (15:02 +0000)]
Bug 9525: (QA follow-up) Fix QA complaints

Add boolean to schema
Remove stray console.log
Fix subroutine name in POD

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
7 months agoBug 9525: Fix tests
Emmi Takkinen [Fri, 11 Nov 2022 07:24:37 +0000 (09:24 +0200)]
Bug 9525: Fix tests

To test prove t/db_dependent/Koha/Libraries.t

Sponsored-by: Koha-Suomi Oy
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
7 months agoBug 9525: Add option to define float groups and rules for float
Emmi Takkinen [Wed, 8 Sep 2021 05:58:14 +0000 (08:58 +0300)]
Bug 9525: Add option to define float groups and rules for float

Bug 22284 introduced ability to create hold groups.
We should have ability to create float groups in
same manner. This patch adds checkbox "Is local
float group" to group creation feature and new return
policy "Item floats by librarygroup".

To test:
1. Add new float group and some libraries to it.
2. From circulation and fine rules, set default
return policy as "Item floats by library group".
3. Check out an item for a patron.
4. Set library as one that belongs in the same
float group.
5. Check in the item.
=> Observe that notice for transfer doesn't pop up.
6. Check out again.
7. This time set library as one that doen's
belong in the same float group.
8. Check in.
=> Observe that notice for transfer pops up.

Experiment this feature by changing return policy
per library, item type etc.

Also prove t/db_dependent/Koha/Libraries.t

Sponsored-by: Koha-Suomi Oy
Signed-off-by: Lisette Scheer <lisettePalouse+Koha@gmail.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
7 months agoBug 9525: Add ft_local_float_group column
Emmi Takkinen [Tue, 7 Sep 2021 06:33:44 +0000 (09:33 +0300)]
Bug 9525: Add ft_local_float_group column

This patch adds new ft_local_float_group column
to library_groups table.

To test:
1. Apply patch and update database
2. Confirm new column is added correctly to the
library_groups table

Sponsored-by: Koha-Suomi Oy
Signed-off-by: Lisette Scheer <lisettePalouse+Koha@gmail.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
7 months agoBug 33958: (QA follow-up) tidy normalized_oclc
Kyle M Hall [Fri, 15 Sep 2023 17:00:54 +0000 (13:00 -0400)]
Bug 33958: (QA follow-up) tidy normalized_oclc

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
7 months agoBug 33958: Koha::Biblio::normalized_oclc
Jonathan Druart [Thu, 8 Jun 2023 12:15:16 +0000 (14:15 +0200)]
Bug 33958: Koha::Biblio::normalized_oclc

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
7 months agoBug 33958: Add tests
Jonathan Druart [Thu, 8 Jun 2023 12:14:43 +0000 (14:14 +0200)]
Bug 33958: Add tests

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
7 months agoBug 34870: Perform UTF8 encoding before redirection
emilyrose [Fri, 22 Sep 2023 15:58:23 +0000 (11:58 -0400)]
Bug 34870: Perform UTF8 encoding before redirection

Display special characters correctly when writing off an invoice.

The issue arises because pay.pl does not perform UTF-8 encoding on the “notes” parameter before redirecting the page. By using uri_escape_utf8, characters with a code above 255 are also UTF-8 encoded. Then, paycollect.pl can collect the information without any trouble.

This patch work with “;” and “:” characters.

TEST PLAN
1) Go to any patron profile > Accounting
2) Click “Create manual invoice”
3) Fill the fields and click the “Save” button
4) Repeat steps 2 and 3
5) Click “Make a payment”
6) Add a note with special characters for each one (e.g., éçö)
7) Select the created invoices and click the “Write off selected” button
8) In the note field, you should see “�” symbols where the special characters are supposed to be
9) Click the “Cancel” button
10) Now add a note with “:;” for one of the invoices
11) Select the invoices and click the “Write off selected” button
12) You should see a page with an error 500
13) Go back to the “Make a payment” page
14) Apply the patch
15) Add a note with special characters for each one (e.g., éçö)
16) Add “:;” to one of the note fields
17) Select the invoices and click the “Write off selected” button
18) Now the special characters are displayed correctly

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>
7 months agoBug 34961: Add sort parameter to OPAC search results RSS feed link
Owen Leonard [Fri, 29 Sep 2023 18:33:59 +0000 (18:33 +0000)]
Bug 34961: Add sort parameter to OPAC search results RSS feed link

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

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

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

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

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

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
7 months agoBug 33690: Convert to x-koha-override
Martin Renvoize [Fri, 8 Sep 2023 11:06:26 +0000 (12:06 +0100)]
Bug 33690: Convert to x-koha-override

This patch converts the existing work to use x-koha-override instead of
introducing an entirely new header and we default to the system
preference value if the override isn't passed.

I believe this is more consistent with our approach in other areas of
koha to date.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
7 months agoBug 33690: (QA follow-up) Mock C4::Letters subroutines for unit tests
Kyle M Hall [Fri, 23 Jun 2023 14:50:33 +0000 (10:50 -0400)]
Bug 33690: (QA follow-up) Mock C4::Letters subroutines for unit tests

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
JD Amended patch: tidy

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
7 months agoBug 33690: Add ability to send welcome notice when creating patrons using the REST API
Kyle M Hall [Fri, 5 May 2023 16:22:53 +0000 (12:22 -0400)]
Bug 33690: Add ability to send welcome notice when creating patrons using the REST API

It would be nice to have the ability to send a welcome notice when creating patrons via the API.

Test Plan:
1) Apply this patch
2) Ensure you have a WELCOME notice
3) Create a new patron using the REST API ( api/v1/patrons )
4) Note no welcome notice is sent to the patron ( you can check the
   notices tab for the patron )
5) Repeat step 3, but send the header X-Koha-SendWelcomeEmail with a
   value of 1 as part of the POST
6) Note the welcome message for the patron is in their notices!

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Bug 33690: Tidy test

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
7 months agoBug 34737: (follow-up) Code more defensively
Martin Renvoize [Mon, 25 Sep 2023 10:29:20 +0000 (11:29 +0100)]
Bug 34737: (follow-up) Code more defensively

This patch adds some defense for errant preference lines, allowing for
empty lines, comment lines and even skipping easily identified malformed
lines.

Signed-off-by: Toni Ford <Toni.Ford@newcastle.gov.uk>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
7 months agoBug 34737: (follow-up) Unit test for skipping bad lines
Martin Renvoize [Mon, 25 Sep 2023 10:39:22 +0000 (11:39 +0100)]
Bug 34737: (follow-up) Unit test for skipping bad lines

We update the test rules set to include some malformed, empty and
comment lines. No actual tests are added, but the skipping is checked by
all other tests in this way.

Signed-off-by: Toni Ford <Toni.Ford@newcastle.gov.uk>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
7 months agoBug 34737: Tidy t/db_dependent/SIP/Transaction.t
Kyle M Hall [Thu, 14 Sep 2023 17:59:42 +0000 (13:59 -0400)]
Bug 34737: Tidy t/db_dependent/SIP/Transaction.t

Signed-off-by: Toni Ford <Toni.Ford@newcastle.gov.uk>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
7 months agoBug 34737: (follow-up) Squelch a warning
Martin Renvoize [Thu, 7 Sep 2023 16:24:24 +0000 (17:24 +0100)]
Bug 34737: (follow-up) Squelch a warning

We weren't checking whether an item property was defined or not and as
such the new test highlighted a new warning.

Signed-off-by: Toni Ford <Toni.Ford@newcastle.gov.uk>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
7 months agoBug 34737: Unit tests
Martin Renvoize [Thu, 7 Sep 2023 16:23:42 +0000 (17:23 +0100)]
Bug 34737: Unit tests

This patch adds unit test to prove the multi-field match functionality
added in this patchset.

Signed-off-by: Toni Ford <Toni.Ford@newcastle.gov.uk>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
7 months agoBug 34737: Add ability to match on combinations of item fields
Martin Renvoize [Thu, 7 Sep 2023 15:53:00 +0000 (16:53 +0100)]
Bug 34737: Add ability to match on combinations of item fields

This patch updates the sort bin selection logic to allow for multiple
item field comparisons in a single config rule line.

Test plan
1) Run the unit tests before and after applying this patch and confirm
   they pass in both cases (prove -v t/db_debendant/SIP/Transaction.t
2) Check out an item and return it via SIP2:
     $ telnet localhost 8023
     9300CNterm1|COterm1|CPCPL|
     09N20200422    12430020200422    124300APCPL|AOCPL|AB001|AC|
   (Where 001 in |AB001| is the barcode of the item in question)
4) Check there is no CL field in the last response
5) Apply the patch, fill in SIP2SortBinMapping with e.g.:
       CPL:itype:eq:BK:ccode:eq:TEEN:3
6) Repeat the first step
7) Check the response contains a CL field with a value of 3 (or what
   you put in the config). The field should look like |CL3|

Signed-off-by: Toni Ford <Toni.Ford@newcastle.gov.uk>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
7 months agoBug 33522: (follow-up) Do not rely on fallback
Marcel de Rooy [Sat, 2 Sep 2023 07:05:22 +0000 (07:05 +0000)]
Bug 33522: (follow-up) Do not rely on fallback

Bug 33245 has been adjusted; the fallback has been removed.
We should check now if the -active or -inactive parameter
actually has been passed.

Test plan:
See earlier test plan.
Run the script without active/inactive.
Run the script with active.

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>
7 months agoBug 33522: Add active and inactive parameter to membership_expiry.pl
Marcel de Rooy [Tue, 30 May 2023 15:04:28 +0000 (15:04 +0000)]
Bug 33522: Add active and inactive parameter to membership_expiry.pl

Test plan:
Enable TrackLastPatronActivity.
Set MembershipExpiryDaysNotice to X days.
Pick a patron, make it expire in X days. Add email address.
Update borrowers.lastseen for this patron to make it active.
Run membership_expiry.pl -c -v -active 6
You should see at least one enqueued notice.
Run membership_expiry.pl -c -v -inactive 6
You should see that it skipped a number of active patrons (>=1).

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
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>
7 months agoBug 33245: Add unit test
Marcel de Rooy [Thu, 16 Mar 2023 15:41:55 +0000 (15:41 +0000)]
Bug 33245: Add unit test

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

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
JD amended patch: Adjust number of tests
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
7 months agoBug 33245: Introduce patron->is_active
Marcel de Rooy [Thu, 16 Mar 2023 14:34:58 +0000 (14:34 +0000)]
Bug 33245: Introduce patron->is_active

Does only add the new patron method.

NOTE: We may define additional criteria at some point, but I think
that this is a good starting point.

Test plan:
Run perl -MKoha::Patron -e'print Koha::Patrons->find(X)->is_active(Y);'
Note: replace X by a valid borrowernumber and Y by date criterium.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
7 months agoBug 33245: TestBuilder: Default value for anonymized
Marcel de Rooy [Thu, 16 Mar 2023 15:41:33 +0000 (15:41 +0000)]
Bug 33245: TestBuilder: Default value for anonymized

When we create a patron with TestBuilder, we normally
do not expect an anonymized status. This will certainly
hold for the patrons we are creating for testing is_active
in a following patch.

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

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
7 months agoBug 34891: Correct link on view restrictions button
Owen Leonard [Fri, 22 Sep 2023 16:31:08 +0000 (16:31 +0000)]
Bug 34891: Correct link on view restrictions button

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

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

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

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

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

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

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
7 months agoBug 34820: (QA follow-up) Fix span tag
Katrin Fischer [Tue, 3 Oct 2023 12:34:11 +0000 (12:34 +0000)]
Bug 34820: (QA follow-up) Fix span tag

One span tag was missing a <.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
7 months agoBug 34820: (QA follow-up) Replace em tags with quotes
Kyle M Hall [Wed, 20 Sep 2023 17:43:56 +0000 (13:43 -0400)]
Bug 34820: (QA follow-up) Replace em tags with quotes

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
7 months agoBug 34820: (QA follow-up) add filter, update CSV output
Kyle M Hall [Wed, 20 Sep 2023 10:40:08 +0000 (06:40 -0400)]
Bug 34820: (QA follow-up) add filter, update CSV output

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
7 months agoBug 34820: Clarify inventory tool message for items with non-matching notforloan...
Kyle M Hall [Mon, 18 Sep 2023 16:02:34 +0000 (12:02 -0400)]
Bug 34820: Clarify inventory tool message for items with non-matching notforloan value

In the inventory tool, if one or more not for loan values are selected, and an item is scanned that has no NFL status or an unselected NFL status, the error message reads "Unknown not-for-loan status". This can be interpreted as the item having an NFL status value that is not defined in the system, but that is not accurate. This should be reworded to remove ambiguity.

Test plan:
1) Create two items, one of which has the NFL status of "Ordered", the
   other having no NFL status
2) Enter those two barcodes in the inventory tool barcodes list
3) Check only "Ordered" in items.notforloan
4) Note the problem messages
5) Apply this patch
6) Re-run the inventory tool
7) Note the new clarified messages!

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>
7 months agoBug 34945: Remove the use of event attributes from OPAC clubs tab
Owen Leonard [Thu, 28 Sep 2023 11:30:35 +0000 (11:30 +0000)]
Bug 34945: Remove the use of event attributes from OPAC clubs tab

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

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

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

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

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

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

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
7 months agoBug 34833: (follow-up): remove redundant spaces
Victor Grousset/tuxayo [Mon, 25 Sep 2023 06:47:36 +0000 (08:47 +0200)]
Bug 34833: (follow-up): remove redundant spaces

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>