]> git.koha-community.org Git - koha.git/log
koha.git
3 years agoBug 28765: Remove sub find_value from batchMod.pl
Jonathan Druart [Mon, 26 Jul 2021 16:31:43 +0000 (18:31 +0200)]
Bug 28765: Remove sub find_value from batchMod.pl

It has never been used and should be removed

Test plan:
Search for "find_value" in the file and confirm that there is no more
occurrence

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 24387: DBRev 21.06.00.016
Jonathan Druart [Mon, 16 Aug 2021 09:01:28 +0000 (09:01 +0000)]
Bug 24387: DBRev 21.06.00.016

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 24387: Fix sample_news.yml installer file
Jonathan Druart [Wed, 11 Aug 2021 14:50:18 +0000 (16:50 +0200)]
Bug 24387: Fix sample_news.yml installer file

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 24387: Remove sample_news.for other languages
Jonathan Druart [Wed, 11 Aug 2021 14:49:59 +0000 (16:49 +0200)]
Bug 24387: Remove sample_news.for other languages

We shouldn't continue to update those files as we are going to remove
them soon.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 24387: (QA follow-up) Fix method import issues
Tomas Cohen Arazi [Tue, 10 Aug 2021 23:54:08 +0000 (20:54 -0300)]
Bug 24387: (QA follow-up) Fix method import issues

Raised by the QA script, a couple issues carried by pre-17600 patches.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 24387: (QA follow-up) Add missing filters
Tomas Cohen Arazi [Tue, 10 Aug 2021 18:52:40 +0000 (15:52 -0300)]
Bug 24387: (QA follow-up) Add missing filters

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 24387: DBIC schema changes
Jonathan Druart [Fri, 16 Jul 2021 07:13:34 +0000 (09:13 +0200)]
Bug 24387: DBIC schema changes

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 24387: Fix location options when editing HTML custom
Jonathan Druart [Fri, 9 Jul 2021 13:26:24 +0000 (15:26 +0200)]
Bug 24387: Fix location options when editing HTML custom

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 24387: Rename "News" with "Additional contents"
Jonathan Druart [Tue, 6 Jul 2021 15:28:19 +0000 (17:28 +0200)]
Bug 24387: Rename "News" with "Additional contents"

One big patch for one big move.

The "News" feature (opac_news) has been hijacked to handle some system
preferences (bug 26050). The goal was to take profit of the UI (editor)
and the ability to translate the value.

Disclaimer: This patch is NOT offering the best implementation but, as
we still don't have bug 24975, it cannot be done now. And no, we don't
want to wait for it to move forward here. This patch is going into the
right direction anyway.

This enhancement is going to rename the "News" with a more genertic
"Additional contents". We have two different "categories" of content:
"news" and "html customizations".

What does it bring?
- A split on the UI for disambigate the two types of content (news and
syspref/html customizations)
- A simplification of the edit form: all languages will be translatable
on the same view (like the "notice templates")
- Ground will be prepared for different types of content (if needed later)
- Staff news can be translated

How was the "News" area working before this patch?
The opac_news DB table contained a (very inconsistent) 'lang' column.
The different values were:
- '' => news to display at the OPAC and staff interfaces
- 'koha' => news for staff only
- 'slip' => news for slip notices
- $lang => news for OPAC only, translated in $lang ('en', 'es-ES', etc.)
- "$location_$lang" => A syspref moved to this "news" area. The syspref
is $location, and is translated in $lang. Eg. OpacLoginInstructions_en,
OpacLoginInstructions_fr-FR, opacheader_es-ES

This patch is improving the DB structure with the following changes:
- renaming 'opac_news' with 'additional_contents'
- new 'category' column
 => 'news' or 'html_customizations'
- new 'location' column
 => For 'news': 'staff_and_opac', 'staff_only', 'slip'
 => For 'html_customizations': the old syspref name (eg. 'OpacLoginInstructions').
- new 'code' column (see later for more info)
- the 'lang' column will only contain the language code ('en', 'es-ES',
etc.). BUT a 'default' entry will ALWAYS exist for fallback behaviour.

We are getting closer to the 'notice template' table structure because
we want to match its UI. The 'code' column will bring us the ability to
group the different 'additional_contents' rows. The code for a given
news will be the same, but the (lang, title, content) will differ.
Examples:
  News 1 will have, for each of the translated versions
  (category, code,    location, branchcode)
  ('news',   'News1', $location, $branchcode||undef)
  And the 3 following columns will differ:
  (title,              content,               lang)
  ('title for news 1', 'content for news 1', 'default')
  ('titulo para 1',    'contenido para 1',   'es-ES')

Note that the "category" is not strictely necessary, but it seems better
to have the ability to split the different content by category/type
easily.

Additional changes:
- Syspref 'NewsToolEditor' is renamed 'AdditionalContentsEditor'
- Koha::NewItem => Koha::AdditionalContent
- Koha::News => Koha::AdditionalContents
- Script and template renamed from koha-news to additional-contents
- Foreign keys have been renamed
- Subpermission edit_news has been renamed edit_additional_contents
- The UI can now be accessed via a "News" or "HTML customizations" link
from the tools module. The related contents will then be displayed (both
categories are now split)

Changes not done here:
- Primary key 'idnew' could be renamed 'id'

Limitations of the upgrade:
News cannot be grouped by a unique code for existing translations.
=> A given news will be now displayed several times on the translated
interface
Any ideas to improve the upgrade behaviour?
We will have to add a warning in the release notes to tell libraries to
review their news.

Test plan:
0. Don't apply the patches
1. Translate the interfaces in some languages
. Create some news for staff and OPAC
. Create some content for different entry of HTML customizations
Note that you are forced to define a 'default'.
Also note that you are only forced to fill the title (not the content).
This is certainly problematic (see FIXME in the code) as sometime only
the content is displayed.
. Play with the interface (edit, delete, filter)
. Go to the different places the news are displayed, and confirm they
are displayed correctly (staff home, opac home, opac rss)
. Create 1+ news for 'slip', check an item out and 'print slip' (from
the circulation page). You must see the news.
. Go to the different places you are expecting the HTML customizations
to be present and confirm that you see them.
. Switch the lang of the interface and confirm that you now see the
content in the translated version
. Generate the templates in another language, don't translate the
content
. Use this language for the interface and confirm that the 'default'
version is displauyed.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 12561: DBRev 21.06.00.015
Jonathan Druart [Mon, 16 Aug 2021 09:01:27 +0000 (09:01 +0000)]
Bug 12561: DBRev 21.06.00.015

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 12561: Add warning on about page
Jonathan Druart [Fri, 18 Jun 2021 14:13:17 +0000 (16:13 +0200)]
Bug 12561: Add warning on about page

If a default xslt file has been removed or if the one filled in one of
the syspref does not exist.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 12561: Change prototype of XSLTParse4Display
Jonathan Druart [Fri, 18 Jun 2021 14:05:34 +0000 (16:05 +0200)]
Bug 12561: Change prototype of XSLTParse4Display

Use a hash for better readability and reusability.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 12561: Remove non-XSLT views
Jonathan Druart [Fri, 18 Jun 2021 13:27:40 +0000 (15:27 +0200)]
Bug 12561: Remove non-XSLT views

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 12561: Remove HighlightOwnItemsOnOPAC and HighlightOwnItemsOnOPACWhich
Jonathan Druart [Fri, 18 Jun 2021 12:55:25 +0000 (14:55 +0200)]
Bug 12561: Remove HighlightOwnItemsOnOPAC and HighlightOwnItemsOnOPACWhich

This is the only remaining non-XSLT only feature. We should remove the
non-XSLT views that have been deprecated for a while now, and remove
this feature.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 28393: Elasticsearch - Add 050a to lc-call-number index mapping (MARC21)
Caroline Cyr La Rose [Wed, 19 May 2021 16:10:25 +0000 (12:10 -0400)]
Bug 28393: Elasticsearch - Add 050a to lc-call-number index mapping (MARC21)

This patch adds 050 $a to the mapping for the lc-call-number index.

To test:
1) Apply patch
2) Reindex using rebuild_elasticsearch.pl -r

If you don't have access to a terminal (in a sandbox for example)
2a) Go to Administration > Search engine configuration, click "Reset mappings"
and confirm
2b) Then reindex

I'm not sure how to search specifically for an LC call number.
You can confirm that 050 $a is displayed in the Search engine configuration page.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 28381: Elasticsearch - Add 710 and 711 to default mappings for author index ...
Caroline Cyr La Rose [Tue, 18 May 2021 21:12:34 +0000 (17:12 -0400)]
Bug 28381: Elasticsearch - Add 710 and 711 to default mappings for author index (MARC21)

This patch adds fields 710$a and 711$a to the default author mappings for elasticsearch indexing.

To test:
1) Apply patch
2) Reindex using rebuild_elasticsearch.pl -r

If you don't have access to a terminal (in a sandbox for example)
2a) Go to Administration > Search engine configuration, click "Reset mappings"
and confirm
2b) Then reindex

3) Search for an author name found only in 710 using the Author index
in advanced search
4) Repeat search for an author name in 711

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 28380: Elasticsearch - correct 024aa in mappings (MARC21)
Caroline Cyr La Rose [Tue, 18 May 2021 20:40:50 +0000 (16:40 -0400)]
Bug 28380: Elasticsearch - correct 024aa in mappings (MARC21)

This patch corrects a typo in the mappings.yaml file

To test:
1) Apply patch
2) Reindex using rebuild_elasticsearch.pl -r

If you don't have access to a terminal (in a sandbox for example)
2a) Go to Administration > Search engine configuration, click "Reset mappings"
and confirm
2b) Then reindex

3) Search for a standard number found in 024$a using the Standard number index
in the advanced search

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 28379: Elasticsearch - Add 710 to author-name-corporate index (MARC21)
Caroline Cyr La Rose [Tue, 18 May 2021 20:13:17 +0000 (16:13 -0400)]
Bug 28379: Elasticsearch - Add 710 to author-name-corporate index (MARC21)

This patch adds 710 to the default author-name-corporate index mappings for
elasticsearch.

To test:
1) Apply patch
2) Reindex using rebuild_elasticsearch.pl -r

If you don't have access to a terminal (in a sandbox for example)
2a) Go to Administration > Search engine configuration, click "Reset mappings"
and confirm
2b) Then reindex

3) Search for an author name found only in 710 using the Author (Corporate name) index
in advanced search

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 28378: Elasticsearch - Add 264c to default copydate mappings (MARC21)
Caroline Cyr La Rose [Tue, 18 May 2021 20:04:41 +0000 (16:04 -0400)]
Bug 28378: Elasticsearch - Add 264c to default copydate mappings (MARC21)

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 28339: Elasticsearch - Add 8XX to default title-series index mappings (MARC21)
Caroline Cyr La Rose [Tue, 18 May 2021 19:50:34 +0000 (15:50 -0400)]
Bug 28339: Elasticsearch - Add 8XX to default title-series index mappings (MARC21)

This patch adds series added entries titles (800 $t, 810 $t, 811 $t, and 830 $a) in the
default title-series index mappings.

To test:

1) Apply patch
2) Reindex using rebuildelasticsearch.pl -r

If you don't have access to a terminal (in a sandbox for example)
2a) Go to Administration > Search engine configuration and click "Reset mappings" and confirm
2b) Then reindex

3) Search for a series title found only in and added entry field

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 28719: Change somes links in the serials page to avoid them leading to nothing
Alexis Ripetti [Fri, 16 Jul 2021 15:43:44 +0000 (11:43 -0400)]
Bug 28719: Change somes links in the serials page to avoid them leading to nothing

To test:
1- Search for a serial
2- Pick one
3- Go to 'Serial collection' on the left
4- An issue should be selected if you're expected a new issue
5- delete it using 'Delete selected issues'
6- Confirm deletion
7- If you're supposed to receive more issues the next one should now be there
8- Now edit the serial ('Edit serials')
9- See that the link leads to nothing
10- Apply patch and redo steps 1 to 8
11- See that the link now leads to something

Signed-off-by: kelly <kelly@bywatersolutions.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 28842: A summary to the /items/:item_id/pickup_locations route
Tomas Cohen Arazi [Wed, 11 Aug 2021 12:03:58 +0000 (09:03 -0300)]
Bug 28842: A summary to the /items/:item_id/pickup_locations route

This patch simply adds a summary to the route. This will be picked by
the API docs.

It also removes the 'pickup_locations' tag, as we did in bug 28461.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 28848: Make sure the 'swagger' attribute is a string
Tomas Cohen Arazi [Thu, 12 Aug 2021 14:15:22 +0000 (11:15 -0300)]
Bug 28848: Make sure the 'swagger' attribute is a string

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 26852: Fix Heading.t
Jonathan Druart [Wed, 11 Aug 2021 15:01:51 +0000 (17:01 +0200)]
Bug 26852: Fix Heading.t

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 26852: subfield $e missing in X11 definition of MARC21 headings
Janusz Kaczmarek [Sun, 21 Dec 2014 08:31:47 +0000 (09:31 +0100)]
Bug 26852: subfield $e missing in X11 definition of MARC21 headings

This patch adds $e to 111 and 611, but removes it from 100 and 110 as it's
used for the relator term there and should not be copied. Same for 111$j.

Test plan:

1. Have a biblio record with, for example, 711 field with a $e subfield.
2. Have two auth records: one with 111 field reflecting the 711 field and second similar but without $e subfield
3. Have LinkerModule set to Default
4. Run link_bibs_to_authorities.pl
5. 711 should remain unlinked since there were two record found by the Default Linker and no one was chosen.

6. Apply the patch.
7. Run link_bibs_to_authorities.pl
8. 711 should be linked now.

Repeat testing in similar fashion for authorities:

9. 100/110 $e
10. 111 $j

NB zebra index definition is OK:
kohaidx:index_match_heading tag="111" subfields="acdefghjklnpqstvxyz" subdivisions="vxyz">
in etc/zebradb/marc_defs/marc21/authorities/authority-koha-indexdefs.xml

Signed-off-by: Sara Brown <sbrown@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 28834: Correct wording biblios/authorities in tools home
Fridolin Somers [Mon, 9 Aug 2021 20:07:53 +0000 (10:07 -1000)]
Bug 28834: Correct wording biblios/authorities in tools home

In tools home, we actually see 2 wordings : biblios/bibliographic authorities/authority
Looks like bibliographic is more correct.

Test plan :
1) Apply patch and look at words in tools home /cgi-bin/koha/tools/tools-home.pl

Signed-off-by: Barbara Johnson <barbara.johnson@bedfordtx.gov>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 28779: (QA follow-up) Even more specific message
Katrin Fischer [Tue, 10 Aug 2021 13:21:18 +0000 (15:21 +0200)]
Bug 28779: (QA follow-up) Even more specific message

For the detail page, the MARC view etc. we use the text:

The record you requested does not exist (488).

I think this is better than "not found", because that sounds
like it might be an issue with the search index, which we can
rule out in this case.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 28779: (QA follow-up) More specific message and soem cleanup
Nick Clemens [Fri, 30 Jul 2021 14:39:39 +0000 (14:39 +0000)]
Bug 28779: (QA follow-up) More specific message and soem cleanup

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Petro Vashchuk <stalkernoid@gmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 28779: Skip processing of non-existent biblios
Joonas Kylmälä [Thu, 29 Jul 2021 16:35:47 +0000 (19:35 +0300)]
Bug 28779: Skip processing of non-existent biblios

Just checking with a regex that whether an input looks like a biblionumber
is not enough, we need to also verify there is a biblio really existing
in the database and skip processing of hold request for non-existent
biblionumbers.

To test:
 1) Go to page /cgi-bin/koha/reserve/request.pl?biblionumbers=XXXXX
    where XXXXX is non-existent biblionumber, notice internal server error
 2) Apply patch
 3) Repeat step 1 and notice we cannot place a hold

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Petro Vashchuk <stalkernoid@gmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 28825: Can't edit local cover image for item from details page
Owen Leonard [Fri, 6 Aug 2021 16:49:50 +0000 (16:49 +0000)]
Bug 28825: Can't edit local cover image for item from details page

This patch corrects the markup for local cover images attached to items.
The correction allows correct display of an "edit" link when the user
clicks an item's cover image and views it in the lightbox-style modal.

To test, apply the patch and make sure the "LocalCoverImages" system
preference is enabled.

- View the details of a bibliographic record in the catalog which has
  items attached..
- In the table of holdings, click Edit -> Upload image.
- Upload an image for the item and return to the bibliographic detail
  page.
- Your image should now be displayed in the holdings table.
- Click the image to view it.
- In the footer of the modal there is an edit link: "Local cover image
  (edit). Before this patch the edit link would lead to a missing page.
  After applying the patch the link should take you to the "Image view"
  where you have the option of deleting the image or uploading another
  one.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 27847: Compiled CSS changes
Jonathan Druart [Wed, 11 Aug 2021 11:26:12 +0000 (13:26 +0200)]
Bug 27847: Compiled CSS changes

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 27847: Don't obscure page when checkin modal is non-blocking
Owen Leonard [Mon, 19 Apr 2021 11:49:25 +0000 (11:49 +0000)]
Bug 27847: Don't obscure page when checkin modal is non-blocking

This patch changes the series of events striggered when a non-blocking
modal dialog is displayed during checkin. If the "TransfersBlockCirc"
preference is set to "Don't block," the user can continue to check in
even though a transfer dialog has appeared. This patch hides the modal's
"backdrop" element so that the modal doesn't look like one which blocks
further action.

There is no Bootstrap backdrop option which both hides the backdrop and
makes it non-blocking, so we have to use the default non-blocking option
and "manually" hide the backdrop.

The "show.bs.modal" event must be added in order to make the
necessary change before the modal is displayed. This prevents the
darkened backdrop from appearing and then being hidden.

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

- Set the "TransfersBlockCirc" preference to "Don't block."
- Check in an item which belongs to another library.
- A modal dialog should be displayed: "Please return this item to XXX"
- The page "behind" the modal should not be darkened, and the cursor
  focus should remain in the check-in field.
- Checking in an item which as a hold should still trigger the
  "blocking" behavior: The modal must be dismissed by clicking one of
  its buttons (not the backdrop) and the page behind the modal should be
  darkend.
- Test with "TransfersBlockCirc" set to "Block." Checking in an item
  belonging to another library should trigger the "blocking" modal
  behavior.
- Test that other checkins still work correctly.

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 28764: (QA follow-up) Add comment, remove two defined's
Marcel de Rooy [Mon, 9 Aug 2021 13:41:45 +0000 (13:41 +0000)]
Bug 28764: (QA follow-up) Add comment, remove two defined's

If we no longer offer the sortfield with :asc actively, we should
probably write it somewhere too.
Replaced a few defined tests by empty test. No need to split empty
string or zero etc.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 28764: Alter sort dropdown to use direction parameter
Nick Clemens [Fri, 30 Jul 2021 10:54:47 +0000 (10:54 +0000)]
Bug 28764: Alter sort dropdown to use direction parameter

This code is odd -we build a select in the template, then turn it into a list of links using javascript
This patch adds a direction data element and uses it while building the links

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 28764: Parse direction parameter in public list view
Nick Clemens [Tue, 27 Jul 2021 11:27:21 +0000 (11:27 +0000)]
Bug 28764: Parse direction parameter in public list view

This patch adds a check for a 'direction' paramter in list sorting.

It maintains the existing syntax for sorting 'sortfield=field:direction'
but adds support for the form used in paginations and more commonly thtoughout
Koha' sortfield=field&direction=direction'

To test:
1 - Create a public list
2 - Add enough items to generate two pages (40 worked for me)
3 - View the list and enforce sorting by date added descending:
    sortfield=dateadded:desc
4 - Note the titles shown
5 - Click to second page using the pagination bar
6 - Note the same titles are shown, in a reversed order
7 - Apply patch
8 - repeat 305
9 - Second page is sorted correctly!

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 28813: DBRev 21.06.00.014
Jonathan Druart [Wed, 11 Aug 2021 11:25:45 +0000 (11:25 +0000)]
Bug 28813: DBRev 21.06.00.014

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 28813: Rename delivery_note to failure_code
Martin Renvoize [Thu, 5 Aug 2021 09:17:29 +0000 (10:17 +0100)]
Bug 28813: Rename delivery_note to failure_code

We now use the codes from the half implimented error_code in place of
the plain text that was being added to the delivery_note field. As part
of that we rename the field to failure_code to clarify it's intended
content.

Test plan
1/ Confirm t/db_dependent/Letters.t passes

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 28813: Update unit tests
Martin Renvoize [Thu, 5 Aug 2021 09:16:24 +0000 (10:16 +0100)]
Bug 28813: Update unit tests

This patch updates the unit tests to check for failure_code instead of
delivery_note and catches a missing case.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 28813: DBIC Schema Update
Martin Renvoize [Thu, 5 Aug 2021 09:15:58 +0000 (10:15 +0100)]
Bug 28813: DBIC Schema Update

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 28813: Update database field name
Martin Renvoize [Thu, 5 Aug 2021 09:14:49 +0000 (10:14 +0100)]
Bug 28813: Update database field name

Update the database field name from 'delivery_note' to 'failure_code' to
more accurately denote it's use.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 28835: Fix ability to pass list contents to batch record modification
Fridolin Somers [Tue, 10 Aug 2021 09:14:03 +0000 (23:14 -1000)]
Bug 28835: Fix ability to pass list contents to batch record modification

Bug 12759 added the ability to pass list contents to batch record
modification/deletion tools.
Patch Bug 22417 [Restore the 'add to list' feature] removed the fetch
of lists in batch_record_modification.pl I don't understand why.
It still exists in batch_delete_records.pl.

Note that this is needed when first form is displayed.

Test plan :
1) Create a private and a public list of records
2) Open Tools > Batch record modification
3) Check you can use the lists
4) Open Tools > Batch record deletion
5) Check you can use the lists

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 28828: Fix unimarc_field_4XX.tt and marc21_linking_section.tt value builders
Nick Clemens [Mon, 9 Aug 2021 12:09:13 +0000 (12:09 +0000)]
Bug 28828: Fix unimarc_field_4XX.tt and marc21_linking_section.tt value builders

Find closest ul for value builders.

Since Bug 22399 changes in biblio editor, value builder unimarc_field_4XX.tt JavaScript
code does not do its job anymore.
This is because a div is added and this call is now wrong:
  var subfields = whichfield.parentNode.parentNode.getElementsByTagName('input');

Test plan 1:
1) Use a UNIMARC DB
2) Define value builder unimarc_field_4XX on 463$t
3) Create a record B1 with 200$a, 200$f
4) Create a new record B2
5) Click on value builder in 463$t
6) Search for record B1
7) Click on "Choose"
=> Without patch only 463$t is filled with a value
=> With patch 463 $t, $a, $0 and $9 are filled with a value

Test plan 2:
1) Use a MARC_21 DB
2) Define plugin marc21_linking_section.pl on 773$t
3) Make sure 773$t and other subfields are visible in intranet/editor
4) Create a new record in basic cataloging editor
5) Click on value builder in 773$t
6) Search fro a record
7) Click on "Choose"
=> Without patch fields are not fileld
=> With patch subfields are correctly filled

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 28569: In opac-suggestions.pl preselect user library
Fridolin Somers [Wed, 16 Jun 2021 09:17:19 +0000 (11:17 +0200)]
Bug 28569: In opac-suggestions.pl preselect user library

In OPAC new purchase suggestion opac-suggestions.pl for library combobox :
actually first value is selected, user library should be selected.

Test plan :
1) Create a new library named 'ZZZ top'
2) Set this library on a user U1
2) Loggin at OPAC with user U1
3) Create a new suggestion
=> Check library 'ZZZ top' is preselected

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 28727: (QA follow-up) Simplify permission check
Katrin Fischer [Tue, 10 Aug 2021 23:04:49 +0000 (01:04 +0200)]
Bug 28727: (QA follow-up) Simplify permission check

There was another permission check for edit_items directly below,
so instead of changing them to both be edit_items, I think we
can now remove one.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 28727: Show edit item link when user has edit items permission
Andrew Fuerste-Henry [Tue, 20 Jul 2021 19:42:41 +0000 (19:42 +0000)]
Bug 28727: Show edit item link when user has edit items permission

To test:
1: log in as a user with edit_items but not edit_catalogue
2: confirm you do not get an Edit Item link on moredetail.pl
3: apply patch, restart, reload
4: confirm link now shows

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 28804: (bug 25026 follow-up) Handle SQL errors in reports
Jonathan Druart [Wed, 4 Aug 2021 06:59:40 +0000 (08:59 +0200)]
Bug 28804: (bug 25026 follow-up) Handle SQL errors in reports

Since bug 25026 DBMS errors are raised, but the report module is not
dealing correctly with the errors.
If an error occurred in execute_query, next queries will fail as well,
we should skip them.

Test plan:
1. Create report from SQL queries, containing errors (invalid syntax, etc.)
'SELECT id FROM borrowers' can do it
2. Execute the query
=> Without this patch you get a 500
=> With this patch applied you see that the error raised at DBMS level
is propagated to the UI
3. Confirm that there is no regression on valid queries

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 17600: Fix missing imports from mappings.pl
Jonathan Druart [Fri, 6 Aug 2021 10:04:16 +0000 (12:04 +0200)]
Bug 17600: Fix missing imports from mappings.pl

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 28630: Improve date comparisons in tests
Jonathan Druart [Wed, 4 Aug 2021 09:12:41 +0000 (11:12 +0200)]
Bug 28630: Improve date comparisons in tests

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 28630: (follow-up) Update wording of syspref
Martin Renvoize [Mon, 28 Jun 2021 13:42:13 +0000 (14:42 +0100)]
Bug 28630: (follow-up) Update wording of syspref

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 28630: Add unit tests
Martin Renvoize [Fri, 25 Jun 2021 09:33:18 +0000 (10:33 +0100)]
Bug 28630: Add unit tests

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 28630: Add track_login_daily to ILSDI::AuthenticatePatron
Martin Renvoize [Fri, 25 Jun 2021 08:50:50 +0000 (09:50 +0100)]
Bug 28630: Add track_login_daily to ILSDI::AuthenticatePatron

This patch adds a call to track_login_daily for the AuthenticatePatron
method in ILSDI.

Many libraries use this ILSDI endpoint for electron book borrowing and
need to maintain the lastseen based on this type of lending.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 28261: (QA follow-up) Fix width after adding visual feedback
Nick Clemens [Wed, 28 Jul 2021 13:51:40 +0000 (13:51 +0000)]
Bug 28261: (QA follow-up) Fix width after adding visual feedback

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 28261: Add visual feedback on overridden pickup locations on patron's page
Tomas Cohen Arazi [Thu, 29 Apr 2021 11:53:43 +0000 (08:53 -0300)]
Bug 28261: Add visual feedback on overridden pickup locations on patron's page

This patch makes the patron pages in the staff interface use the API and
Select2 to render the pickup locations list. This has the effect of
adding visual feedback on those pickup locations that need an override,
based on the current configuration options.

All the checks are done in the GET /holds/:hold_id/pickup_locations
route, so this is a fairly trivial change.

To test:
1. Have a couple holds for a patron, some overrriden, some not
2. Visit the patrons' detail page, holds tab.
=> SUCCESS: You see the holds, pickup location has a dropdown
3. Repeat in the circulation tab for the patron
=> SUCCESS: You see the holds, pickup location has a dropdown
4. Apply this patch
5. Repeat 2 and 3
=> SUCCESS: Same behavior as before, but the dropdown is rendered with
Select2 and has a search feature. Overridden pickup locations have an
icon telling so
6. Sign off :-D

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 28421: Unit Tests
Martin Renvoize [Mon, 24 May 2021 09:57:24 +0000 (10:57 +0100)]
Bug 28421: Unit Tests

This patch adds test test cases for both a Voided Payment and Voided
Writeoff. These cases need special handling in the refund process.

Test plan
0/ Don't apply
1/ Run t/db_dependent/Koha/Items.t
2/ Prior to this commit the test should pass
3/ Apply this commit but not the dependency(bug 22435)
3/ The test should fail
4/ Bug 22435 should make the test pass again.

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 22435: DBRev 21.06.00.013
Jonathan Druart [Wed, 4 Aug 2021 09:28:52 +0000 (09:28 +0000)]
Bug 22435: DBRev 21.06.00.013

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 22435: (follow-up) Set CREATE offset for credits to positive
Martin Renvoize [Mon, 5 Jul 2021 13:16:30 +0000 (14:16 +0100)]
Bug 22435: (follow-up) Set CREATE offset for credits to positive

The history view of an accountline shows increases and decreases in the
amount outstanding from the perspective of the credit/debit line you are
inspecting.

Apply creates a negative offset amount which acts to 'reduce' both the
outstanding 'debt' for the debit line and the outstanding 'credit' for
the credit line.  Starting with a negative offset for the credit thus
makes this nonsenical.

Void creates positive offset amounts which act to 'restore' both the
outstanding 'debt' for the debit line and the outstanding 'credit' for
the credit line.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 22435: (QA follow-up) More test updates
Martin Renvoize [Mon, 21 Jun 2021 17:32:50 +0000 (18:32 +0100)]
Bug 22435: (QA follow-up) More test updates

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 22435: (QA follow-up) Fix returned offsets in moredetail
Martin Renvoize [Mon, 21 Jun 2021 16:08:33 +0000 (17:08 +0100)]
Bug 22435: (QA follow-up) Fix returned offsets in moredetail

This patch updates the offsets query for lost item returns displayed in
the catalogue/moredetail controller.

Test plan (Same as bug 19919)
Test plan:
1) Pay off a LOST item
2) Check for the associated display of 'Paidfor?:' on the itemdetails page
3) Writeoff a LOST item
4) Check that a 'Paidfor?:' is not displayed on the itemdetails page.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 22435: Update DBIC Schema's
Martin Renvoize [Mon, 21 Jun 2021 15:41:54 +0000 (16:41 +0100)]
Bug 22435: Update DBIC Schema's

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 22435: (QA follow-up) Fix test for offset total
Martin Renvoize [Mon, 21 Jun 2021 15:39:38 +0000 (16:39 +0100)]
Bug 22435: (QA follow-up) Fix test for offset total

This patch updates the test for the offset total method to adhere to the
new restricted set of offset types available.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 22435: (QA follow-up) Add missing test for manager relation
Martin Renvoize [Mon, 21 Jun 2021 15:20:22 +0000 (16:20 +0100)]
Bug 22435: (QA follow-up) Add missing test for manager relation

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 22435: (follow-up) Drop account_offset_types table
Martin Renvoize [Mon, 21 Jun 2021 15:15:12 +0000 (16:15 +0100)]
Bug 22435: (follow-up) Drop account_offset_types table

This patch drops the now defunkt account_offset_types table and ensure
the type field in account_offsets is instead an enum type column.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 22435: (follow-up) Update POS for reduced offset types
Martin Renvoize [Mon, 21 Jun 2021 14:43:04 +0000 (15:43 +0100)]
Bug 22435: (follow-up) Update POS for reduced offset types

This patch updates the Koha::Charges::Sales class to use the 'CREATE'
and 'APPLY' offset types.

Test plan
1/ Run t/db_dependent/Koha/Charges/Sales.t

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 22435: (QA follow-up) Fix test file and adjust test
Nick Clemens [Fri, 18 Jun 2021 15:11:31 +0000 (15:11 +0000)]
Bug 22435: (QA follow-up) Fix test file and adjust test

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 22435: Improve database update
Martin Renvoize [Fri, 14 May 2021 15:42:44 +0000 (16:42 +0100)]
Bug 22435: Improve database update

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 22435: Update accountline-details page to show all history
Martin Renvoize [Fri, 14 May 2021 14:39:03 +0000 (15:39 +0100)]
Bug 22435: Update accountline-details page to show all history

The accountline-details page took a simplistic approach to displaying
the history of an accountline. This patch drops the now defunct
offset_type_description template block from it's respective include
files, and then updates the accountline-details template and controller
to show the full history of what's happend to the accountline passed.
This includes the creation, any increments/decrements (for fines), and
finally any offsets against the total (payments, cancellations, voids).

Test plan
1/ Create some credits and debits and apply them to each other in
various combinations.
2/ View the 'Details' page for some of the debit/credits
3/ Compare before patch and after for the Details page.

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 22435: Update for bug 27049
Martin Renvoize [Fri, 14 May 2021 13:37:59 +0000 (14:37 +0100)]
Bug 22435: Update for bug 27049

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 22435: Fix _set_found_trigger
Martin Renvoize [Fri, 14 May 2021 13:04:35 +0000 (14:04 +0100)]
Bug 22435: Fix _set_found_trigger

The _set_found_trigger utilised the 'Writeoff' offset type to
distinguish between the application of a writeoff and any other form of
offset application.

This patch updates the trigger to use the full link through from offset
to account credit line to get the credit type being offset.

Test plan
1/ Run t/db_dependent/Koha/Items.t and prove it fails before the patch,
but passes after applying this patch.
2/ Run t/db_dependent/Koha/Account/Offsets.t and prove it passes both
before and after applying this patch.

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 22435: Fix CREATE offset amounts
Martin Renvoize [Thu, 18 Mar 2021 10:23:57 +0000 (10:23 +0000)]
Bug 22435: Fix CREATE offset amounts

Updateing the tests highlighted a mistake in the original code.. the
offsets for the cancel and reduce creation lines were incorrectly
signed.

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 22435: Update unit tests
Martin Renvoize [Wed, 17 Mar 2021 17:48:23 +0000 (17:48 +0000)]
Bug 22435: Update unit tests

This patch updates the unit tests to reflect the changes we have made to
offset types.  We do two things:

1) Clean up calls to 'apply' to drop passing offset_type
2) Update test code to look for APPLY and CREATE instead of specific
   offset types.

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 22435: ->apply() should always use 'APPLY' for offset_type
Martin Renvoize [Wed, 17 Mar 2021 14:11:20 +0000 (14:11 +0000)]
Bug 22435: ->apply() should always use 'APPLY' for offset_type

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 22435: Add 'APPLY' to account_offset_types
Martin Renvoize [Wed, 17 Mar 2021 17:48:04 +0000 (17:48 +0000)]
Bug 22435: Add 'APPLY' to account_offset_types

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 22435: Use 'CREATE' offset type in Koha::Account::Line
Martin Renvoize [Tue, 16 Mar 2021 17:18:39 +0000 (17:18 +0000)]
Bug 22435: Use 'CREATE' offset type in Koha::Account::Line

This patch updates the Koha::Account::Line methods that result in new account
lines to use the 'CREATE' offset type for the creation record.

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 22435: Use 'CREATE' offset type in Koha::Account
Martin Renvoize [Tue, 16 Mar 2021 17:12:07 +0000 (17:12 +0000)]
Bug 22435: Use 'CREATE' offset type in Koha::Account

This patch updates the Koha::Account methods for adding debits and
credits to use the 'CREATE' offset type for the creation record.

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 22435: Update CREATE offset types
Martin Renvoize [Tue, 16 Mar 2021 17:28:12 +0000 (17:28 +0000)]
Bug 22435: Update CREATE offset types

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 28142: Compiled CSS
Jonathan Druart [Wed, 4 Aug 2021 09:28:05 +0000 (11:28 +0200)]
Bug 28142: Compiled CSS

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 28142: Accessibility: OPAC cart/basket checkboxes are not labelled
Henry Bolshaw [Thu, 15 Jul 2021 22:32:40 +0000 (22:32 +0000)]
Bug 28142: Accessibility: OPAC cart/basket checkboxes are not labelled

This patch adds labels to the checkboxes on the "Your cart" page to
improve accessibility for users of screen readers. The labels are
hidden from display because the item titles provide enough visual
context.

Test Plan:

1. Go to the OPAC
2. Search for some items and add them to your cart
3. Inspect the page html and confirm the checkboxes are not labelled
4. Select the "More Details" page and confirm these labels are missing too
5. Apply the patch
6. Inspect the checkboxes on the "Brief display" and "more details" views
7. Confirm that the checkboxes have meaningful labels and that the visual
display of the pages has not changed.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
JD amended patch: fix indentation

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 27848: Elasticsearch - include 245p to default title index mappings
Caroline Cyr La Rose [Wed, 12 May 2021 20:36:18 +0000 (16:36 -0400)]
Bug 27848: Elasticsearch - include 245p to default title index mappings

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Lucy Vaux-Harvey <lucy.vaux-harvey@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 27848: Elasticsearch - include 245b subtitle subfield in the default title index...
Caroline Cyr La Rose [Wed, 12 May 2021 20:32:45 +0000 (16:32 -0400)]
Bug 27848: Elasticsearch - include 245b subtitle subfield in the default title index mappings

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Lucy Vaux-Harvey <lucy.vaux-harvey@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 28391: Elasticsearch - Add 264b to publisher index mapping
Caroline Cyr La Rose [Wed, 19 May 2021 13:52:57 +0000 (09:52 -0400)]
Bug 28391: Elasticsearch - Add 264b to publisher index mapping

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 15067: DBRev 21.06.00.012
Jonathan Druart [Wed, 4 Aug 2021 09:28:52 +0000 (09:28 +0000)]
Bug 15067: DBRev 21.06.00.012

JD Amended DB rev: no need to display a warning, the creation of the
unique key will fail with an appropriate error.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 15067: (QA follow-up) Ensure update is idempotent
Nick Clemens [Fri, 23 Jul 2021 16:04:27 +0000 (16:04 +0000)]
Bug 15067: (QA follow-up) Ensure update is idempotent

These tables really shoul;d have some unique keys, we need a test so we can add
those

This ended up being a bigger work than expected, RM feel free to reject or move
to another bug and let the risk of duplicated languages

This is an old one, let's get it in :-)

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 15067: Added translations of languages to those 5 languages
Hayley Mapley [Sun, 12 May 2019 22:10:03 +0000 (10:10 +1200)]
Bug 15067: Added translations of languages to those 5 languages

Estonian, Latvian, Lithuanian, Inuktitut and Inupiaq are added with
their translations to the Advanced Search languages.

Test Plan:
1. From homepage, go to Advanced search
2. Click on More options next to the Search button
3. Scroll down to the Limits section
4. Click on Language: No limit
5. Find Estonian, Latvian, Lithuanian, Inuktitut and Inupiaq at the
bottom of the dropdown.
6. They should all be there.
7. Estonian and Latvian are repeated, this need to be fixed.
8. They need to be put in alphabetical order.

Signed-off-by: Hayley Mapley <hayleymapley@catalyst.net.nz>
The five languages are present, sorted alphabetically, and are not
repeated.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 15067: Add additional languages to advanced search language search
Gus [Thu, 21 Jan 2016 02:23:38 +0000 (02:23 +0000)]
Bug 15067: Add additional languages to advanced search language search

run update database script, look for new laguages under 'Language:' in Advanced search.
Languages that should be added are:
1. Estonian
2. Latvian
3. Lithuanian
4. Inuktitut
5. Inupiaq

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 15067: Follow up to fix sorting
Nick Clemens [Mon, 25 Jan 2016 20:47:27 +0000 (20:47 +0000)]
Bug 15067: Follow up to fix sorting

It looks like C4::Languages:getLanguages relies on implicit database
order for languages. They appear to be sorted by subtag so this patch
adds that sorting to the database query to ensure the dropdown is
sorted.

Signed-off-by: Aleisha <aleishaamohia@hotmail.com>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 28773: (QA follow-up) Additional changes
Marcel de Rooy [Fri, 30 Jul 2021 08:51:24 +0000 (08:51 +0000)]
Bug 28773: (QA follow-up) Additional changes

The work of the first patch was not yet finished.

[1] Similar changes to template for Cataloging and Authorities
[2] Made a better distinction now between short title on button
    and long title on menu and modal
[3] The short title parameter removes need for previewed var
[4] To keep related code closer, moved the dataPreview hidden code

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 28773: (bug 23302 follow-up) Fix add order from z3950 search results
Jonathan Druart [Wed, 28 Jul 2021 10:04:43 +0000 (12:04 +0200)]
Bug 28773: (bug 23302 follow-up) Fix add order from z3950 search results

For translated interface.

Using 'Order' (the button text) was not a good idea as the interface can
be translated :)

Signed-off-by: Mark Hofstetter <koha@trust-box.at>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 28754: Only adjust holds on specific biblio and don't go past end of array
Nick Clemens [Fri, 23 Jul 2021 17:56:39 +0000 (17:56 +0000)]
Bug 28754: Only adjust holds on specific biblio and don't go past end of array

Our query for lowest priority holds only needs to adjust holds on the biblio we are looking at
so I add biblionumber

Additionally we can simply find the end of the array and use that rather than 99998
so I set new_rank to scalar @priority

Lastly, we don't need to fetch the lowest priority holds if we are ignoring lowest priority
so I move it into the conditional

To test:
 1 - Add holds with lowest priorty to 2 records in the catalog
 2 - Add a hold on a third record
 3 - Note errors in log like:
    [2021/07/23 17:47:17] [WARN] splice() offset past end of array at /kohadevbox/koha/C4/Reserves.pm line 1649
 4 - Apply patch and restart all the things
 5 - Add a new hold on third record - no warns
 6 - Make one of the holds on third record have lowestPriority (click rightmost arrow with line at bottom)
 7 - Note no warns
 8 - Adjust other holds on record and note no warns

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 28741: (follow-up) Silence warning
Tomas Cohen Arazi [Mon, 2 Aug 2021 13:04:01 +0000 (10:04 -0300)]
Bug 28741: (follow-up) Silence warning

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 28741: Fix use of resumption token params
Nick Clemens [Thu, 22 Jul 2021 17:56:39 +0000 (17:56 +0000)]
Bug 28741: Fix use of resumption token params

TO test:
 1 - Enable OAI-PMH server in Koha
 2 - Set OAI-PMH:MaxCount to 5
 3 - Define 6 sets in Admin->OAI sets configuration
    Can setSpec and setName to 1,2,3....
 4 - Browse to:
    http://localhost:8080/cgi-bin/koha/oai.pl?verb=ListSets
 5 - Click 'Show more'
 6 - Keep seeing the same 5 - note the page says 'Results fetched -4-0'
 7 - Apply patch
 8 - Restart all the things
 9 - Reload the ListSets URL above
10 - Click 'Show more'
11 - See the 6th set and note no 'Show more'
12 - Set OAI-PMH:MaxCount to 1
13 - Go to the base ListSets url again
14 - Confirm you can 'Show more' until you reach the end

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 28741: Regression tests
Tomas Cohen Arazi [Fri, 30 Jul 2021 17:53:31 +0000 (14:53 -0300)]
Bug 28741: Regression tests

This patch adds regression tests for the behavior.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 28533: Fix other ocurrence
Nick Clemens [Fri, 30 Jul 2021 19:20:29 +0000 (19:20 +0000)]
Bug 28533: Fix other ocurrence

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 28533: Set subfields to 'undef' if whole field request in itemcallnumebr system...
Nick Clemens [Wed, 9 Jun 2021 12:59:27 +0000 (12:59 +0000)]
Bug 28533: Set subfields to 'undef' if whole field request in itemcallnumebr system preference

This patch undefines the CNsubfields variable when the whole field is requested

Note that the substr returns '' when no characters are found, so we test if the string eq ''

Testing 'truth' doesn't work because "0" is a valid option

To test:
 1 - Edit a record, add an 082 field
     082 0 0 ‡aalpha‡bbeta‡0delta
 2 - Set itemcallnumber system preference to 082
 3 - Attempt to add/edit items
 4 - ISE
 5 - Apply patch, restart all the things
 6 - Add/edit items - no error
 7 - Confirm the itemcallnumber field is populated with "alpha beta delta"
 8 - Set itemcallnumber system preference to '0820'
 9 - Add/edit items
10 - Confirm itemcallnumber is populated with 'delta'

Signed-off-by: Salman Ali <salman.ali@inLibro.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 28057: (follow-up) Get the biblionumber column
Nick Clemens [Wed, 28 Jul 2021 17:37:46 +0000 (17:37 +0000)]
Bug 28057: (follow-up) Get the biblionumber column

When we fetch the biblioitems we use a select to limit the columns fetched,
we must include the biblionumber as well

Signed-off-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 28057: Use the biblioitem's biblionumber for checking availability
Nick Clemens [Wed, 14 Apr 2021 18:19:40 +0000 (18:19 +0000)]
Bug 28057: Use the biblioitem's biblionumber for checking availability

The loop here gets items from the record, plus analytic items. Because of this
we need to check more than 1 record - we decide to do this via biblioitems.

We need to preserve that, but when checking ItemsAnyAvailableAndNotRestricted we
cannot assume that the biblionumber and biblioitemnumber are the same (they should be
but this may not be the best of all possible worlds)

I simply switch the call here

To test:
1 - Apply patch
2 - Test placing holds on single bibs and multiple bibs
3 - Confirm it works as expected

Signed-off-by: Petro Vashchuk <stalkernoid@gmail.com>
Signed-off-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 17600: Add missing imports in authorities/
Jonathan Druart [Tue, 3 Aug 2021 12:46:56 +0000 (14:46 +0200)]
Bug 17600: Add missing imports in authorities/

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 17600: Fix GetTagsLabels imports
Jonathan Druart [Tue, 3 Aug 2021 12:35:18 +0000 (14:35 +0200)]
Bug 17600: Fix GetTagsLabels imports

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 28704: Library MARCOrgCode field needs maxlength attribute
Owen Leonard [Tue, 13 Jul 2021 10:54:59 +0000 (10:54 +0000)]
Bug 28704: Library MARCOrgCode field needs maxlength attribute

This patch adds a maxlength attribute to the "MARC organization code"
field in the form for adding and editing libraries. The maxlength, 16,
matches the limit of the table column.

To reproduce the problem, go to Administration -> Libraries.
 - Add or edit a library
 - Fill the "MARC organization code" field with a string longer than 16
   characters, e.g. Decriminalization
 - When you save the record you will see an error.

Apply the patch and add or edit a library.
 - Confirm that you cannot enter more than 16 characters in the "MARC
   organization code" field.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 28728: Link to holds page from holds raio
Andrew Fuerste-Henry [Wed, 21 Jul 2021 12:37:21 +0000 (12:37 +0000)]
Bug 28728: Link to holds page from holds raio

To test:
1 - Find a bib with 1 item, place 3 bib-level holds on it (just to make
    sure there's at least one title on your holds ratio page)
2 - Go to the holds ratio page in circulation
3 - mouse over the Holds Ratio column, see that the number there is a
    link to http://[your koha]/cgi-bin/koha/circ/reserveratios.pl#, the
    page you're already on
4 - apply patch, restart_all, reload page
5 - link now goes to the holds page for that title

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 28733: Correct position of desks link in admin menu
Owen Leonard [Thu, 22 Jul 2021 18:35:13 +0000 (18:35 +0000)]
Bug 28733: Correct position of desks link in admin menu

This patch moves the "Desks" link from the "Basic parameters" section to
the "Patrons and circulation" section, matching the category of the link
on the Administration home page.

To test, apply the patch and go to an administration page which includes
the left-hand navigation sidebar, e.g. Administration -> Libraries.

In the sidebar, the "Desks" link should be in the "Patrons and
circulation" section, under "Item circulation alterts," matching its
position on the Administration home page.

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Bug 28733: (follow-up) Add manage_libraries permission check

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>