]> git.koha-community.org Git - koha.git/log
koha.git
2 years agoBug 22115: Format prices in table of checkouts according to CurrencyFormat setting
Katrin Fischer [Tue, 20 Sep 2022 21:20:57 +0000 (21:20 +0000)]
Bug 22115: Format prices in table of checkouts according to CurrencyFormat setting

In the patron account in the staff interface, all amounts in the
checkouts table should be formatted according to the CurrencyFormat
system preference setting.

To test:
* Edit some items, setting the replacement cost
* Make sure one of the item type is set to charge a rental charge
* Check out items
* Verify the checkouts table displays on both checkouts and details
  tabs correctly
* Try different settings of CurrencyFormat and verify all amounts
  display correctly

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 29389: Add holding branch to the holds queue report
Nick Clemens [Tue, 2 Nov 2021 11:57:21 +0000 (11:57 +0000)]
Bug 29389: Add holding branch to the holds queue report

This patch adds the holding branch to the hold queue report.
It is added as hidden by default, when running per branch it is not needed

To test:
 1 - Place some holds in your system
 2 - perl misc/cronjobs/holds/build_holdsqueue.pl
 3 - View the holds queue
 4 - Note there is no 'Current library' column
 5 - Apply patch
 6 - Reload
 7 - Note the column is not there
 8 - Click column setting gear
 9 - Check the column and confirm it appears
10 - Confirm the filter works

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 31594: Use count of results for displaying number shown
Nick Clemens [Wed, 21 Sep 2022 14:14:32 +0000 (14:14 +0000)]
Bug 31594: Use count of results for displaying number shown

To test:
1 - Create a report with a number of results that is not a multiple of 20
    SELECT barcode FROM items
2 - Run the report
3 - Go to the final page
4 - Note report says 20 shown, but there are less
5 - Apply patch
6 - Reload and confirm correct number of shown is shown :-)

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 30280: Add Unit tests
Frank Hansen [Thu, 1 Sep 2022 13:57:13 +0000 (13:57 +0000)]
Bug 30280: Add Unit tests

Sponsored-by: Lund University Library, Sweden
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 30280: (follow-up) Removing tab character in Heading.pm
Frank Hansen [Wed, 16 Mar 2022 08:20:40 +0000 (08:20 +0000)]
Bug 30280: (follow-up) Removing tab character in Heading.pm

Sponsored-by: Lund University Library, Sweden
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 30280: Add support for subject headings from different thesaurus when using Elast...
Frank Hansen [Tue, 15 Mar 2022 15:50:18 +0000 (15:50 +0000)]
Bug 30280: Add support for subject headings from different thesaurus when using Elasticsearch

This patch allows subject headings from different thesaurus to co-exist in Koha.

Test plan:
1. Enable Elasticsearch as the search engine (SearchEngine system preference =
Elasticsearch) and reindex (koha-elasticsearch --rebuild -d -b -a kohadev).
2. Load sample authority records attached to the bug (in this case the
authorities.mrc file was saved in the koha directory - adjust file location as
appropriate):
   misc/migration_tools/bulkmarcimport.pl -v -a -file authorities.mrc -insert
-c=MARC21
3. Load the sample bibliographic record attached to the bug:
   misc/migration_tools/bulkmarcimport.pl -v -b -file biblios.mrc -insert
-c=MARC21
4. Search for ISBN 0704328623 and verify that the subject terms are not linked
to any authority records (if you hover over the link terms, all links should
look like ../cgi-bin/koha/catalogue/search.pl?q=su:"subjectterm" - none should
have any ?q=an:XXX (where XXX = authority record ids) in the link).
5. Apply the patches.
6. Reset the Elasticsearch mappings (Administration > Catalog > Search engine
configuration (Elasticsearch)).
7. Reindex: koha-elasticsearch --rebuild -d -b -a kohadev
8. Link bibliographic records to authority records:
misc/link_bibs_to_authorities.pl -v -l
9. Repeat the search in step 4 (or refresh the record details page) and verify
that the first three Feminism headings[1] are linked to an authority record
(should have ?q=an:XXX (where XXX = different authority record IDs for the
various feminism authority records linked to a specific thesaurus)).
10. Reindex: koha-elasticsearch --rebuild -d -b -a kohadev

[1] Links for subject terms for step 9 in order are (the authority ids may be
different depending on how ou are testing):

    Subject(s:) Feminism | feminism | Feminism | Feminism | Idéhistoria |
Litteratur

    http://127.0.0.1:8081/cgi-bin/koha/catalogue/search.pl?q=an:1709
    http://127.0.0.1:8081/cgi-bin/koha/catalogue/search.pl?q=an:1710
    http://127.0.0.1:8081/cgi-bin/koha/catalogue/search.pl?q=an:1708
    http://127.0.0.1:8081/cgi-bin/koha/catalogue/search.pl?q=su:"Feminism"
    http://127.0.0.1:8081/cgi-bin/koha/catalogue/search.pl?q=su:"Idéhistoria"
    http://127.0.0.1:8081/cgi-bin/koha/catalogue/search.pl?q=su:"Litteratur"

    MARC info:

    650 #7 - SUBJECT ADDED ENTRY--TOPICAL TERM
      a Topical term or geographic name entry element Feminism
      0 Authority record control number or standard number
https://id.kb.se/term/sao/Feminism
      2 Source of heading or term sao
    650 #7 - SUBJECT ADDED ENTRY--TOPICAL TERM
      a Topical term or geographic name entry element feminism
      2 Source of heading or term bnb
    650 #0 - SUBJECT ADDED ENTRY--TOPICAL TERM
      a Topical term or geographic name entry element Feminism
    650 #4 - SUBJECT ADDED ENTRY--TOPICAL TERM
      a Topical term or geographic name entry element Feminism
    650 #4 - SUBJECT ADDED ENTRY--TOPICAL TERM
      a Topical term or geographic name entry element Idéhistoria
    650 #4 - SUBJECT ADDED ENTRY--TOPICAL TERM
      a Topical term or geographic name entry element Litteratur

   Note: The fourth Feminism term has second indicator 4 which means "Source
not specified". So this term is only a local term and does not belong to any
specific thesaurus and thus not linked. To specify a source of a term, the
second indicator must be set as 7. The source of heading is then specified in
subfield 2.

Sponsored-by: Lund University Library, Sweden
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 30280: Elasticsearch - Add 040f to Subject-heading-thesaurus-conventions (new...
Frank Hansen [Tue, 15 Mar 2022 15:47:47 +0000 (15:47 +0000)]
Bug 30280: Elasticsearch - Add 040f to Subject-heading-thesaurus-conventions (new) authority mapping index field (MARC21)

This patch adds 040 $f to a new field Subject-heading-thesaurus-conventions authority index mapping.

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

Sponsored-by: Lund University Library, Sweden
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 31475: Clean new lines and re-add some missing - for separating prefs
Katrin Fischer [Mon, 26 Sep 2022 21:23:54 +0000 (21:23 +0000)]
Bug 31475: Clean new lines and re-add some missing - for separating prefs

Without this patch suggestion and OPACViewOthersSuggestions appeared
grouped with other preferences. This patch restores them as separate
entries under the new Suggestions heading.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 31475: Added 'Suggestions' section to preferences
Isobel Graham [Mon, 12 Sep 2022 16:50:08 +0000 (17:50 +0100)]
Bug 31475: Added 'Suggestions' section to preferences

Confirm all suggestion preferences are now grouped.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Michaela Sieber <michaela.sieber@kit.edu>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 28512: Add branchcode as class to spinelabel element
Lucas Gass [Thu, 25 Aug 2022 17:15:29 +0000 (17:15 +0000)]
Bug 28512: Add branchcode as class to spinelabel element

To test:
-Apply patch and generate a quick spine label.
-Inscept the page and notice that the #spinelabel element should contain a new class which corresponds with that the of the logged in branch.

Signed-off-by: Andrew Fuerste-Henry <andrewfh@dubcolib.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 31528: (QA follow-up) Exclude .stylelintrc.json in Makefile.t
Tomas Cohen Arazi [Mon, 3 Oct 2022 12:54:34 +0000 (09:54 -0300)]
Bug 31528: (QA follow-up) Exclude .stylelintrc.json in Makefile.t

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 29071: DBRev 22.06.00.057
Tomas Cohen Arazi [Mon, 3 Oct 2022 11:49:22 +0000 (08:49 -0300)]
Bug 29071: DBRev 22.06.00.057

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 30571: DBRev 22.06.00.056
Tomas Cohen Arazi [Mon, 3 Oct 2022 11:47:47 +0000 (08:47 -0300)]
Bug 30571: DBRev 22.06.00.056

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 29071: (QA follow-up) Fix typo acual in syspref description
Katrin Fischer [Sat, 1 Oct 2022 21:43:33 +0000 (21:43 +0000)]
Bug 29071: (QA follow-up) Fix typo acual in syspref description

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 29071: Add HoldsQueueSplitNumbering syspref for any libraries that may not have it
Nick Clemens [Wed, 21 Sep 2022 20:26:24 +0000 (20:26 +0000)]
Bug 29071: Add HoldsQueueSplitNumbering syspref for any libraries that may not have it

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 29071: Add HoldsSplitQueueNumbering to installer data
Nick Clemens [Tue, 21 Sep 2021 10:49:58 +0000 (10:49 +0000)]
Bug 29071: Add HoldsSplitQueueNumbering to installer data

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 31482: Label creator does not call barcodedecode
Kyle Hall [Mon, 29 Aug 2022 13:26:44 +0000 (09:26 -0400)]
Bug 31482: Label creator does not call barcodedecode

The label creator can accept a list of either itemnumbers or item barcodes.
In the case that the list of composed of barcodes, those barcodes should be
passed though barcodedecode before the lookup is performed.

Test Plan:
1) Apply this patch
2) Download and install the Barcode Transformer plugin
   https://github.com/bywatersolutions/koha-plugin-barcode-transformer/releases/
3) Go to the plugin configuration page, set the configuration to the example configuration from the same page
4) On the "New label batch" page of the Label creator,,
   type in some valid barcodes, but prefix them with X and postfix them with Y, e.g. X123456Y
5) Submit the form
6) Note the items are added to the label batch!

JK: Remove unnecessary if $number check, barcodedecode already does this

Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 31463: (QA follow-up) Remove obsolete comment
Marcel de Rooy [Fri, 30 Sep 2022 09:29:58 +0000 (09:29 +0000)]
Bug 31463: (QA follow-up) Remove obsolete comment

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 31463: Add order status to opac-detail.pl
Nick Clemens [Thu, 25 Aug 2022 13:12:19 +0000 (13:12 +0000)]
Bug 31463: Add order status to opac-detail.pl

This adds a check for the preference OPACAcquisitionDetails and fetches
the active orders for the item if necessary

Additionally, we simply the check for biblio orders to use object methods
and remove code that stored order information in the item_info

To test:
1 - Enable preference: OPACAcquisitionDetails
2 - Create a basket with items created on order, add an order for a biblio, close the basket
3 - Create a second basket as above, add an order with multiple copies, leave basket open
4 - View biblio on opac
5 - You should see 1 item marked on order, and "1 items on order" below items table
6 - Close second basket
7 - Reload opac view, now 3 on order and in message
8 - Reopen first basket
9 - Reload opac view, now 2 on order and in message

JK: Remove unused @itemnumbers_on_order variable
Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 31441: Fix Koha::Item::as_marc_field when kohafield = ''
Julian Maurice [Tue, 23 Aug 2022 11:47:56 +0000 (13:47 +0200)]
Bug 31441: Fix Koha::Item::as_marc_field when kohafield = ''

marc_subfield_structure.kohafield can be NULL, but it can also be an
empty string. But in that case, Koha::Item::as_marc_field ignores them,
which means the resulting MARC::Field object has missing data.
This can produce a bug in OPAC ISBD view (and probably other places
where this method is used)

Test plan:
1. Edit the default biblio MARC framework for the item field: find or
   create a subfield that is not linked to a DB column.
   Save even if you made no changes to make sure that
   marc_subfield_structure.kohafield is set to an empty string.
   I'll use 995$Z as an example for the following steps.
2. Add the following to syspref OPACISBD:
    #995|<br>Item:|{995Z}|
3. Create a biblio with an item and put a value into 995$Z
4. Go to the ISBD detail page for this record at OPAC. Confirm that the
   value you entered in 995$Z is not visible
5. Apply patch and restart koha
6. Refresh the ISBD detail page. Confirm that the 995$Z is now visible.
7. Run `prove t/db_dependent/Koha/Item.t`

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 31540: Exclude expired holds from the reminder job
Nick Clemens [Mon, 12 Sep 2022 14:35:24 +0000 (14:35 +0000)]
Bug 31540: Exclude expired holds from the reminder job

Some libraries don't want to auto-cancel holds, but we should not remind
a patron about a hold which has expired.

To test:
1 - Place a hold for a patron
2 - Set it waiting
3 - Run the holds reminder script in the future
    perl misc/cronjobs/holds/holds_reminder.pl -day 1 --date '2023-09-12' -v
4 - Note the holds would be reminded
5 - Set expirationdate for the hold less than today
    UPDATE reserves SET expirationdate = DATE_SUB(CURDATE(), INTERVAL 1 DAY);
6 - Run the remidner cron again
7 - No holds trigger!

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 31601: Add ID to materials specified check-in page
Lucas Gass [Thu, 22 Sep 2022 13:14:22 +0000 (13:14 +0000)]
Bug 31601: Add ID to materials specified check-in page

TO test:
1. Apply patch
2. Find an item and add a materials specified note ( 952$3 ) to it.
3. Add this CSS to the IntranetUserCSS system preference:
background: red;
}
4. Now check-in the item in. The background of the materials specified note should now be red!
5. Hooray, sign off!

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Lisette Scheer <lisettePalouse+Koha@gmail.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 31653: Correct event names passed to jQuery on() function
Owen Leonard [Thu, 29 Sep 2022 12:20:30 +0000 (12:20 +0000)]
Bug 31653: Correct event names passed to jQuery on() function

This patch replaces the obsolete .on("hover") with .on("mouseenter
mouseleave"). This will allow the code to work again following the last
jQuery upgrade.

See Bug 20217 for discussion of the original implementation:
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20217#c14

To test, apply the patch and go to the staff interface. Hover your mouse
over the "Search" link in the header menu. The adjacent dropdown menu
button should have its hover state triggered.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 30571: DBIC schema
Tomas Cohen Arazi [Mon, 3 Oct 2022 11:30:37 +0000 (08:30 -0300)]
Bug 30571: DBIC schema

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 30571: (QA follow-up) Update marc to MARC in docs
Katrin Fischer [Mon, 3 Oct 2022 10:35:00 +0000 (10:35 +0000)]
Bug 30571: (QA follow-up) Update marc to MARC in docs

... don't say it, I know.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 30571: Z3950Servers.t - Add another subtest
Marcel de Rooy [Wed, 24 Aug 2022 12:50:31 +0000 (12:50 +0000)]
Bug 30571: Z3950Servers.t - Add another subtest

Subtest for testing nullability of host, syntax and encoding.

Test plan:
Run prove t/db_dependent/Koha/Z3950Servers.t.
(Note: you need strict mode to pass this test.)

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 30571: Z3950Servers.t - Create subtest for existing tests
Marcel de Rooy [Wed, 24 Aug 2022 12:42:33 +0000 (12:42 +0000)]
Bug 30571: Z3950Servers.t - Create subtest for existing tests

No real changes, just moving code and indentation.
Ground work for following patch.

Test plan:
To let the test pass, disable strict_mode in koha-conf.
Run perl t/db_dependent/Koha/Z3950Servers.t. Should pass now.
However, in strict mode or with prove, it should fail.
Run prove t/db_dependent/Koha/Z3950Servers.t. Failed?

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 30571: Table z3950servers: Make host, syntax and encoding NOT NULL
Marcel de Rooy [Wed, 24 Aug 2022 12:34:32 +0000 (12:34 +0000)]
Bug 30571: Table z3950servers: Make host, syntax and encoding NOT NULL

This is not a sync issue between structure and db revs.
It just seems a logical move.
Note that the interface for long does not allow these fields to be empty.

Test plan:
Run dbrev.
Add a new Z3950/SRU server. Verify if it works as expected.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 24127: Add 'code' and title to shelving location search
Nick Clemens [Thu, 22 Sep 2022 20:20:09 +0000 (20:20 +0000)]
Bug 24127: Add 'code' and title to shelving location search

This patch attempts to clarify the 'Shelving location' option in the
staff side dropdown, as it requires searching the shelving location code, not
the values. i.e. 'FIC' not 'Fiction'

This patch adds (code) to the option and adds a title, visible on hover

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 31528: Compiled CSS
Tomas Cohen Arazi [Mon, 3 Oct 2022 11:26:33 +0000 (08:26 -0300)]
Bug 31528: Compiled CSS

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 31529: [OPAC] Fix errors in SCSS files raised by stylelint
Owen Leonard [Thu, 8 Sep 2022 12:15:35 +0000 (12:15 +0000)]
Bug 31529: [OPAC] Fix errors in SCSS files raised by stylelint

This patch corrects errors raised by the new stylelint configuration in
OPAC SCSS files. Many of the fixes were made automatically by using the
"--fix" option:

npx stylelint koha-tmpl/opac-tmpl/bootstrap/css/src/*.scss --fix

Some examples of errors found:

    - Unexpected empty line before $-variable
    - Expected single space after ":"
    - Expected "#fff" to be "#FFF"
    - Expected modern color-function notation
    - Expected single space after "("
    - Expected single space before ")"
    - Expected empty line before comment
    - Expected no more than 1 empty line
    - Expected a trailing semicolon
    - Expected color.adjust($color, $lightness: -$amount) instead of darken($color, $amount)
    - Unexpected leading zero
    - Expected single space after "," in a single-line function
    - Expected double colon pseudo-element notation

Manual fixes include replacing named colors with hex codes, combining
duplicate selectors, removing empty blocks, etc.

Some warnings remain: "Unexpected !important" and "Expected a
placeholder selector (e.g. %placeholder) to be used in @extend" which
both require more than a quick fix, if we should choose to address them.

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

Browse around the OPAC to confirm that there are no visible changes to
style.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 31528: (follow-up) A few additional rules
Owen Leonard [Thu, 8 Sep 2022 12:37:25 +0000 (12:37 +0000)]
Bug 31528: (follow-up) A few additional rules

Adding a few more rules which came up during the correction process in
the follow-up bug.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 31528: Replace scss-lint configuration with one for stylelint
Owen Leonard [Wed, 7 Sep 2022 12:24:02 +0000 (12:24 +0000)]
Bug 31528: Replace scss-lint configuration with one for stylelint

This patch removes the SCSS linting configuration .scss-lint.yml which
was intended to be used with a now-obsolete tool, scss-lint.

It is replaced with .stylelintrc.json, for use with stylelint. I've
tried to keep the linting rules the same as before.

To test, run 'yarn install' to install the new dependencies.

You can test stylelint from the command line like so:

npx stylelint koha-tmpl/intranet-tmpl/prog/css/src/staff-global.scss

It should output a list of problems with the file:

koha-tmpl/intranet-tmpl/prog/css/src/staff-global.scss
   30:27   ✖  Expected "#e6f0f2" to be "#E6F0F2" color-hex-case
   81:31   ✖  Expected single space after "("    function-parentheses-space-inside
   ...etc.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 31412: Add focus to 'name' on SMTP Servers
Isobel Graham [Mon, 12 Sep 2022 16:33:57 +0000 (17:33 +0100)]
Bug 31412: Add focus to 'name' on SMTP Servers

This patch adds the focus class to ensure focus is given to the first form element on the SMTP server entry page.

Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 26368: DBRev 22.06.00.055
Tomas Cohen Arazi [Mon, 3 Oct 2022 11:20:41 +0000 (08:20 -0300)]
Bug 26368: DBRev 22.06.00.055

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 26368: (QA follow-up) Standardize spaces in option descriptions
Katrin Fischer [Sat, 1 Oct 2022 22:17:45 +0000 (22:17 +0000)]
Bug 26368: (QA follow-up) Standardize spaces in option descriptions

Most options are labelles as x- description, but a few had
additional spaces. This just makes sure they all look the same.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 26368: Rephase system preference to sentence style
Katrin Fischer [Sat, 1 Oct 2022 22:16:41 +0000 (22:16 +0000)]
Bug 26368: Rephase system preference to sentence style

The preference was using a yes/no instead of the more common
display/don't display. This patch switches it to the latter
and adds a note about position 17.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 26368: Add OCLC options to marc21_leader.tt
Nick Clemens [Thu, 3 Sep 2020 12:52:28 +0000 (12:52 +0000)]
Bug 26368: Add OCLC options to marc21_leader.tt

See documentation at:
https://www.oclc.org/bibformats/en/fixedfield/elvl.html

To test:
 1 - Apply patch, updatedatabase
 2 - Edit a record in the basic editor
 3 - Edit the leader using the plugin
 4 - Note the options for '17 - Encoding level'
 5 - Find the system preference 'UseOCLCEncodingLevels'
 6 - Edit the record again
 7 - Note new options I,J,K,M
 8 - Set the value of encodign level to one of the new options and save
 9 - Edit again
10 - Confirm the value is displayed correctly selected
11 - Repeat tests using advanced cataloging editor

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 15545: Remove reqholdnotes from opac-reserve
Marcel de Rooy [Mon, 29 Aug 2022 13:40:28 +0000 (13:40 +0000)]
Bug 15545: Remove reqholdnotes from opac-reserve

This never really made it. So let's remove all traces.

Test plan:
Look at code changes and git grep reqholdnotes.
Bonus: Place a hold with/without hold notes.

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 8305: Added an icon for iOS home screen
Isobel Graham [Thu, 1 Sep 2022 10:03:31 +0000 (11:03 +0100)]
Bug 8305: Added an icon for iOS home screen

1. Bookmark the Koha OPAC on an iOS device
2. See if an icon is formed on the home screen
   of the device

Signed-off-by: Petro Vashchuk <stalkernoid@gmail.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 31496: Fix branch in printslip.pl to logged in staff user's library
Lari Strand [Wed, 31 Aug 2022 12:39:42 +0000 (15:39 +0300)]
Bug 31496: Fix branch in printslip.pl to logged in staff user's library

When you print a receipt slip in SCO, the library/branch you are at
in should be fetched from the logged in staff member's data (staff login
done before entering SCO view) instead of the patron's own who has signed
in to the SCO. Printing a slip shows patron's own home branch in the slip
as the branch they're in. This causes confusion with patrons who want to
print receipts/slips.

Test plan:
1) Make sure the staff user's library (used to login into SCO patron
   view) is not the same as the patron's who is logging into SCO
2) Print a slip in SCO and notice patron's home library printed on the slip
3) Apply patch
4) Print a slip in SCO and notice the library is now the staff user's library
   used to sign in to SCO patron view.

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 31419: Add accesskeys for modals
Nick Clemens [Fri, 19 Aug 2022 10:04:56 +0000 (10:04 +0000)]
Bug 31419: Add accesskeys for modals

This patch simply adds accesskey elements to the buttons, and changes an icon to be
consistent with bug 26626

For tips on how to access the accesskeys:
https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/accesskey

To test:
1 - Generate a recall
2 - Fill it/check in
3 - Note modal now has hints "Confirm (Y)"
4 - Test with Y,P,I keys (may need to recreate recalls)
5 - Confirm the recall and test waiting recall modal too

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 31605: Improve style of OPAC suggestions search form
Owen Leonard [Thu, 22 Sep 2022 15:48:32 +0000 (15:48 +0000)]
Bug 31605: Improve style of OPAC suggestions search form

This patch makes minor modifications to the markup for the
OPAC suggestions search form so that the different labels and
form fields display a little more nicely.

The patch also adds standard Bootstrap alert classes to
several messages which might be displayed on the screen, e.g.
"You have no pending purchase suggestions."

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

- With the  OPACViewOthersSuggestions preference disabled, log
  in to the OPAC and view your suggestions.
- If you have no suggestions you should see a Bootstrap-styled
  message box, "You have no pending purchase suggestions."
- If necessary, submit a suggestion. With at least one suggestion
  present you should see a search form above the table of
  suggestions. The label, form field, and submit button should
  line up nicely.
- Test that the search form works correctly to find suggestions
  in your system.
- If you search for a suggestion which doesn't exist you should
  see a message-style alert, "There are no pending purchase
  suggestions matching your search."
- Enable the OPACViewOthersSuggestions system preference.
- Return to the OPAC suggestions page. The form field should
  now include a nicely-styled "Suggested by" filter.

Signed-off-by: George Williams <george@nekls.org>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 31527: Breadcrumbs for anonymous suggestions are not correct
Owen Leonard [Thu, 22 Sep 2022 16:41:12 +0000 (16:41 +0000)]
Bug 31527: Breadcrumbs for anonymous suggestions are not correct

This patch updates the OPAC suggestions template in order to
omit the patron name breadcrumb if there is not a logged-in
user.

To test, apply the patch and view the OPAC suggestions page
with the AnonSuggestions preference both enabled and disabled.

- If you are logged in, the page breadcrumbs will be:
  Home -> [Your name] -> Purchase suggestions.
- If you are not logged in it should be:
  Home -> Purchase suggestions

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 31565: (QA follow-up) Remove support for _ as wildcard in -like queries
Tomas Cohen Arazi [Mon, 26 Sep 2022 13:32:06 +0000 (10:32 -0300)]
Bug 31565: (QA follow-up) Remove support for _ as wildcard in -like queries

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 25375: Fix QueryBuilder.t tests
Julian Maurice [Mon, 26 Sep 2022 12:47:52 +0000 (14:47 +0200)]
Bug 25375: Fix QueryBuilder.t tests

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 29744: (QA follow-up) Only consider PLACK_ENV for underscore
Tomas Cohen Arazi [Fri, 23 Sep 2022 15:04:54 +0000 (12:04 -0300)]
Bug 29744: (QA follow-up) Only consider PLACK_ENV for underscore

When run under certain circumstances (in jenkins, for example) some ENV
variables are set for convenience, like PLACK_WORKERS and
PLACK_MAX_REQUESTS and is causing some tests to fail (notably, shib
ones).

This patch makes the regex only consider PLACK_ENV when testing for the
underscore case.

Tests are updated accordingly, and they are also rewritten to test for
boolean values instead of empty string, or zero or one, etc. The
implementation shouldn't matter as long as the boolean evaluation is
correct and it is clearer for devs what to expect.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 31105: Regression tests
Tomas Cohen Arazi [Fri, 23 Sep 2022 12:56:46 +0000 (09:56 -0300)]
Bug 31105: Regression tests

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 31105: Holds to pull counts items from other branches when independentbranches...
Shi Yao Wang [Tue, 5 Jul 2022 16:03:52 +0000 (12:03 -0400)]
Bug 31105: Holds to pull counts items from other branches when independentbranches is active

Holds to pull should not show items from other branches that shares a
record when IndependentBranches is active. Except for superlibrarians.

Test plan:
1- Have IndependentBranches set to Yes
2- Have a record with an item from the current branch and another item from a different branch. We will call them branch A and branch B respectively
3- Have a patron from branch A place a hold on that record
4- Have a staff account on branch A and B with the following permissions:
    - circulate (all)
    - catalogue
5- Go to circulation > holds to pull
6- Notice under "Libraries" it displays branch A and B. Also, it shows 2 under "Items available"
7- Checkout the item from branch A to another patron
8- Go back to circulation > holds to pull
9- Notice under "Libraries" it displays branch B even though we are in branch A
10- Apply the patch
11- Return the checked out item from step 7
12- Redo step 5 to 9 with superlibrarian privileges and notice nothing changed
13- Redo step 11-12 but using accounts from step 4 and notice Holds to
pull only shows information relevant to their branch

Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 23538: DBRev 22.06.00.054
Tomas Cohen Arazi [Fri, 23 Sep 2022 12:42:05 +0000 (09:42 -0300)]
Bug 23538: DBRev 22.06.00.054

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 23538: (QA follow-up) Group system preferences into one entry
Katrin Fischer [Sat, 30 Jul 2022 14:35:27 +0000 (14:35 +0000)]
Bug 23538: (QA follow-up) Group system preferences into one entry

This makes the new perferences EmailPatronRegistrations and EmailAddressForPatronRegistrations
follow a little more closely the pattern set by the very similar
EmailPurchaseSuggestions and EmailAddressforSuggestions.

* Group both preferences into one entry
* Add line break between preferences
* Switch branch for library in pull down

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 23538: (follow-up) Fix up notices
Alex Buckley [Wed, 6 Apr 2022 12:40:01 +0000 (12:40 +0000)]
Bug 23538: (follow-up) Fix up notices

- Add toolkit template (TT) syntax to notices
- Add TT conditionals to notices

Sponsored-by: Catalyst IT
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 23538: Unit tests
Alex Buckley [Wed, 6 Apr 2022 10:38:38 +0000 (10:38 +0000)]
Bug 23538: Unit tests

Test plan:
1. Run unit tests:
sudo koha-shell <instance>
cd t/db_dependent/Koha
prove -v Patron.t

Sponsored-by: Catalyst IT
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 23538: Email library when new patron self-registers
Alex Buckley [Tue, 5 Apr 2022 21:33:12 +0000 (09:33 +1200)]
Bug 23538: Email library when new patron self-registers

Test plan:
1. Apply all patches
2. Update database
3. Restart services
4. Set email addresses in:
- KohaAdminEmailAddress syspref
- EmailAddressForPatronRegistrations syspref
- Email address in the library branch
5. Enable PatronSelfRegistration syspref
6. Test the following use cases:

- EmailPatronRegistrations syspref = 'none'.
Submit OPAC registration.
= OUTCOME: Confirm no OPAC_REG notice in message_queue table

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 23538: Database changes
Alex Buckley [Mon, 4 Apr 2022 07:52:06 +0000 (07:52 +0000)]
Bug 23538: Database changes

Sponsored-by: Catalyst IT
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 31468: Change interface in Koha::Logger
Marcel de Rooy [Fri, 26 Aug 2022 09:28:14 +0000 (09:28 +0000)]
Bug 31468: Change interface in Koha::Logger

Test plan:
Add a line in mainpage.pl:
  require Koha::Logger; Koha::Logger->get->warn("intranet L51");
Restart. Hit intranet mainpage. Verify that line is in plack=intranet.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Retested with L49 now ;)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 30484: (follow-up) Fix tests
Tomas Cohen Arazi [Fri, 23 Sep 2022 12:29:40 +0000 (09:29 -0300)]
Bug 30484: (follow-up) Fix tests

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 30484: DBRev 22.06.00.053
Tomas Cohen Arazi [Fri, 23 Sep 2022 12:22:36 +0000 (09:22 -0300)]
Bug 30484: DBRev 22.06.00.053

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 30484: (QA follow-up) Fix typo 'Kind Regards'
Katrin Fischer [Mon, 8 Aug 2022 20:46:33 +0000 (22:46 +0200)]
Bug 30484: (QA follow-up) Fix typo 'Kind Regards'

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 30484: Add unit tests
Andrew Isherwood [Wed, 13 Apr 2022 10:30:40 +0000 (11:30 +0100)]
Bug 30484: Add unit tests

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
https://bugs.koha-community.org/show_bug.cgi?id=28909
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 30484: Implement support for ILL request updates
Andrew Isherwood [Fri, 8 Apr 2022 15:09:30 +0000 (16:09 +0100)]
Bug 30484: Implement support for ILL request updates

This commit adds support for the concept of ILL request update notices.

- Adds a new Koha::Illrequest::SupplierUpdate class that is used to
encapsulate an update to a request, this update may come from a
supplier via a backend or from core ILL via, perhaps, a user action
- Adds a new Koha::Illrequest::SupplierUpdateProcessor base class that
can be subclassed in order to create a processor that can be passed an
update and act accordingly.
- Updates to Illrequest.pm to support the above classes and allow core
Koha to offer update processors
- A shell script to initiate a periodic process to check for updates
meeting given criteria and run the appropriate processors

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
https://bugs.koha-community.org/show_bug.cgi?id=28909
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 30484: Add ILL update notice
Andrew Isherwood [Fri, 8 Apr 2022 15:06:37 +0000 (16:06 +0100)]
Bug 30484: Add ILL update notice

Adds a new ILL_REQUEST_UPDATE notice which is to be used for the
formation of notices informing users of updates to ILL requests.

Commit includes database updates and template changes for messaging
preferences

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
https://bugs.koha-community.org/show_bug.cgi?id=28909
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 30802: (QA follow-up) Simplify a ternary
Marcel de Rooy [Tue, 13 Sep 2022 13:06:53 +0000 (13:06 +0000)]
Bug 30802: (QA follow-up) Simplify a ternary

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 30802: Make numReturnedItemsToShow function properly
Shi Yao Wang [Thu, 19 May 2022 15:05:17 +0000 (11:05 -0400)]
Bug 30802: Make numReturnedItemsToShow function properly

Replaced the hardcoded 20 by the value of numReturnedItemsToShow to
display the right number of items in check in.

Test plan:
1-  Make lots of checkouts, at least like 40 (I used the batchCheckouts feature)
2-  Go to Circulation > Check in
3-  Return 21 items
    The last 20 items returned will be displayed
4-  Change numReturnedItemsToShow to 50
5-  Return a couple more items
    Only the last 20 returned items are displayed
6-  Change numReturnedItemsToShow to 10
7-  Return a couple more items
    Only the last 10 returned items are displayed
8-  Apply the patch
9-  Change numReturnedItemsToShow back to 20
10- Do steps 1 to 7 again, but this time step 5 returns the right amount
of items

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 31525: display streetnumber with address in patron search
Wainui Witika-Park [Sun, 11 Sep 2022 22:18:45 +0000 (22:18 +0000)]
Bug 31525: display streetnumber with address in patron search

Adds back street number to the address when searching for patrons

To test:
1) Edit a patron's contact information
2) Under Main Address put an address, make sure to put something in the
Street number field
3) Do a simple patron search that will yield results (i.e. "a")
4) Confirm the street number does not show, but the rest of the address
does
5) Apply this patch
6) Do another patron search
5) Confirm the street number now shows

Sponsored-by: Catalyst IT
Testing note:  AddressFormat system preference must be set to "US style"

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 31518: Fix syntax error on request.tt that prevents showing hidden item count
Joonas Kylmälä [Sun, 4 Sep 2022 07:22:22 +0000 (10:22 +0300)]
Bug 31518: Fix syntax error on request.tt that prevents showing hidden item count

The variable set by request.pl doesn't have biblio prefix, it is just
hiddencount.

To test:
 1) Log in with a staff member account that has "Lost items in staff
 interface" setting set to "Hidden by default" in the patron category
 settings
 2) Add a lost item to biblio
 3) Go place a hold on staff interface (request.pl) notice the broken
 link on the request page: "Show all items ( hidden)"
 4) After applying the patch it should read "Show all items (1 hidden)"

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 25375: DBRev 22.06.00.052
Tomas Cohen Arazi [Fri, 23 Sep 2022 12:08:38 +0000 (09:08 -0300)]
Bug 25375: DBRev 22.06.00.052

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 25375: Spelling fixes
Tomas Cohen Arazi [Fri, 23 Sep 2022 12:06:11 +0000 (09:06 -0300)]
Bug 25375: Spelling fixes

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 25375: New atomicupdate syntax
Tomas Cohen Arazi [Fri, 23 Sep 2022 12:03:50 +0000 (09:03 -0300)]
Bug 25375: New atomicupdate syntax

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 25375: Adjust tests and test itemlost, not notforloan
Nick Clemens [Tue, 13 Sep 2022 13:06:03 +0000 (13:06 +0000)]
Bug 25375: Adjust tests and test itemlost, not notforloan

Previous commit correctly lists Zebra availability test, but was a
bad edit. This fixes the availability test to use itemlost

Additiionally, tests were written before limits were agreed. Adjusted
for the current settings

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 25375: Match current Zebra availability limit
Nick Clemens [Mon, 8 Aug 2022 12:15:16 +0000 (12:15 +0000)]
Bug 25375: Match current Zebra availability limit

In Zebra the availability limit code states:
'available' is defined as (items.onloan is NULL) and (items.itemlost = 0)

We should make ES follow the same behaviour so that changing the engine does not
change this.

To test:
1 - Find or create several records with two items each
2 - For those records setup items as:
    a - one checked out, one available
    b - both marked lost
    c - both damaged
    d - both withdrawn
    e - both notforloan
3 - Enable ES and reindex to confirm everything is set
4 - Perform an advanced search to return those records and 'limit to available items'
5 - Confirm you see records b,c,d,e and records say '2 items, none available'
6 - Apply patch
7 - Run `misc/search_tools/rebuild_elasticsearch.pl -d -b`
8 - Perform an advanced search to return those records and 'limit to available items'
9 - Confirm you see records a,b,c,d and al but a say '2 items, none available'

Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 25375: Add tests for the "available" ES field
Julian Maurice [Thu, 3 Mar 2022 10:18:25 +0000 (11:18 +0100)]
Bug 25375: Add tests for the "available" ES field

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 25375: (QA follow-up) Count available items rather than iterating
Nick Clemens [Fri, 11 Sep 2020 15:23:02 +0000 (15:23 +0000)]
Bug 25375: (QA follow-up) Count available items rather than iterating

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 25375: Get biblionumber from the correct MARC field
Julian Maurice [Fri, 4 Sep 2020 08:25:17 +0000 (12:25 +0400)]
Bug 25375: Get biblionumber from the correct MARC field

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 25375: Fix 'available' facet in elasticsearch
Julian Maurice [Wed, 29 Apr 2020 14:13:08 +0000 (16:13 +0200)]
Bug 25375: Fix 'available' facet in elasticsearch

Add a new boolean ES field named 'available', which is true if at least
one item is available, which means the item is not on loan, not
"notforloan", not withdrawn, not lost and not damaged

A full indexation is required

Test plan:
1. Apply patch and run updatedatabase.pl
2. Run `misc/search_tools/rebuild_elasticsearch.pl -d -b`
3. Make sure you have some biblios whose items are all unavailable, some
   biblios whose items are all available, and some biblios with at least
   one item available and at least one item unavailable
4. Use the 'available' filter on both opac and intranet and make sure it
   works as expected.

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 31367: Add subtotals if budget has children
Nick Clemens [Fri, 26 Aug 2022 13:32:50 +0000 (13:32 +0000)]
Bug 31367: Add subtotals if budget has children

On bug 29287 we added child funds if a fund had no parent id

It turns out funds can have a parent, and still have children (sub-sub-funds)

This patch simply checks for children, rather than checking for lack of parent.

Totals are already calculated correctly in GetBudgetHierarchy

To test:
1 - Add a fund "Fund" to a budget - assign 1000 dollars
2 - Add a sub-fund "SubFund" - assign 100 dollars
3 - Add a sub-sub-fund "SubSubFund" - assign 10 dollars
4 - Add to a basket $5 order from SubSubFund
5 - Add to a basket $50 order from SubFund
6 - Add to a basket $500 order form Fun
7 - View acqui home - note 'SubFund' does not include total from 'SubSubFund'
8 - Apply patch
9 - Confirm all sub-sub-funds totaled in sub-funds and that fund total correctly adds sub and sub-sub funds

Signed-off-by: Andrew Fuerste-Henry <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 30982: (QA follow-up) No userenv, no jobs
Marcel de Rooy [Fri, 23 Sep 2022 09:37:46 +0000 (09:37 +0000)]
Bug 30982: (QA follow-up) No userenv, no jobs

+    # Assume permission if context has no user
+    my $can_manage_background_jobs = 1;
=> This felt a bit unsafe.

Test plan:
Try interface for jobs. Call API with cookie. Call API with OAuth.
Run t/db_dependent/Koha/BackgroundJobs.t

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 30982: (QA follow-up) Remove redundancy from template
Marcel de Rooy [Fri, 23 Sep 2022 08:48:05 +0000 (08:48 +0000)]
Bug 30982: (QA follow-up) Remove redundancy from template

The template now contains two lists for both status and type:
a TT list and a JS list. The type list already proves that
redundancy leads to bugs. We miss three types at one side:
    Unknown job type 'stage_marc_for_import'
    Unknown job type 'marc_import_commit_batch'
    Unknown job type 'marc_import_revert_batch'

This patch removes the TT list. And gets the status and type
via an additional js call. For that reason I hide the fieldset
until document ready. This can be improved later when needed.

Test plan:
Look at status and type on both job list and detail view.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 30982: (QA follow-up) Spelling
Marcel de Rooy [Fri, 23 Sep 2022 07:05:39 +0000 (07:05 +0000)]
Bug 30982: (QA follow-up) Spelling

[1] Correct: BackgrounJob
[2] If should filter out not current jobs
=> Had a hard time reading that one until I replaced if by it.
=> Decided to rephrase it in a more positive way.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 30982: (QA follow-up) Resolve pod warning
Marcel de Rooy [Tue, 20 Sep 2022 14:47:45 +0000 (14:47 +0000)]
Bug 30982: (QA follow-up) Resolve pod warning

Empty section in previous paragraph at line 32 in file Koha/BackgroundJobs.pm

Test plan:
Run podchecker again on this module.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 30982: Rename 'Background Jobs' => 'Jobs'
Tomas Cohen Arazi [Mon, 12 Sep 2022 18:06:51 +0000 (15:06 -0300)]
Bug 30982: Rename 'Background Jobs' => 'Jobs'

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 30982: Adapt table to new API spec
Tomas Cohen Arazi [Mon, 12 Sep 2022 17:54:08 +0000 (14:54 -0300)]
Bug 30982: Adapt table to new API spec

Disclaimer: this patch is highly opinionated :-D

When I started looking at this patch I felt like the two tables
(current/past jobs) implemented on bug 30462 was the way to go.

In order to make this patches apply after it I had to redo all the
things. Or most of them.

But I decided to keep the idea of filtering out completed tasks, not
just having the option to display 'the last hour' tasks. For the task I
added some required helper methods and the relevant tests as well. So a
behavior change.

Hope you all agree with it.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 30982: API tweaks
Tomas Cohen Arazi [Mon, 12 Sep 2022 16:02:25 +0000 (13:02 -0300)]
Bug 30982: API tweaks

This patch makes the following changes to the 'background_jobs' API:

* We now call them 'jobs'
* Removed deprecated query parameter definitions
* Added only_current query parameter
* Controller gets adapted to use $rs->filter_by_current when
  only_current is passed

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 30982: Add Koha::BackgroundJobs->filter_by_current
Tomas Cohen Arazi [Mon, 12 Sep 2022 15:01:45 +0000 (12:01 -0300)]
Bug 30982: Add Koha::BackgroundJobs->filter_by_current

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 30982: Add 'context' to the REST API specs
Jonathan Druart [Tue, 26 Jul 2022 06:44:10 +0000 (08:44 +0200)]
Bug 30982: Add 'context' to the REST API specs

context has been added by bug 30889

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 30982: Make code more re-usable
Martin Renvoize [Wed, 29 Jun 2022 14:14:41 +0000 (15:14 +0100)]
Bug 30982: Make code more re-usable

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 30982: Add tests and implement GET /background_jobs/$id
Jonathan Druart [Wed, 29 Jun 2022 09:28:31 +0000 (11:28 +0200)]
Bug 30982: Add tests and implement GET /background_jobs/$id

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 30982: (QA follow-up) Double quoting and console.log
Martin Renvoize [Tue, 28 Jun 2022 07:10:38 +0000 (08:10 +0100)]
Bug 30982: (QA follow-up) Double quoting and console.log

This patch fixes the issues highlighted by the QA script; We use double
quotes for translatable strings in JS and remove an errant console.log
call.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 30982: Use the REST API for background job list view
Jonathan Druart [Fri, 17 Jun 2022 09:13:19 +0000 (11:13 +0200)]
Bug 30982: Use the REST API for background job list view

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 30982: REST API specs
Jonathan Druart [Fri, 17 Jun 2022 07:21:39 +0000 (09:21 +0200)]
Bug 30982: REST API specs

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 7021: DBRev 22.06.00.051
Tomas Cohen Arazi [Thu, 22 Sep 2022 12:39:27 +0000 (09:39 -0300)]
Bug 7021: DBRev 22.06.00.051

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 7021: DBIC schema
Tomas Cohen Arazi [Thu, 22 Sep 2022 12:38:04 +0000 (09:38 -0300)]
Bug 7021: DBIC schema

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 7021: (QA follow-up) Fix typo
Tomas Cohen Arazi [Thu, 22 Sep 2022 12:37:07 +0000 (09:37 -0300)]
Bug 7021: (QA follow-up) Fix typo

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 7021: (QA follow-up) Add comment to new database column
Kyle M Hall [Fri, 2 Sep 2022 13:33:38 +0000 (13:33 +0000)]
Bug 7021: (QA follow-up) Add comment to new database column

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 7021: Move to new atomic update structure
Kyle M Hall [Fri, 2 Sep 2022 11:13:16 +0000 (11:13 +0000)]
Bug 7021: Move to new atomic update structure

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 7021: (QA follow-up): Minor code cleanup
Kyle M Hall [Fri, 2 Sep 2022 11:00:25 +0000 (07:00 -0400)]
Bug 7021: (QA follow-up): Minor code cleanup

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 7021: Catch new introductions of UpdateStats
Martin Renvoize [Mon, 23 May 2022 14:21:40 +0000 (15:21 +0100)]
Bug 7021: Catch new introductions of UpdateStats

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 7021: Remove superflous 'open'
Martin Renvoize [Mon, 23 May 2022 14:08:27 +0000 (15:08 +0100)]
Bug 7021: Remove superflous 'open'

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 7021: Terminology - usercode -> categorycode
Martin Renvoize [Mon, 23 May 2022 13:43:34 +0000 (14:43 +0100)]
Bug 7021: Terminology - usercode -> categorycode

Lets stick to standard terminology and use categorycode rather than
usercode here.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 7021: Patron category in the statistics table
Olli-Antti Kivilahti [Wed, 2 Jul 2014 16:54:33 +0000 (19:54 +0300)]
Bug 7021: Patron category in the statistics table

This patch populates the koha.statistics.usercode with borrowers.categorycode where it is easily available.
Currently for statistics.type 'issue' OR 'localuse' OR 'renew'.

Supplied a script to UPDATE the old statistics records.

Have fun!

To test:
1. Add loan for patron.
2. Check statistics table
=> 'usercode' column for this issue should now contain patrons categorycode

To test add_statistics_borrowers_categorycode.pl:
1. Run add_statistics_borrowers_categorycode.pl
2. Check statistics table
=> all statistics which are type 'issue' OR 'localuse' OR 'renew'
should now contain patrons categorycode in 'usercode' column

Also prove that tests in t/db_dependent/Circulation.t still pass.

Rebased-by: Emmi Takkinen <emmi.takkinen@koha-suomi.fi>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>