]> git.koha-community.org Git - koha.git/log
koha.git
2 years agoBug 30218: Add subfield g to field 150 in C4::Heading::MARC21 mappings
Thomas Klausner [Thu, 3 Mar 2022 14:39:20 +0000 (15:39 +0100)]
Bug 30218: Add subfield g to field 150 in C4::Heading::MARC21 mappings

When creating authorities via SRU or linking exising authorities
(via cgi-bin/koha/authorities/auth_finder.pl) the search results are
generated using the hardcoded mappings $bib_heading_fields /
$auth_heading_field from C4::Heading::MARC21. For TOPIC_TERM / field 150
these mappings currently include the subfield `abvxyz68`.

But: We are using the GND provided by Deutsche Nationalbibliothek.
We imported some authorities from there, for example:

http://d-nb.info/gnd/4114171-4 "Kind <0-3 Jahre>" (kid 0-3 years)
http://d-nb.info/gnd/4196417-2 "Kind <0-4 Jahre>" (kid 0-4 years)

When searching for these terms, Koha only displays "Kind", which is not
very helpful, as there are a lot of different authorities for different
age bands.

GND stores "Kind" in 150a, and "0-3 Jahre" in 150g.

But in the hardcoded mappings used by Koha, subfield g is not included.

This patch adds subfield g to these mappings, thus making it possible to
easily select the correct authority.

Test plan:
* Create an authority (or edit an existing one) and set 150g to "foo"
* Create a new biblio (or edit an existing one), go to field 650 and click
  on the search-icon on the right.
* A popup should open, where you can search for "Authority type: TOPIC_TERM",
  enter the name of the authority (150a!) in the search box
* In the resulting list, you will only see the value of 150a.
* Apply the patch
* Search again, now you should see "foo" in the result list

Sponsored-by: Steiermärkische Landesbibliothek
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 31385: (follow-up) Add code based URL on the staff CMS view
Marcel de Rooy [Thu, 18 Aug 2022 08:44:44 +0000 (08:44 +0000)]
Bug 31385: (follow-up) Add code based URL on the staff CMS view

Test plan:
Create a page with contents in two languages.
Verify that the Default URL shows the default content and the
Current language URL shows content based on active language.

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 31385: (follow-up) Same change at intranet side
Marcel de Rooy [Thu, 18 Aug 2022 07:29:35 +0000 (07:29 +0000)]
Bug 31385: (follow-up) Same change at intranet side

Test plan:
Try at staff side: tools/page.pl?code=CODE

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 31385: Allow searching a CMS page by code
Marcel de Rooy [Wed, 17 Aug 2022 13:41:53 +0000 (13:41 +0000)]
Bug 31385: Allow searching a CMS page by code

Test plan:
Add a CMS page with two languages for it.
Look at the code column in the DB.
Try opac/opac-page.pl?code=[CODE]&lang=[LANG]. Test leaving lang
empty and passing various languages.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Edit: I squashed the lang => language patch

2 years agoBug 31343: Prevent two nodes #holdscr on waiting reserves
Jonathan Druart [Fri, 12 Aug 2022 13:19:10 +0000 (15:19 +0200)]
Bug 31343: Prevent two nodes #holdscr on waiting reserves

Two nodes with id="holdscr" existed on this patch. I guess the table
was not initiated properly before 31138 neither.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 31343: (bug 31138 follow-up) Don't hide error
Jonathan Druart [Fri, 12 Aug 2022 13:17:45 +0000 (15:17 +0200)]
Bug 31343: (bug 31138 follow-up) Don't hide error

Some errors are not passing settings and so the error is hidden

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 30941: (QA follow-up) Only export what is needed
Tomas Cohen Arazi [Fri, 19 Aug 2022 14:00:42 +0000 (11:00 -0300)]
Bug 30941: (QA follow-up) Only export what is needed

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 30718: Fix imports
Tomas Cohen Arazi [Fri, 19 Aug 2022 13:12:06 +0000 (10:12 -0300)]
Bug 30718: Fix imports

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 31395: Only try to cancel holds if item found
Tomas Cohen Arazi [Thu, 18 Aug 2022 17:00:54 +0000 (14:00 -0300)]
Bug 31395: Only try to cancel holds if item found

This patch makes the code dealing with waiting holds with cancellation
requests be dependent on the fact an item has been found.

The returns.pl controller is a bit messy as the real return takes place
outside the main `if ($item)` block. This should be refactored and
probably run inside a transaction...

In the meantime this patch will make the job.

To test:
1. Try to return an invalid barcode (e.g. ASDQWE)
=> FAIL: Things explode
2. Apply this patch
3. Repeat 1
=> SUCCESS: Doesn't explode!
4. Verify that returning an item with a waiting hold with cancellation
   requests still cancells the hold.
=> SUCCESS: It does!
5. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Andrew Fuerste-Henry <andrewfh@dubcolib.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 31282: Fix broken characters in patron_emailer.pl verbose mode
Tomas Cohen Arazi [Tue, 2 Aug 2022 12:24:57 +0000 (09:24 -0300)]
Bug 31282: Fix broken characters in patron_emailer.pl verbose mode

To test:
1. Have a report containing:
   SELECT tomascohen@theke.io;
2. Have a members notice containing ¡ and other non-ASCII characters.
3. Run (changing the report number and notice code accordingly):
   $ kshell
  k$ perl misc/cronjobs/patron_emailer.pl --report 4 \
           --notice BIRTHDAY --from tomascohen@theke.io --module members
=> FAIL: non-ASCII characters are broken
4. Apply this patch
5. Repeat 3
=> SUCCESS: Things print correctly!
6. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
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 30941: (QA follow-up) Import methods explicitly
Tomas Cohen Arazi [Fri, 19 Aug 2022 12:06:57 +0000 (09:06 -0300)]
Bug 30941: (QA follow-up) Import methods explicitly

By explicitly importing the Koha::I18N methods, I get rid of this error:

kohadev-koha@kohadevbox:/kohadevbox/koha$ qa -c 2 --run-tests
testing 2 commit(s) (applied to 9b2bf04 '09 Bug 30507: Value builder for field')

Processing files before patches
|========================>| 12 / 12 (100.00%)

An error occurred : Inconsistent hierarchy during C3 merge of class 'Koha::I18N':
current merge results [
Koha::I18N,
]
merging failed on 'Exporter' at /kohadevbox/qa-test-tools/koha-qa.pl line 112.

This happens because the Koha::I18N library is exporting all its methods
explicitly and, by design, the __ methods used in value builders cannot
determine which of the imported methods to use i.e. if Koha::I118N::__
or Koha::CodeList::Unimarc::MediumOfPerformance:__

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 30941: (QA follow-up) Add exec flag to scripts
Kyle M Hall [Fri, 19 Aug 2022 11:22:17 +0000 (11:22 +0000)]
Bug 30941: (QA follow-up) Add exec flag to scripts

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 30941: Add cataloguing plugins for 146$bcdef (UNIMARC)
Julian Maurice [Wed, 19 Jan 2022 15:09:28 +0000 (16:09 +0100)]
Bug 30941: Add cataloguing plugins for 146$bcdef (UNIMARC)

Test plan:
1. Configure the default MARC framework to use those value builders:
   - unimarc_field_146b for 146$b
   - unimarc_field_146c for 146$c
   - unimarc_field_146d for 146$d
   - unimarc_field_146e for 146$e
   - unimarc_field_146f for 146$f
2. Verify that they all work correctly according to
https://www.ifla.org/files/assets/uca/unimarc_updates/BIBLIOGRAPHIC/u-b_146.pdf

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 30507: Value builder for field 183
jeremy breuillard [Fri, 4 Mar 2022 13:16:33 +0000 (14:16 +0100)]
Bug 30507: Value builder for field 183

This patch provides values builders for the subfields $a and $2. Those are unimarc official codes who help to
identify the kind of items
Test plan:
1)Go to Home > Cataloging > New record
2)Section 1 - field 183 : it contains subfields $a & $2
3)Inputs are writable but notice that no plugins are suggested
4)Apply patch and repeat 1) to 3)
5)Values builders plugins are available for $a and $2

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 30506: Value builder for field 182
jeremy breuillard [Fri, 4 Mar 2022 13:16:33 +0000 (14:16 +0100)]
Bug 30506: Value builder for field 182

This patch provides values builders for the subfields $a, $c and $2. Those are unimarc official codes who help to
identify the kind of items
Test plan:
1)Go to Home > Cataloging > New record
2)Section 1 - field 182 : it contains subfields $a, $c & $2
3)Inputs are writable but notice that no plugins are suggested
4)Apply patch and repeat 1) to 3)
5)Values builders plugins are available for $a, $c and $2

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 30504: Value builder for field 181
jeremy breuillard [Thu, 3 Mar 2022 09:32:04 +0000 (10:32 +0100)]
Bug 30504: Value builder for field 181

This patch provides values builders for the subfields $a, $b, $c and $2. Those are unimarc official codes who help to identify the kind of items

Test plan:
1)Go to Home > Cataloging > New record
2)Section 1 - field 181 : it contains subfields $a, $b, $c & $2
3)Inputs are writable but notice that no plugins are suggested
4)Apply patch and repeat 1) to 3)
5)Values builders plugins are available for $a, $b, $c and $2

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 30718: (QA follow-up) Remove double use KohaDates
Marcel de Rooy [Fri, 19 Aug 2022 09:37:40 +0000 (09:37 +0000)]
Bug 30718: (QA follow-up) Remove double use KohaDates

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 30718: (QA follow-up) KohaDates filter on inputs
Marcel de Rooy [Fri, 19 Aug 2022 09:04:49 +0000 (09:04 +0000)]
Bug 30718: (QA follow-up) KohaDates filter on inputs

Found another one on a visible input. Replaced with html filter.
koha-tmpl/intranet-tmpl/prog/en/modules/onboarding/onboardingstep2.tt:                                            <input type="text" class="enrolmentperioddate" name="enrolmentperioddate" id="enrolmentperioddate" value="[% category.enrolmentperioddate | $KohaDates %]" />

But we also have a few hidden ones. First verified that cleanborrowers did not work anymore with expirydate.
Fixed it with passing iso dateformat to resolve.
intranet-tmpl/prog/en/modules/acqui/parcels.tt:            <input type="hidden" name="shipmentdate" value="[% shipmentdate | $KohaDates %]" />
intranet-tmpl/prog/en/modules/serials/subscription-add.tt:                                          <input type="hidden" id="acqui_date" name="firstacquidate" value="[% firstacquidate | $KohaDates %]"/>
intranet-tmpl/prog/en/modules/tools/batch_extend_due_dates.tt:                                    <input type="hidden" name="new_hard_due_date" value="[% new_hard_due_date | $KohaDates %]" />
intranet-tmpl/prog/en/modules/tools/cleanborrowers.tt:            <input type="hidden" name="not_borrowed_since" value="[% not_borrowed_since | $KohaDates %]" />
intranet-tmpl/prog/en/modules/tools/cleanborrowers.tt:            <input type="hidden" name="last_issue_date" value="[% last_issue_date | $KohaDates %]" />
intranet-tmpl/prog/en/modules/tools/cleanborrowers.tt:            <input type="hidden" name="borrower_dateexpiry" value="[% borrower_dateexpiry | $KohaDates %]" />
intranet-tmpl/prog/en/modules/tools/cleanborrowers.tt:                <input type="hidden" name="borrower_lastseen" value="[% borrower_lastseen | $KohaDates %]" />

Test plan:
Try cleanborrowers with expiry date.
cd koha-tmpl; git grep "<input.*\$KohaDates" | grep -v iso

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 30718: (QA follow-up) Apply prevent duplication on OPAC too
Marcel de Rooy [Fri, 19 Aug 2022 08:35:14 +0000 (08:35 +0000)]
Bug 30718: (QA follow-up) Apply prevent duplication on OPAC too

See former intranet side patch.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 30718: Fix serial claims filters
Jonathan Druart [Wed, 10 Aug 2022 08:28:32 +0000 (10:28 +0200)]
Bug 30718: Fix serial claims filters

https://bugs.koha-community.org/show_bug.cgi?id=30718
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 30718: Fix renewal with due date
Jonathan Druart [Tue, 9 Aug 2022 06:41:37 +0000 (08:41 +0200)]
Bug 30718: Fix renewal with due date

This was a test added by the following commit:

commit 99eccc18ed4a21fa416a3d61fed3f70825dc2203
Date:   Thu Jun 16 10:10:09 2011 +0100
    Bug 5549 : Handle datetimes on return

It's no longer needed now, we can pass a DateTime or an ISO-formatted
date

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 30718: Fix dates display at the OPAC
Jonathan Druart [Fri, 5 Aug 2022 09:13:30 +0000 (11:13 +0200)]
Bug 30718: Fix dates display at the OPAC

Found dateofbirth so far, do we have others?

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 30718: Apply flatpickr changes to OPAC
Jonathan Druart [Fri, 5 Aug 2022 09:10:42 +0000 (11:10 +0200)]
Bug 30718: Apply flatpickr changes to OPAC

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 30718: Prevent 'reset' icon to appear twice
Jonathan Druart [Tue, 19 Jul 2022 12:33:24 +0000 (14:33 +0200)]
Bug 30718: Prevent 'reset' icon to appear twice

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 30718: Fix time display
Jonathan Druart [Tue, 19 Jul 2022 12:23:10 +0000 (14:23 +0200)]
Bug 30718: Fix time display

Especifically when timeformat=12h

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 30718: Fix scheduler
Jonathan Druart [Mon, 18 Jul 2022 13:27:22 +0000 (15:27 +0200)]
Bug 30718: Fix scheduler

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 30718: Fix holidays
Jonathan Druart [Mon, 18 Jul 2022 13:13:17 +0000 (15:13 +0200)]
Bug 30718: Fix holidays

Template process failed: undef error - The given date (07/18/2022) does not match the date format (iso)

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 30718: Add missing USE KohaDates
Jonathan Druart [Mon, 18 Jul 2022 13:10:59 +0000 (15:10 +0200)]
Bug 30718: Add missing USE KohaDates

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 30718: Fix serials/showpredictionpattern.pl
Jonathan Druart [Mon, 18 Jul 2022 13:10:02 +0000 (15:10 +0200)]
Bug 30718: Fix serials/showpredictionpattern.pl

Can't locate object method "ymd" via package "2022-02-01" (perhaps you forgot to load "2022-02-01"?) at /kohadevbox/koha/serials/showpredictionpattern.pl line 100
eval {...} at /kohadevbox/koha/serials/showpredictionpattern.pl line 2

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 30718: Fix today's date on overdue
Jonathan Druart [Mon, 18 Jul 2022 13:09:42 +0000 (15:09 +0200)]
Bug 30718: Fix today's date on overdue

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 30718: Pass DT to filter_by_lates
Jonathan Druart [Thu, 14 Jul 2022 13:24:19 +0000 (15:24 +0200)]
Bug 30718: Pass DT to filter_by_lates

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 30718: Use flatpickr's altInput
Jonathan Druart [Mon, 11 Jul 2022 14:14:38 +0000 (16:14 +0200)]
Bug 30718: Use flatpickr's altInput

The idea rely on the KohaDates TT plugin for the date formatting. We
should not have any output_pref calls in pl or pm (there are some
exceptions, for ILSDI for instance).

Also flatpickr will deal with the places where dates are inputed. We
will pass the raw SQL value (what we call 'iso' in Koha::DateUtils), and
the controller will receive the same value, no need to additional
conversion.
Note that DBIC has the capability to auto-deflate DateTime objects,
which makes things way easier. We can either pass the value we receive
from the controller, or pass a DT object to our methods.

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 30779: Remove _update_import_record_marc and update tests
Nick Clemens [Wed, 17 Aug 2022 11:56:37 +0000 (11:56 +0000)]
Bug 30779: Remove _update_import_record_marc and update tests

This patch removes the now unused: _update_import_record_marc

Additionally, as items are already present in import biblio we no longer need to embed
them, so that parameter is removed and the option removed from the sub and pod and everywhere
it was used

In all cases, we were embedding, so we don't need a way to get without

Tests updated

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 30779: Do not update import marc after importing items
Nick Clemens [Mon, 16 May 2022 19:57:23 +0000 (19:57 +0000)]
Bug 30779: Do not update import marc after importing items

We are stripping the marc item tags at import - we save them when not importing items, but
strip when importing items

I think we can save on writes by leaving them in the record. This also allows comparison to what was staged
versus items created

To test:
 1 - Stage a marc record with items, but do not look for items
 2 - Confirm the item tags remain in staged marc
 3 - Import the record
 4 - Confirm items are nto in imported marc record
 5 - Stage the record again, but look for items
 6 - Confirm the item tags are stipped from imported record
 7 - Import and confirm imported record has no item tags
 8 - Apply patch and repeat 1-5
 9 - Confirm item tags remain in record
10 - Import and confirm item tags not in imported marc

Signed-off-by: Andrew <andrewfh@dubcolib.org>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 30684: (follow-up) Use log_warning_msg for the "not running" warning
Alex Buckley [Wed, 17 Aug 2022 13:50:01 +0000 (13:50 +0000)]
Bug 30684: (follow-up) Use log_warning_msg for the "not running" warning

Also, return 0 rather than return 1 in else clause of koha-zebra

Sponsored-by: Catalyst IT, New Zealand
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 30684: When a service isn't running koha-* scripts --restart should start it
Alex Buckley [Tue, 7 Jun 2022 05:42:20 +0000 (05:42 +0000)]
Bug 30684: When a service isn't running koha-* scripts --restart should start it

Test plan:
1. Stop plack, indexer, sip, worker, z3950 and zebra.

Note: To test Z39.50 restarting you will need to setup the server: https://wiki.koha-community.org/wiki/Setting_up_the_Z39.50_and_SRU_Server#Setting_up_the_Z39.50_and_SRU_Server

2. Run restart command for each service:
- [Plack] sudo koha-plack --restart {instance}
- [Indexer] sudo koha-indexer --restart {instance}
- [SIP] sudo koha-sip --restart {instance}
- [Worker] sudo koha-worker --restart {instance}
- [z3950] sudo koha-z3950-responder --restart {instance}
- [Zebra] sudo koha-zebra --restart {instance}

3. Observe the services do not get restarted.
Instead you get an error saying the service is not running

4. Apply patch

5. If you are using kohadevbox you must copy koha-* scripts to /usr/sbin/:
sudo cp debian/scripts/koha-plack /usr/sbin/koha-plack
sudo cp debian/scripts/koha-indexer /usr/sbin/koha-indexer
sudo cp debian/scripts/koha-sip /usr/sbin/koha-sip
sudo cp debian/scripts/koha-worker /usr/sbin/koha-worker
sudo cp debian/scripts/koha-z3950-responder /usr/sbin/koha-z3950-responder
sudo cp debian/scripts/koha-zebra /usr/sbin/koha-zebra

6. Repeat step 2

7. This time confirm that each service is restarted

Sponsored-by: Catalyst IT
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 31217: OPAC coce.js is not hiding the coce-coverimg div for single-pixel images
Alex Buckley [Tue, 26 Jul 2022 04:38:29 +0000 (16:38 +1200)]
Bug 31217: OPAC coce.js is not hiding the coce-coverimg div for single-pixel images

This is because opac-detail.tt has coce-coverimg as an ID, but OPAC
coce.js targets coce-coverimg as a class.

opac-detail.tt should be changed to have coce-coverimg as a class.

Test plan:
1. Set your system preferences:
- CoceHost = https://coce.mykoha.co.nz
- CoceProviders = Select all
- OpacCoce = Enable

2. Add the ISBN of '9780262336499' to a biblio

3. Open a "Incognito" window in your browser (recommended to use Google
Chrome to test this)

4. View the biblio detail page in the OPAC. Observe a 'Coce image from
Amazon' box loads with a spinner

5. Apply patch and restart services

6. Clear your browser cache

7. Reload the same biblio detail page in the OPAC. Observe no image is
displayed.

8. View another OPAC biblio detail page that does have a successfully
loading coce image and confirm the source of that image is listed: For
example 'Coce image from Amazon.com' is displayed

Sponsored-by: Toi Ohomai Institute of Technology, New Zealand
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 28854: (follow-up) Remove errant warning
Martin Renvoize [Thu, 18 Aug 2022 08:44:03 +0000 (09:44 +0100)]
Bug 28854: (follow-up) Remove errant warning

Oops, I left in a bare warn from debugging.. this simply removes it; it
is unrequired.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 31382: Pass password_has_expired param to templte
Nick Clemens [Wed, 17 Aug 2022 11:09:14 +0000 (11:09 +0000)]
Bug 31382: Pass password_has_expired param to templte

This patch restores the param, while still leaving the check against invalid
login credentials to ensure we don't leak information.

To test:
 1 - enable  EnableExpiredPasswordReset
 2 - Edit a patron to set password to expire in the past
 3 - Attempt opac login as patron
 4 - It fails, but you are redirected to login screen with no info
 5 - Apply patch
 6 - Attempt login
 7 - You are notified password expired and given reset link
 8 - Go back to login screen
 9 - Login with correct username,, wrong password
10 - You are notified of incorrect credentials, not password expiration

Signed-off-by: Andrew Fuerste-Henry <andrewfh@dubcolib.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 31382: Regression tests
Tomas Cohen Arazi [Wed, 17 Aug 2022 18:40:07 +0000 (15:40 -0300)]
Bug 31382: Regression tests

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 31222: Reduce query size for batchMod
Nick Clemens [Fri, 22 Jul 2022 14:47:36 +0000 (14:47 +0000)]
Bug 31222: Reduce query size for batchMod

The object search is currently:
Koha::Items->search({ barcode => \@contentlist }

Which generate code like:
barcode = 1 OR barcode = 2 OR barcode = 3 ....

This can get quite large

We can reduce the query size by using -in:
Koha::Items->search({ barcode => { -in => \@contentlist } }

Which generates code like:
barcode in ( 1, 2, 3 )

To test:
1 - Apply patch
2 - Perform batch modifications
3 - Confirm nothing has changed

Signed-off-by: Rachael Laritz <rachael.laritz@inlibro.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 29782: Fix handling records without title or content
Marcel de Rooy [Tue, 16 Aug 2022 12:02:13 +0000 (12:02 +0000)]
Bug 29782: Fix handling records without title or content

Test plan:
Save a new record with only a title in the non-default tab (english).
Check if you see it on the list. Edit.
Save a new record without title but only content in non-default lang.
Check if you see it.
Do the same 2 edits on the default tab only. Verify too.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Caroline Cyr La Rose <caroline.cyr-la-rose@inlibro.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 27342: Fix C4::ILSDI::Services::AuthenticatePatron
Tomas Cohen Arazi [Wed, 17 Aug 2022 13:33:07 +0000 (10:33 -0300)]
Bug 27342: Fix C4::ILSDI::Services::AuthenticatePatron

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 31228: Intranet coce.js is not hiding the coce-coverimg div for single-pixel...
Alex Buckley [Wed, 10 Aug 2022 15:32:24 +0000 (15:32 +0000)]
Bug 31228: Intranet coce.js is not hiding the coce-coverimg div for single-pixel image

This is because the intranet detail.tt has coce-coverimg as an ID.
Intranet results.tt has coce-coverimg as a class. Intranet coce.js
targets coce-coverimg as a class.

Intranet detail.tt should be changed to have coce-coverimg as a class.
This is inline with the change made to the OPAC in bug 31217

Test plan:
1. Set your system preferences:
- CoceHost = https://coce.mykoha.co.nz
- CoceProviders = Select all
- IntranetCoce = Enable

2. Add the ISBN of '9780262336499' to a biblio

3. Open a "Incognito" window in your browser (recommended to use Google
Chrome to test this)

4. View the biblio detail page in the intranet. Observe a 'Coce image
from Amazon' box loads with a spinner

5. Apply patch and restart services

6. Clear your browser cache

7. Reload the same biblio detail page in the intranet. Observe no image
is displayed.

8. Do an intranet search to get the biblio returned in search results
page. Confirm no cover image box is displayed

9. View the intranet search result and detail pages for a different
biblio that you know Coce should be displaying the cover image of and
confirm that it is correctly displayed with the source of that image
listed: For example 'Coce image from Amazon.com' is displayed

Sponsored-by: Catalyst IT, New Zealand
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 19540: Tell the patron why a hold cannot be placed on items
Jonathan Druart [Thu, 7 Jan 2021 12:44:33 +0000 (13:44 +0100)]
Bug 19540: Tell the patron why a hold cannot be placed on items

This patch adds an explanation when a hold cannot be placed, in some situation:
tooManyReserves
tooManyHoldsForThisRecord
tooManyReservesToday
itemAlreadyOnHold

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 26632: Remove two more occurrences
Nick Clemens [Mon, 16 May 2022 19:37:59 +0000 (19:37 +0000)]
Bug 26632: Remove two more occurrences

Signed-off-by: Andrew Fuerste-Henry <andrewfh@dubcolib.org>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 26632: (Bug 22532 follow-up) Remove random variables
Nick Clemens [Mon, 16 May 2022 19:32:03 +0000 (19:32 +0000)]
Bug 26632: (Bug 22532 follow-up) Remove random variables

AddBiblioToBatch and AddAuthToBatch were btoh passing a random number for the
parameter $update_counts

This simply removes that value as should have been done on 22532

To test:
1 - Stage a marc file
2 - Confirm it works befor and after patch

Signed-off-by: Andrew Fuerste-Henry <andrewfh@dubcolib.org>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 23202: Fix screen freeze when ordereing several items
Johanna Raisa [Tue, 26 Jul 2022 09:01:56 +0000 (12:01 +0300)]
Bug 23202: Fix screen freeze when ordereing several items

This patch fixes adding multiple items on order acquisitions

The error is: Uncaught TypeError: $(...).parent(...).attr(...) is undefined

Test plan:
1) Set dateaccessioned.pl plugin to ACQ framework's 952$d field.
2) Create basket to a vendor and add order from a new empty record.
3) Add date acquired value from calendar.
4) Add multiple items and see that the view freezes.
5) Apply the patch
6) Reload the page and repeat the steps 3 and 4.
7) See that the items are added.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
JD Amended patch: adjust commit title
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 31313: Fix holds_count and priority
Jonathan Druart [Wed, 17 Aug 2022 08:16:26 +0000 (10:16 +0200)]
Bug 31313: Fix holds_count and priority

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 15326: (follow-up) Fix staff permissions and consider library limits
Aleisha Amohia [Mon, 15 Aug 2022 05:31:57 +0000 (17:31 +1200)]
Bug 15326: (follow-up) Fix staff permissions and consider library limits

To test:
1. Take note of what your logged in library is
2. Add a new page that can be viewed on the OPAC and staff interface.
Limit the library to a different library, not your logged in library
3. Use a News item to create a hyperlink to your new page on the OPAC
and staff interface.
4. Confirm that a page error shows if you try to view the new page.
5. Edit the new page and set the library to All libraries.
6. Try to go to the new page again and confirm it shows.
7. Log out and log back into the staff interface as a staff user that
isn't a superlibrarian
8. Confirm you can view the new page as this user

Sponsored-by: Horowhenua Libraries Trust
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 15326: (follow-up) Hide RSS feed if no news items
Aleisha Amohia [Tue, 2 Aug 2022 00:40:04 +0000 (12:40 +1200)]
Bug 15326: (follow-up) Hide RSS feed if no news items

If there are pages but no news items showing on the OPAC, the RSS feed container
should not show.

Sponsored-by: Horowhenua Libraries Trust
Signed-off-by: Lisette Scheer <lisettePalouse+Koha@gmail.com>
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 15326: Using AdditionalContents for custom pages on OPAC
Aleisha Amohia [Fri, 17 Dec 2021 02:06:51 +0000 (02:06 +0000)]
Bug 15326: Using AdditionalContents for custom pages on OPAC

This page utilises the Additional Contents feature to add custom pages
to the staff client and the OPAC in the user's desired language.

To test:
1. Apply patch and restart services
2. In the staff client, go to Tools, then go to the new 'Pages' page
3. Add a new page to display on both the staff client and OPAC.
4. Confirm the URLs in the Page URL column work as expected.
5. Confirm that any pages made for the staff client only do not show in
the OPAC, and that any pages made for the OPAC only do not show in the
staff client.
6. Confirm that pages do not show on the OPAC main page where news items
show. Confirm news items show on the OPAC main page as expected.

Sponsored-by: Chartered Accountants Australia and New Zealand
Signed-off-by: Thibault Kero <thibault.keromnes@univ-paris8.fr>
Signed-off-by: Lisette Scheer <lisettePalouse+Koha@gmail.com>
Signed-off-by: Lisette Scheer <lisettePalouse+Koha@gmail.com>
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 31294: Show "Required" label on mandatory fields
David Cook [Thu, 11 Aug 2022 05:40:45 +0000 (05:40 +0000)]
Bug 31294: Show "Required" label on mandatory fields

This patch adds "Required" label on mandatory fields for Article Requests

0. Apply the patch
1. koha-plack --restart kohadev
2. Change syspref 'ArticleRequests' to 'Enable'
3. Change syspref 'ArticleRequestsMandatoryFields' to '[Select all]'
4. Go to http://localhost:8080/cgi-bin/koha/opac-search.pl?idx=&q=test&weight_search=1
5. Click "Request article" for "Gairm"
6. Note that "Title", "Author", "Volume", "Issue", "Date", "Pages", and
   "Chapters" all say required
7. Change syspref 'ArticleRequestsMandatoryFields' to 'Title' and
   'Author'
8. Go to http://localhost:8080/cgi-bin/koha/opac-request-article.pl?biblionumber=29
9. Note that only "Title" and "Author" say required

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 27342: (QA follow-up) Fix test
Tomas Cohen Arazi [Tue, 16 Aug 2022 13:50:47 +0000 (10:50 -0300)]
Bug 27342: (QA follow-up) Fix test

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 27342: (QA follow-up) Remove dbh from new tests
Martin Renvoize [Wed, 10 Aug 2022 07:12:53 +0000 (08:12 +0100)]
Bug 27342: (QA follow-up) Remove dbh from new tests

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 27342: Remove dbh from C4::Auth
Jonathan Druart [Tue, 5 Jan 2021 10:28:16 +0000 (11:28 +0100)]
Bug 27342: Remove dbh from C4::Auth

We must not pass $dbh but retrieve it when needed instead

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 27342: Improve test for OPAC
Jonathan Druart [Tue, 5 Jan 2021 10:18:26 +0000 (11:18 +0100)]
Bug 27342: Improve test for OPAC

We don't need to build allowed_scripts_for_private_opac for staff

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 30901: Add Unit Tests
Kyle Hall [Wed, 29 Jun 2022 19:01:38 +0000 (15:01 -0400)]
Bug 30901: Add Unit Tests

Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 30901: Add POD for Koha::Template::Plugin::CirculationRules
Kyle M Hall [Fri, 3 Jun 2022 17:34:53 +0000 (13:34 -0400)]
Bug 30901: Add POD for Koha::Template::Plugin::CirculationRules

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 30901: Add Renewals method to CirculationRules template plugin
Kyle M Hall [Fri, 3 Jun 2022 17:14:06 +0000 (13:14 -0400)]
Bug 30901: Add Renewals method to CirculationRules template plugin

It would be useful to be able to report renewals used/remaining in some notices and slips.

Test Plan:
1) Apply this patch
2) Add the following to the RENEWAL notices:
--
[% USE CirculationRules %]
[% SET renewals = CirculationRules.Renewals( borrower.id, item.id ) %]
You have used [% renewals.count %] of [% renewals.allowed %], you have [% renewals.remaining %] renewals left.
--
3) Trigger a renewal notice
4) Verify the text is correct!

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 31312: Remove GetItemsInfo from misc/migration_tools/rebuild_zebra.pl
Jonathan Druart [Thu, 2 Jun 2022 09:38:02 +0000 (11:38 +0200)]
Bug 31312: Remove GetItemsInfo from misc/migration_tools/rebuild_zebra.pl

Hum... Item2Marc ok here?

Bug 27272 is going to remove C4::Items::GetItemsInfo in favour of Koha::Items->search.

Here we are going to deal with misc/migration_tools/rebuild_zebra.pl

Test plan:
I am not sure, what do we want to test here? Items' info indexed
correctly?

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 30922: Make the "Relative's checkouts" table configurable by the table settings
Shi Yao Wang [Wed, 6 Jul 2022 14:47:03 +0000 (10:47 -0400)]
Bug 30922: Make the "Relative's checkouts" table configurable by the table settings

Adds "relatives-issues-table" in table settings.

Test plan:
1- Apply the patch
2- Check out an item to a patron with a guarantor
3- Go to the guarantor's "details" and "check out" page > relatives'
checkouts and look at the different columns (you should see collection
and location)
4- Go to
    admin > table settings > patron > moremember > relatives-issues-table
 or
    admin > table settings > circulation > circulation >
relatives-issues-table
to hide some columns (e.g. collection and location) and click save
5- Do step 3 again and notice some columns (e.g. collection and location) are hidden
6- Also notice the "Columns" and "Export" buttons that should work as
intended

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 29673: Allow English sql localization script
Marcel de Rooy [Thu, 9 Dec 2021 15:07:18 +0000 (16:07 +0100)]
Bug 29673: Allow English sql localization script

Test plan:
You might want to add a simple SQL statement to your English
custom.sql in order to verify the execution.
Run a Koha install (in English).
Check if the data shows your custom sql action.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 29723: (QA follow-up) _ vs __
Tomas Cohen Arazi [Tue, 16 Aug 2022 13:19:56 +0000 (10:19 -0300)]
Bug 29723: (QA follow-up) _ vs __

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 29723: (QA follow-up) Ensure ID's match Module names
Martin Renvoize [Wed, 10 Aug 2022 13:52:53 +0000 (14:52 +0100)]
Bug 29723: (QA follow-up) Ensure ID's match Module names

There was a disparity between module codes and how it was used to
construct ID's for various elements.. this patch updates ID's to match
codes for circulation and illrequests.

Signed-off-by: Andrew <andrewfh@dubcolib.org>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 29723: (QA follow-up) Correct scroll to table
Martin Renvoize [Wed, 10 Aug 2022 11:14:35 +0000 (12:14 +0100)]
Bug 29723: (QA follow-up) Correct scroll to table

This patch enabled scrolling directly to the correct table configuration when clicking the 'Configure this table'
button from any KohaTable/kohaTable table in Koha.

Test plan
1. Navigate to Administration > Cities
2. Click 'Configure this table'
3. Confirm the result is the table settings page and you are scrolled to
   the cities table configuration

Signed-off-by: Andrew <andrewfh@dubcolib.org>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 29723: (QA follow-up) Switch to using ID's on column settings
Martin Renvoize [Wed, 10 Aug 2022 10:27:18 +0000 (11:27 +0100)]
Bug 29723: (QA follow-up) Switch to using ID's on column settings

This patch updates the column settings page to use ID's instead of
Indexes to restor the open accordian card after a setting change.

Test plan
1 Go to Administration -> Table settings.
2 All panels should be collapsed.
3 Test expanding and collapsing panels to confirm it's working
  correctly.
4 Make a change to one of the table configurations. After clicking
  "Save" the page should reload with the same panel expanded.

Signed-off-by: Andrew <andrewfh@dubcolib.org>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 29723: (QA follow-up) Make button text translatable
Martin Renvoize [Wed, 10 Aug 2022 07:36:18 +0000 (08:36 +0100)]
Bug 29723: (QA follow-up) Make button text translatable

This patch makes the button text translatable. Whilst we're here I also added a wrench icon,
set the title attribute and added a class.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Andrew <andrewfh@dubcolib.org>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 29723: Add a "Configure table" button for KohaTable tables
Jonathan Druart [Fri, 17 Dec 2021 09:19:35 +0000 (10:19 +0100)]
Bug 29723: Add a "Configure table" button for KohaTable tables

This patch suggests to have a "Configure table" button when a table can
be configured in the "Table settings" administraition area.

Test plan:
Go to different views where the table can be configured (you an
exhaustive list on bug 29648), notice the "Configure table" button (if
you have the 'manage_column_config' subpermission.

Note that the link is correct but the scrollbar is not adjusted at the
correct position. Maybe we could improve that switching to the bootstrap
accordion plugin?

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Andrew <andrewfh@dubcolib.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 31313: Unit tests
Tomas Cohen Arazi [Tue, 16 Aug 2022 13:10:03 +0000 (10:10 -0300)]
Bug 31313: Unit tests

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 31318: Remove GetItemsInfo from serials/routing-preview
Jonathan Druart [Fri, 3 Jun 2022 06:26:41 +0000 (08:26 +0200)]
Bug 31318: Remove GetItemsInfo from serials/routing-preview

Bug 27272 is going to remove C4::Items::GetItemsInfo in favour of Koha::Items->search_ordered.

Here we are going to deal with serials/routing-preview

Test plan:
List items on the modified view and confirm that all the info is
displayed correctly

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 31314: (QA follow-up) Prefetch and make routines use result objects
Nick Clemens [Fri, 12 Aug 2022 15:33:45 +0000 (15:33 +0000)]
Bug 31314: (QA follow-up) Prefetch and make routines use result objects

This reduces lookups for the related items that we now fetch in the templates

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 31314: (QA follow-up) Search Koha::Items not $biblio->items
Nick Clemens [Fri, 12 Aug 2022 15:04:30 +0000 (15:04 +0000)]
Bug 31314: (QA follow-up) Search Koha::Items not $biblio->items

To get the host items we need to search all items, not those limited to the
same biblionumber

To test:
1 - Enable EasyAnalytics
2 - Attach an item to a record
3 - Confirm it is listed in the items list on opac reserve

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 31314: Remove GetHostItemsInfo and GetItemsInfo from opac-reserve
Jonathan Druart [Fri, 3 Jun 2022 05:44:46 +0000 (07:44 +0200)]
Bug 31314: Remove GetHostItemsInfo and GetItemsInfo from opac-reserve

Bug 27272 is going to remove C4::Items::GetItemsInfo in favour of Koha::Items->search_ordered.

Here we are going to deal with opac-reserve

Test plan:
List items on the modified view and confirm that all the info is
displayed correctly

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 31313: (QA follow-up) Prefetch checkouts and branches
Nick Clemens [Mon, 15 Aug 2022 11:34:59 +0000 (11:34 +0000)]
Bug 31313: (QA follow-up) Prefetch checkouts and branches

This prefetches objects we are using in templates to avoid extar DB calls

The branch fetches won't actually be used without the extra patch on 31314 that
adapts home_branch and holding_branch routines to use result objects

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 31313: (QA follow-up) Search Koha::Items
Nick Clemens [Mon, 15 Aug 2022 11:32:03 +0000 (11:32 +0000)]
Bug 31313: (QA follow-up) Search Koha::Items

This ensures host items from otehr biblios are returned as well

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 31313: Fix availability - OPAC opac-detail
Jonathan Druart [Mon, 1 Aug 2022 06:59:53 +0000 (08:59 +0200)]
Bug 31313: Fix availability - OPAC opac-detail

Has to move some code to a method

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 31313: Remove GetItemsInfo from opac-detail
Jonathan Druart [Fri, 3 Jun 2022 04:50:44 +0000 (06:50 +0200)]
Bug 31313: Remove GetItemsInfo from opac-detail

Bug 27272 is going to remove C4::Items::GetItemsInfo in favour of Koha::Items->search_ordered.

Here we are going to deal with opac-detail

Test plan:
List items on the modified view and confirm that all the info is
displayed correctly

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 31320: Remove GetItemsInfo from virtualshelves/sendshelf.pl
Jonathan Druart [Fri, 3 Jun 2022 06:33:00 +0000 (08:33 +0200)]
Bug 31320: Remove GetItemsInfo from virtualshelves/sendshelf.pl

And GetItemsLocationInfo from shelves.pl

Bug 27272 is going to remove C4::Items::GetItemsInfo in favour of Koha::Items->search_ordered.

Here we are going to deal with virtualshelves/sendshelf.pl

Test plan:
List items on the modified view and confirm that all the info is
displayed correctly

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 31317: Remove GetItemsInfo import from opac-tags
Jonathan Druart [Fri, 3 Jun 2022 06:23:55 +0000 (08:23 +0200)]
Bug 31317: Remove GetItemsInfo import from opac-tags

Bug 27272 is going to remove C4::Items::GetItemsInfo in favour of Koha::Items->search_ordered.

Here we are going to deal with opac-tags

Test plan:
List items on the modified view and confirm that all the info is
displayed correctly

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 31310: Remove GetItemsInfo from catalogue/imageviewer
Jonathan Druart [Thu, 2 Jun 2022 09:34:46 +0000 (11:34 +0200)]
Bug 31310: Remove GetItemsInfo from catalogue/imageviewer

Bug 27272 is going to remove C4::Items::GetItemsInfo in favour of Koha::Items->search_ordered.

Here we are going to deal with catalogue/imageviewer

Test plan:
List items on the modified view and confirm that all the info is
displayed correctly

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 31309: Remove GetItemsInfo from basket/sendbasket
Jonathan Druart [Thu, 2 Jun 2022 09:33:40 +0000 (11:33 +0200)]
Bug 31309: Remove GetItemsInfo from basket/sendbasket

Why are we display with $raw?
Why are we display the location code instead of the AV's lib?

Bug 27272 is going to remove C4::Items::GetItemsInfo in favour of Koha::Items->search_ordered.

Here we are going to deal with basket/sendbasket

Test plan:
List items on the modified view and confirm that all the info is
displayed correctly

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 31328: Call get_transfers from get_transfer
Jonathan Druart [Wed, 10 Aug 2022 13:33:13 +0000 (15:33 +0200)]
Bug 31328: Call get_transfers from get_transfer

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 31328: Make Koha::Item->get_transfer* use Koha::Item::Transfers->filter_by_current
Tomas Cohen Arazi [Tue, 9 Aug 2022 11:40:45 +0000 (08:40 -0300)]
Bug 31328: Make Koha::Item->get_transfer* use Koha::Item::Transfers->filter_by_current

This patch makes the get_transfer and get_transfers methods internally
use the new ->filter_by_current method.

To test:
1. Run:
   $ kshell
  k$ prove t/db_dependent/Koha/Item.t
=> SUCCESS: Tests pass!
2. Apply this rewriting patch
3. Repeat 1
=> SUCCESS: Tests still pass!
4. Sign off :-D

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 31302: Fix spelling in sample_notices.yml
Alex Buckley [Tue, 9 Aug 2022 07:26:07 +0000 (07:26 +0000)]
Bug 31302: Fix spelling in sample_notices.yml

Test plan:
1. Apply patch
2. Confirm 'URL(s)', rather than urls(s), is in the line:
You can download the scanned materials via the following URL(s)

Sponsored-by: Catalyst IT, New Zealand
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 31308: (QA follow-up) use count to see if no items present
Nick Clemens [Wed, 10 Aug 2022 11:53:13 +0000 (11:53 +0000)]
Bug 31308: (QA follow-up) use count to see if no items present

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 31308: Remove GetItemsInfo from basket/basket
Jonathan Druart [Thu, 2 Jun 2022 09:31:38 +0000 (11:31 +0200)]
Bug 31308: Remove GetItemsInfo from basket/basket

Bug 27272 is going to remove C4::Items::GetItemsInfo in favour of
Koha::Items->search_ordered.

Here we are going to deal with basket/basket.pl

Test plan:
List items on the modified view and confirm that all the info is
displayed correctly

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 31158: (bug 23991 follow-up) Fix suggestion search by dates
Jonathan Druart [Mon, 1 Aug 2022 06:14:27 +0000 (08:14 +0200)]
Bug 31158: (bug 23991 follow-up) Fix suggestion search by dates

Search suggestions by date is broken, we don't remove the '_from' CGI
params for the DBIC query
DBIx::Class::Storage::DBI::_dbh_execute(): DBI Exception: DBD::mysql::st execute failed: Unknown column 'suggesteddate_from' in 'where clause' at /kohadevbox/koha/Koha/Objects.pm line 394
 at /usr/share/perl5/DBIx/Class/Exception.pm line 77

Test plan:
Create some suggestions, search for them using date range (suggested
date, managed date and accepted date)

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 31276: Report results are limited to 999,999 no matter the actual number of results
Kyle Hall [Mon, 1 Aug 2022 14:47:04 +0000 (10:47 -0400)]
Bug 31276: Report results are limited to 999,999 no matter the actual number of results

In Koha, any report that uses C4::Reports::Guided will be limited to 999,999 rows. This is causing problems for larger libraries where some reports may have over a million results.

Test Plan:
1) Create a report "SELECT * FROM borrowers" and run it, note the number
   of results
2) Apply this patch
3) Add the line `<report_results_limit>3</report_results_limit>`
   within the <config> block of your koha-conf.xml
4) Restart all the things!
5) Run the report, download the results as a CSV
6) Note your CSV only has 4 lines, the header and 3 patrons

Signed-off-by: Rachael Laritz <rachael.laritz@inlibro.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 31325: Fix koha-preferences get
Magnus Enger [Tue, 9 Aug 2022 06:49:54 +0000 (06:49 +0000)]
Bug 31325: Fix koha-preferences get

To reproduce:
$ perl koha/misc/admin/koha-preferences get MarcFlavour
This will output something like "HASH(0x55dd4d432840)".

To test:
Apply this patch and run the command again:
$ perl koha/misc/admin/koha-preferences get MarcFlavour
This should output something like "MARC21".

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 31281: Use correct reply-to email when sending overdue mails
Katrin Fischer [Sun, 7 Aug 2022 16:14:37 +0000 (16:14 +0000)]
Bug 31281: Use correct reply-to email when sending overdue mails

Overdue emails are either sent from the issuing or the home
library of an item. We never use the patron's home library,
so the reply-to address must explicitly be set in EnqueueLetter.

To test:
- Set up 2 branches (A and B) with different email addresses.
- Set up an SMTP server for each to use
- Set up an overdue notice trigger for the patron category you'll use
  First letter: 1 day delay, any notice
- Check out an item with home branch B to a patron from A
- Run the the script with:
  overdue_notices.pl -t --frombranch item-homebranch
  overdue_notices.pl -t --frombranch item-issuebranch
- Confirm for each setting that the correct email headers have been
  used. You can see the reply-to address and to-address in the
  message queue:
  SELECT * FROM message_queue;

Signed-off-by: Nason Bimbe <nason.bimbe@ptfs-europe.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 31346: Fix broken Syndetics links on OPAC detail page
Lucas Gass [Thu, 11 Aug 2022 22:56:49 +0000 (22:56 +0000)]
Bug 31346: Fix broken Syndetics links on OPAC detail page

To test:
-Have some Syndetics credentials
-Turn on SyndeticsCoverImages
-Look at some and you'll notice that Syndetics cover images dont always load
-If you view the page source you'll see why. The links are built like this:
https://secure.syndetics.com/index.aspx?isbn=/LC.GIF&amp;amp;client=bedf&amp;type=xw10&amp;upc=843501038123&amp;oclc=1311289389

-Apply patch
-Cover images should load properly.

Signed-off-by: Barbara Johnson <barbara.johnson@bedfordtx.gov>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 31331: Add data-order attribute for better sorting of dates
Lucas Gass [Tue, 9 Aug 2022 14:31:05 +0000 (14:31 +0000)]
Bug 31331: Add data-order attribute for better sorting of dates

To test:
1. I used the following suggestiondates:

MariaDB [koha_kohadev]> select suggesteddate from suggestions;
+---------------+
| suggesteddate |
+---------------+
| 2022-01-03    |
| 2022-08-09    |
| 2022-02-22    |
| 2021-01-21    |
+---------------+

2. Set the dateformat system preference to 'mm/dd/yyyy'.
3. Try sorting the suggestion table by date, ascending and descending,
   it is not right.
4. Apply patch
5. Try sorting by date again, ascending and descending, it should now
   sort correctly.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 31245: Do not try to report results if task not started
Tomas Cohen Arazi [Tue, 26 Jul 2022 13:12:05 +0000 (10:12 -0300)]
Bug 31245: Do not try to report results if task not started

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Andrew <andrewfh@dubcolib.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 31245: Do not call report for job detail view if job not started
Jonathan Druart [Wed, 27 Jul 2022 08:35:08 +0000 (10:35 +0200)]
Bug 31245: Do not call report for job detail view if job not started

We should not generate the report if the job hasn't started yet

Test plan:
Stop the koha-worker processes, modify a new item using the batch mod
tool, then see the detail page of the job

Without this patch an error is generated:
Can't use an undefined value as an ARRAY reference at /kohadevbox/koha/Koha/BackgroundJob/BatchUpdateItem.pm line 175

Signed-off-by: Andrew <andrewfh@dubcolib.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 24857: No words
Tomas Cohen Arazi [Tue, 9 Aug 2022 17:00:40 +0000 (14:00 -0300)]
Bug 24857: No words

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 24857: (QA follow-up) Add spec description
Tomas Cohen Arazi [Tue, 9 Aug 2022 16:56:05 +0000 (13:56 -0300)]
Bug 24857: (QA follow-up) Add spec description

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 28787: (QA follow-up) Add spec description
Tomas Cohen Arazi [Tue, 9 Aug 2022 16:48:52 +0000 (13:48 -0300)]
Bug 28787: (QA follow-up) Add spec description

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 28787: DBRev 22.06.00.035
Tomas Cohen Arazi [Tue, 9 Aug 2022 16:42:21 +0000 (13:42 -0300)]
Bug 28787: DBRev 22.06.00.035

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 28787: (QA follow-up) Remove unused variable
Kyle M Hall [Fri, 5 Aug 2022 12:31:26 +0000 (12:31 +0000)]
Bug 28787: (QA follow-up) Remove unused variable

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>