]> git.koha-community.org Git - koha.git/log
koha.git
2 years agoBug 30650: Koha classes
Jonathan Druart [Fri, 29 Apr 2022 08:42:05 +0000 (10:42 +0200)]
Bug 30650: Koha classes

Sponsored-by: Association KohaLa - https://koha-fr.org/
Signed-off-by: Koha Team University Lyon 3 <koha@univ-lyon3.fr>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 30650: DB changes
Jonathan Druart [Fri, 29 Apr 2022 07:57:26 +0000 (09:57 +0200)]
Bug 30650: DB changes

Sponsored-by: Association KohaLa - https://koha-fr.org/
Signed-off-by: Koha Team University Lyon 3 <koha@univ-lyon3.fr>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 31244: Fix 500 if logout and not logged in
Jonathan Druart [Tue, 26 Jul 2022 12:55:02 +0000 (14:55 +0200)]
Bug 31244: Fix 500 if logout and not logged in

Can't use an undefined value as a HASH reference at /kohadevbox/koha/C4/Auth.pm line 985
        C4::Auth::checkauth('CGI=HASH(0x5603b7dc4300)', 0, 'HASH(0x5603b2633238)', 'intranet', undef, 'intranet-main.tt') called at /kohadevbox/koha/C4/Auth.pm line 186
        C4::Auth::get_template_and_user('HASH(0x5603b7b83d08)') called at /kohadevbox/koha/mainpage.pl line 40

Test plan:
Open a private window
Hit /cgi-bin/koha/mainpage.pl?logout.x=1

Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 31246: <span> displayed in 'Additional fields' section
Tomas Cohen Arazi [Wed, 27 Jul 2022 12:54:19 +0000 (09:54 -0300)]
Bug 31246: <span> displayed in 'Additional fields' section

This patch avoids escaping HMTL data in the additional fields section.

To test:
1. Open the additional fields section
   http://kohadev-intra.mydnsname.org:8081/cgi-bin/koha/admin/additional-fields.pl
=> FAIL: there are some nasty <span> </span> texts in there
2. Apply this patch
3. Reload
=> SUCCESS: Things display nicely again!
4. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Emmanuel Bétemps <e.betemps@gmail.com>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 31120: Items will renew for zero ( 0 ) days if renewalperiod is blank/empty value
Kyle M Hall [Thu, 7 Jul 2022 19:14:59 +0000 (15:14 -0400)]
Bug 31120: Items will renew for zero ( 0 ) days if renewalperiod is blank/empty value

If the rule renewalperiod is the blank empty string instead of being null/undefined or non-existant, Koha will interpret the renewal period as being zero days instead of falling back to the issuelength rule.

It makes sense to me that a literal 0 here should make it renew for zero days even though that is nonsensical.

Test Plan:
1) Delete all your rules
2) Create an all/all/all rules with an empty string for renewal base
   period
3) Note that renewing an item does nothing
4) Apply this patch
5) Restart all the things!
6) Renew again
7) Note the renewal uses the issuelength rule as intended

Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 31120: Add unit tests
Kyle M Hall [Thu, 14 Jul 2022 10:38:57 +0000 (10:38 +0000)]
Bug 31120: Add unit tests

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 22276: (QA follow-up) Add missing USE
Katrin Fischer [Sun, 24 Apr 2022 12:43:27 +0000 (12:43 +0000)]
Bug 22276: (QA follow-up) Add missing USE

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 22276: Add client storage of user-selected DataTables configuration
Owen Leonard [Fri, 28 Jan 2022 13:00:04 +0000 (13:00 +0000)]
Bug 22276: Add client storage of user-selected DataTables configuration

This patch enables use of DataTables' built-in session storage of table
configurations. DataTables by default uses the browser's localstorage
feature to store the state of each DataTable, including which columns
have been hidden by the user.

Our table settings system has always overridden this saved state. This
patch adds a check for a saved configuration state and if present loads
the saved state instead of the default state.

The system is enabled in this patch on the libraries administration
page. To test, apply the patch and open go to Administration ->
Libraries.

- Use the "Columns" button to change the visibility setting of multiple
  columns.
- Navigate away from the page and then back to test that the visibility
  settings have been kept.
- Go to Administration -> Table settings -> Administration and change
  the visibility settings for the "libraries" table in a way that it
  differs from the visibility settings you set manually.
- Return to the libraries administration page and confirm that your
  manual settings are still being loaded instead of the defaults from
  table settings.

Signed-off-by: Solène Desvaux <solene.desvaux@biblibre.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 31211: (QA follow-up) Add class to new list element for error
Katrin Fischer [Mon, 25 Jul 2022 22:25:46 +0000 (22:25 +0000)]
Bug 31211: (QA follow-up) Add class to new list element for error

To allow additional styling the class template_toolkit_error was
added to the list element.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 31211: Check slips and notices for valid Template Toolkit and report errors
Kyle Hall [Thu, 21 Jul 2022 15:06:15 +0000 (11:06 -0400)]
Bug 31211: Check slips and notices for valid Template Toolkit and report errors

It would be useful for Koha to run a basic TT validation test and report back errors.
That way if somebody misses an END tag or something of that nature, it will be easy to find and fix.

Test Plan:
1) Apply this patch
2) Edit a notice, change the content to simply "[% END %]"
   or some other invalid Template Toolkit
3) Choose "Save and continue editing"
4) Note the new "Template Toolkit error" field that displays the error
   message

Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 31229: (bug 30063 follow-up) fix column visibility
Jonathan Druart [Mon, 25 Jul 2022 06:54:48 +0000 (08:54 +0200)]
Bug 31229: (bug 30063 follow-up) fix column visibility

Fix bad conflict resolution with bug 29648.

Test plan:
Confirm that the "Columns" button is displayed on the patron result view
and that it works as expected.

Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 21982: Circulation statistics wizard does not count deleted items
Jérémy Breuillard [Wed, 24 Nov 2021 15:56:09 +0000 (16:56 +0100)]
Bug 21982: Circulation statistics wizard does not count deleted items

By default statistic assistant filter is set on the
existing items and doesn't mind about deleted items.
The patch corrects this. Items belong to the same library.

Test plan:
1)Make sure to have at least 1 or more item(s) in deleteditems database table
2)Home > Reports > Circulation statistics
3)Fill up 'Issuing library', 'Home library' and 'Holding library'
4)Submit
5)Notice that only statistics for active items are shown
6)Apply patch and repeat from 2) to 5)
7)Now active items and deleted items are shown

Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 31191: Specify FacetLabelTruncationLength is only for Zebra
Caroline Cyr La Rose [Tue, 19 Jul 2022 19:22:33 +0000 (15:22 -0400)]
Bug 31191: Specify FacetLabelTruncationLength is only for Zebra

This patch adds a note in the description of FacetLabelTruncationLength
that it only works with Zebra.

To test:
0) Apply patch
1) Go to Administration > Global system preference > Searching
preferences
2) Search for FacetLabelTruncationLength
3) Read the description, make sure it indicates that is requires Zebra

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 26549: Show value of global system preferences on subscription form
Owen Leonard [Thu, 12 May 2022 15:53:55 +0000 (15:53 +0000)]
Bug 26549: Show value of global system preferences on subscription form

This patch modifies the subscription entry form so that the values of
two system preferences are displayed as a hint to the user:

The "Number of issues to display to staff" field will show the value
of the StaffSerialIssueDisplayCount preference, and the "Number of
issues to display to the public" field will show
OPACSerialIssueDisplayCount. If the user has permission the system
preference names will link to the system preferences page.

To test, apply the patch and log into the staff interface as a user with
permission to edit system preferences.

- Go to Serials -> New subscription.
- The "Number of issues to display to staff" field should have a hint
  under it: "Default: XX (StaffSerialIssueDisplayCount system
   preference)"
- The "Number of issues to display to the public" field should have a
  hint under it: "Default: XX (OPACSerialIssueDisplayCount system
  preference)"
- Log out and log back in as a user who does not have permission to edit
  system preferences. Return to the form and confirm that the hints do
  not link to system preferences.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 30969: Cross site scripting (XSS) attack in OPAC authority search ( opac-authorit...
Kyle Hall [Wed, 15 Jun 2022 16:06:55 +0000 (12:06 -0400)]
Bug 30969: Cross site scripting (XSS) attack in OPAC authority search ( opac-authorities-home.pl )

There appears to be a cross site scripting attack vulnerability in opac-authorities-home.pl, but may be accessible from any page using C4::Output::pagination_bar.

https://MYKOHA.LOCAL/cgi-bin/koha/opac-authorities-home.pl?and_or=and%27%22()%26%25%3Csad%3E%3CScRiPt%20%3Ealert(document.domain)%3C/ScRiPt%3E&authtypecode=CORPO_NAME&excluding=1&marclist=all&op=do_search&operator=contains&orderby=HeadingAsc&type=opac&value=1

Test Plan:
1) Use the URL above to show the XSS vulnerability exists
2) Apply this patch
3) Restart all the things!
4) Reload the page, no XSS vulnerability!

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 29697: tracklinks should not explode on invalid marc record
Jonathan Druart [Mon, 25 Jul 2022 13:08:35 +0000 (15:08 +0200)]
Bug 29697: tracklinks should not explode on invalid marc record

Caught by t/db_dependent/www/regressions.t

    #   Failed test '404 for itemnumber containing different URI'
    #   at t/db_dependent/www/regressions.t line 124.
    #          got: '500'
    #     expected: '404'

    #   Failed test '302 for itemnumber with matching URI'
    #   at t/db_dependent/www/regressions.t line 126.
    #          got: '500'
    #     expected: '302'

    #   Failed test '404 for itemnumber containing different URI'
    #   at t/db_dependent/www/regressions.t line 139.
    #          got: '500'
    #     expected: '404'

    #   Failed test '302 for itemnumber with matching URI'
    #   at t/db_dependent/www/regressions.t line 141.
    #          got: '500'
    #     expected: '302'
    # Looks like you failed 4 tests of 36.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 29697: Fix t/db_dependent/Search.t
Tomas Cohen Arazi [Mon, 25 Jul 2022 13:16:48 +0000 (10:16 -0300)]
Bug 29697: Fix t/db_dependent/Search.t

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 29697: Fix t/Search.t
Jonathan Druart [Mon, 25 Jul 2022 12:30:40 +0000 (14:30 +0200)]
Bug 29697: Fix t/Search.t

 #   Failed test 'No tests run for subtest "searchResults PassItemMarcToXSLT test"'
 #   at t/Search.t line 208.
 Undefined subroutine &C4::Biblio::EmbedItemsInMarcBiblio called at t/Search.t line 194.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 29697: Reintroduce wrongly removed import
Jonathan Druart [Mon, 25 Jul 2022 12:28:56 +0000 (14:28 +0200)]
Bug 29697: Reintroduce wrongly removed import

 #   Failed test 'No tests run for subtest "CancelHold"'
 #   at t/db_dependent/ILSDI_Services.t line 806.
 Undefined subroutine &C4::ILSDI::Services::CanReserveBeCanceledFromOpac called at /kohadevbox/koha/C4/ILSDI/Services.pm line 941.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 29697: Fix t/db_dependent/Exporter/Record.t
Jonathan Druart [Mon, 25 Jul 2022 12:26:27 +0000 (14:26 +0200)]
Bug 29697: Fix t/db_dependent/Exporter/Record.t

Not sure about the warn, we shouldn't need it as we are raising an
exception. But better (for now) than introducing regressions.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 29697: Replace some missing occurrences
Jonathan Druart [Mon, 25 Jul 2022 12:10:53 +0000 (14:10 +0200)]
Bug 29697: Replace some missing occurrences

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 30878: Avoid resetting waiting reserves tab
Lari Taskula [Wed, 1 Jun 2022 15:06:52 +0000 (15:06 +0000)]
Bug 30878: Avoid resetting waiting reserves tab

When canceling holds waiting over X days in "Holds awaiting pickup"
view, form submission resets the selected tab to "Holds waiting". This
tab reset may cause confusion for the user and lead to unwanted
actions. Instead, the user should be returned to the same tab that they
began with.

To test:
1. Apply patch
2. Navigate to /cgi-bin/koha/circ/waitingreserves.pl
3. Select "Holds waiting over X days" tab
4. Refresh page
5. Observe "Holds waiting over X days" is still selected
6. Have some holds waiting over X days
7. Select one of them and press "Cancel selected (1)" and confirm
8. Observe "Holds waiting over X days" is still selected after form
   submission

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 29697: (follow-up) Indexing a deleted record is not expected to crash
Tomas Cohen Arazi [Fri, 22 Jul 2022 18:49:22 +0000 (15:49 -0300)]
Bug 29697: (follow-up) Indexing a deleted record is not expected to crash

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 29697: Don't crash ES reindex if a record is wrong
Jonathan Druart [Wed, 20 Jul 2022 07:02:29 +0000 (09:02 +0200)]
Bug 29697: Don't crash ES reindex if a record is wrong

We don't want rebuild_elasticsearch.pl to crash if a record is wrong
(also fix ktd setup).
Note that now the script will output an error for the problematic
record, which is certainly the expected behaviour as we are doing it
already for authority records.

Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 29697: Deal with the degraded view in detail.pl
Jonathan Druart [Fri, 18 Mar 2022 10:30:31 +0000 (11:30 +0100)]
Bug 29697: Deal with the degraded view in detail.pl

In detail.pl we must provide a degraded view with an error message about
invalid MARC::Record.
We are then forced to reproduce the GetMarcBiblio behaviour and call
StripNonXmlChars on the MARC::XML

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Rebased-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 29697: Fix tests
Jonathan Druart [Mon, 24 Jan 2022 16:01:11 +0000 (17:01 +0100)]
Bug 29697: Fix tests

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 29697: Use flag embed_items
Jonathan Druart [Fri, 21 Jan 2022 13:41:41 +0000 (14:41 +0100)]
Bug 29697: Use flag embed_items

Includes:
    Bug 29697: (follow-up) Use flag embed_items

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 29697: Remove GetHiddenItemnumbers
Jonathan Druart [Fri, 21 Jan 2022 14:06:54 +0000 (15:06 +0100)]
Bug 29697: Remove GetHiddenItemnumbers

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
JD amended patch:
-    my @items        = $biblio->items->filter_by_visible_in_opac({ patron => $logged_in_user })->unblessed;
-    foreach my $item (@items) {
+    my $items        = $biblio->items->filter_by_visible_in_opac({ patron => $logged_in_user })->unblessed;
+    foreach my $item (@$items) {

-    for my $itm (@items) {
+    for my $itm (@$items) {

-    $dat->{ITEM_RESULTS}   = \@items;
+    $dat->{ITEM_RESULTS}   = $items;

-        @items_to_show = Koha::Items->search( { itemnumbers => [ map { $_->{itemnumber} } @all_items ] } )
-                                    ->filter_by_visible_in_opac( { patron => $patron } );
+        @items_to_show = Koha::Items->search( { itemnumber => [ map { $_->{itemnumber} } @all_items ] } )
+                                    ->filter_by_visible_in_opac( { patron => $patron } )->as_list;

-            my @items_to_show = $items->filter_by_visible_in_opac({ opac => 1, patron => $patron });
+            my @items_to_show = $items->filter_by_visible_in_opac({ opac => 1, patron => $patron })->as_list;

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 29697: Replace GetMarcBiblio occurrences with $biblio->metadata->record
Jonathan Druart [Fri, 21 Jan 2022 10:03:15 +0000 (11:03 +0100)]
Bug 29697: Replace GetMarcBiblio occurrences with $biblio->metadata->record

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
JD Amended patch:
-# FIXME Special case here

-    print "Biblio not found\n,";
+    print "Biblio not found\n";

- my $biblio = Koha::Biblio->find($hostbiblionumber);
+ my $biblio = Koha::Biblios->find($hostbiblionumber);

Rebased-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 29697: Special case - opac not needed
Jonathan Druart [Fri, 21 Jan 2022 10:04:23 +0000 (11:04 +0100)]
Bug 29697: Special case - opac not needed

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 31157: DBRev 22.06.00.021
Tomas Cohen Arazi [Fri, 22 Jul 2022 18:18:06 +0000 (15:18 -0300)]
Bug 31157: DBRev 22.06.00.021

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 31157: (QA follow-up) Update descriptions and wording of configuration options
Katrin Fischer [Fri, 22 Jul 2022 15:57:25 +0000 (15:57 +0000)]
Bug 31157: (QA follow-up) Update descriptions and wording of configuration options

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

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

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

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

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

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

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

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

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

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

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 26689: Prepend letter codes.
Martin Renvoize [Wed, 29 Jun 2022 16:26:30 +0000 (17:26 +0100)]
Bug 26689: Prepend letter codes.

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

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

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

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

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

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

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

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

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

Test plan:
See first patch. Add orgcode OCoLC.

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

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

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

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

Test plan:
Look up pref OPACSearchForTitleIn.

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

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

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

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

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 30858: Add serial enumeration/chronology to item search
Lucas Gass [Thu, 26 May 2022 16:34:12 +0000 (16:34 +0000)]
Bug 30858: Add serial enumeration/chronology to item search

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

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 31121: Fix date formatting in cashup summary modal
Martin Renvoize [Fri, 8 Jul 2022 14:46:04 +0000 (15:46 +0100)]
Bug 31121: Fix date formatting in cashup summary modal

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 31086: Prevent placing hold with no pickup location
Nick Clemens [Fri, 1 Jul 2022 14:46:26 +0000 (14:46 +0000)]
Bug 31086: Prevent placing hold with no pickup location

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

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 31086: Throw an exception when a hold is stored with no branchcode
Nick Clemens [Fri, 1 Jul 2022 14:44:09 +0000 (14:44 +0000)]
Bug 31086: Throw an exception when a hold is stored with no branchcode

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

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 31086: DB update
Nick Clemens [Fri, 1 Jul 2022 14:43:09 +0000 (14:43 +0000)]
Bug 31086: DB update

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

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 31138: Don't ignore DataTables errors and raise them to the end-user
Jonathan Druart [Tue, 12 Jul 2022 08:09:25 +0000 (10:09 +0200)]
Bug 31138: Don't ignore DataTables errors and raise them to the end-user

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

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

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

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

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 23838: (QA follow-up) Move include files
Tomas Cohen Arazi [Fri, 22 Jul 2022 15:46:30 +0000 (12:46 -0300)]
Bug 23838: (QA follow-up) Move include files

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

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

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

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

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

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

Quieting an issue highlighted by the QA tool.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

* Late issues (serials)
* Basket (acquisitions)

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 30570: Compiled CSS
Tomas Cohen Arazi [Wed, 20 Jul 2022 13:05:29 +0000 (10:05 -0300)]
Bug 30570: Compiled CSS

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

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

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

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

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

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

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

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

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

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

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

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

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

Prevent a blink

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

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

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

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

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 31020: Fix PassItemMarcToXSLT in system preferences description
Fridolin Somers [Thu, 23 Jun 2022 01:04:47 +0000 (15:04 -1000)]
Bug 31020: Fix PassItemMarcToXSLT in system preferences description

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

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

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

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

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

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

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

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