]> git.koha-community.org Git - koha.git/log
koha.git
4 years agoBug 26202: Remove the use of jquery.checkboxes plugin from batch record modification...
Owen Leonard [Thu, 13 Aug 2020 13:19:19 +0000 (13:19 +0000)]
Bug 26202: Remove the use of jquery.checkboxes plugin from batch record modification page

This patch removes the use of the jquery.checkboxes plugin from the
batch record modification page.

To test, apply the patch and go to Tools -> Batch record modification

 - Submit a batch of biblionumbers for modification.
 - On the results page, test the "Select all" and "Clear all" links to
   confirm that they work correctly.

Signed-off-by: Amit Gupta <amit.gupta@informaticsglobal.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
4 years agoBug 26204: Remove the use of jquery.checkboxes plugin from staff interface lists
Owen Leonard [Thu, 13 Aug 2020 13:54:54 +0000 (13:54 +0000)]
Bug 26204: Remove the use of jquery.checkboxes plugin from staff interface lists

This patch removes the use of the jquery.checkboxes plugin from the
staff interface lists page.

To test, apply the patch, go to Lists, and view the contents of a
list with multiple titles on it.

Check that the "Select all" and "Clear all" links work correctly.

Signed-off-by: Amit Gupta <amit.gupta@informaticsglobal.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
4 years agoBug 26212: Remove the use of jquery.checkboxes plugin from pending offline circulations
Owen Leonard [Fri, 14 Aug 2020 13:39:17 +0000 (13:39 +0000)]
Bug 26212: Remove the use of jquery.checkboxes plugin from pending offline circulations

This patch removes the use of the jquery.checkboxes plugin from the
pending offline circulations page, replacing it with in-page JS.

Unrelated: The JS-based creation of the "select all" and "clear all"
controls has been replaced with HTML links. Labels are added to the
results table to make checkbox selection easier.

To test, apply the patch and go to Circulation.

- Upload an offline circulation file (.koc) with multiple transactions.
  If you don't want to generate this file using the desktop application
  or Firefox add-on you can create a text file like this (tab
  separated):

  Version=1.0    Generator=koct-firefox    GeneratorVersion=0.1
  2020-08-14 13:24:21    issue    0109132    33000000093476

- Go to Pending offline circulation actions. You should see the list of
  transactions you uploaded.
- Test that the "Check all" and "Uncheck all" controls work correctly.

Signed-off-by: Amit Gupta <amit.gupta@informaticsglobal.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
4 years agoBug 26214: Remove the use of jquery.checkboxes plugin on late orders page
Owen Leonard [Fri, 14 Aug 2020 14:47:40 +0000 (14:47 +0000)]
Bug 26214: Remove the use of jquery.checkboxes plugin on late orders page

This patch replaces the use of the jquery.checkboxes plugin on late
orders page in acquisitions.

Unrelated changes: The "Check all" and "Uncheck all" links are moved out
of the table header so that it matches similar interfaces. Sorting is
now disabled on the checkboxes column and the table is sorted by default
on the "Order line" column.

To test, apply the patch and go to Acquisitions -> Late orders.

 - On the initial view, there should be no "Check all" or "Uncheck all"
   links.
 - Select a vendor in the left-hand sidebar form.
 - When the filtered table is redisplayed the "Check all" and "Uncheck
   all" links should now be visible.
 - Test that the links work correctly.
 - Confirm that the checkboxes column cannot be sorted and that the
   table is sorted by default by order line number.

Signed-off-by: Amit Gupta <amit.gupta@informaticsglobal.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
4 years agoBug 26215: Remove the use of jquery.checkboxes plugin from Z39.50 search pages
Owen Leonard [Fri, 14 Aug 2020 15:18:37 +0000 (15:18 +0000)]
Bug 26215: Remove the use of jquery.checkboxes plugin from Z39.50 search pages

This patch removes the use of the jquery.checkboxes plugin from three
Z39.50 search templates: Acquisitions, Authorities, and Cataloging.

To test, apply the patch and test the controls for selecting and
deselecting Z39.50 search targets on the following pages:

 - In Acquisitions: Locate a vendor and add to basket -> From an
   external source.
 - In Authorities: Click "New authority" -> "New from Z39.50/SRU."
 - In Cataloging: Click "New from Z39.50/SRU."

Signed-off-by: Amit Gupta <amit.gupta@informaticsglobal.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
4 years agoBug 26216: Remove the use of jquery.checkboxes plugin from catalog search results
Owen Leonard [Fri, 14 Aug 2020 17:28:22 +0000 (17:28 +0000)]
Bug 26216: Remove the use of jquery.checkboxes plugin from catalog search results

This patch removes the use of jquery.checkboxes plugin from the
staff interface catalog search results page.

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

On the search results page test the "Select all" and "Clear all" links
at the top of the results. They should work correctly.

Signed-off-by: Amit Gupta <amit.gupta@informaticsglobal.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
4 years agoBug 26213: Remove the use of jquery.checkboxes plugin when adding orders from MARC...
Owen Leonard [Fri, 14 Aug 2020 14:18:00 +0000 (14:18 +0000)]
Bug 26213: Remove the use of jquery.checkboxes plugin when adding orders from MARC file

This patch removes the use of the jquery.checkboxes plugin from the page
for adding orders to a basket from a staged MARC file.

This patch fixes an unreported bug wherein the "select all" and "clear
all" controls affected not only MARC record checkboxes but also the
"show inactive funds" checkboxes.

To test, apply the patch and go to Acquisitions.

- Go to Vendor -> Add to basket -> From a staged file.
- Select a staged file with multiple records.
- Test the "Select all" and "Clear all" links at the top of the "Select
  to import" tab. They should work correctly to select and deselect
  checkboxes corresponding to staged MARC records.

Signed-off-by: Amit Gupta <amit.gupta@informaticsglobal.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
4 years agoBug 23632: Remove C4::Logs::GetLogs
Jonathan Druart [Thu, 6 Aug 2020 09:28:53 +0000 (11:28 +0200)]
Bug 23632: Remove C4::Logs::GetLogs

Koha::ActionLogs->search must be used instead.
There is no call to this subroutine in our code, it should be removed.

Test plan:
Make sure the 3 test files still return green and that there is no more
occurrences of GetLogs in the codebase.

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
4 years agoBug 23695: (follow-up) Add exceptions for missing branch parameters
Nick Clemens [Fri, 14 Aug 2020 12:57:25 +0000 (12:57 +0000)]
Bug 23695: (follow-up) Add exceptions for missing branch parameters

JD: amended patch
Remove QA issues:
 FAIL   t/db_dependent/Circulation.t
   FAIL   valid
                "my" variable $doreturn masks earlier declaration in same scope
                "my" variable $messages masks earlier declaration in same scope

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
4 years agoBug 23695: (QA follow-up) Fix Copy/Paste
Martin Renvoize [Thu, 13 Aug 2020 13:40:52 +0000 (14:40 +0100)]
Bug 23695: (QA follow-up) Fix Copy/Paste

The value remained as 'tobranchcd' and needed to be updated to
'frombranchcd' to allow reservered transfers to be correctly set.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
4 years agoBug 23695: (follow-up) Adjust for addition of transfer trigger
Nick Clemens [Mon, 23 Mar 2020 12:46:26 +0000 (12:46 +0000)]
Bug 23695: (follow-up) Adjust for addition of transfer trigger

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
4 years agoBug 23695: Alter transferbook to take a hash of params and specify from_branch
Nick [Mon, 30 Sep 2019 10:37:03 +0000 (10:37 +0000)]
Bug 23695: Alter transferbook to take a hash of params and specify from_branch

To test:
 1 - Go to Circulation->Transfer
 2 - Find an item from your branch and create a transfer to branch B
 3 - Note you can specify the origin and default is 'Item's holding library'
 4 - Confirm the item is marked as held at your current branch and is being transferred to B
 5 - Find an item from a third branch, branch C
 6 - Transfer that item to branch B from branch D
 7 - Confirm the item is held at branch D and is being transferred to B
 8 - prove -v t/db_dependent/Circulation.t
 9 - prove -v t/db_dependent/Koha/Items.t
10 - prove -v t/db_dependent/RotatingCollections.t

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
4 years agoBug 23695: Set holding branch to transferring branch when manually initiating a transfer
Nick [Mon, 30 Sep 2019 10:37:03 +0000 (10:37 +0000)]
Bug 23695: Set holding branch to transferring branch when manually initiating a transfer

To test:
 1 - Go to Circulation->Transfer
 2 - Note your signed in branch
 3 - Find an item from your branch and create a transfer to branch B
 4 - Confirm the item is marked as held at your current branch and is being transferred to B
 5 - Find an item from a third branch, branch C
 6 - Transfer that item to brnach B
 7 - Confirm the item is held at your current branch and is being transferred to B
 8 - prove -v t/db_dependent/Circulation.t
 9 - prove -v t/db_dependent/Koha/Items.t
10 - prove -v t/db_dependent/RotatingCollections.t

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
4 years agoBug 25751: Add ORDERED in dropdown list of suggestion's statuses
Jonathan Druart [Tue, 16 Jun 2020 13:44:40 +0000 (15:44 +0200)]
Bug 25751: Add ORDERED in dropdown list of suggestion's statuses

The status "ORDERED" is missing from the pull down list of
status values when editing a suggestion, so the first
option is selected "No status".

This leads to data loss when editing a suggestion in the
status "ORDERED". Worse: the status can't be reset to
"ORDERED" and so no AVAILABLE notice can be sent to the patron.

Test plan:
- Create a suggestion, accept it, create a new order from this suggestion.
- Verify status is "ORDERED"
- Edit the suggestion
=> Without this patch the dropdown list does not have
   "Ordered", and if you save you lost the status
=> With this patch applied the dropdown list has "Ordered"
   preselected. You can save and preserve the status.

Signed-off-by: Holly Cooper <hc@interleaf.ie>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
4 years agoBug 25872: Fix scoping of $limits
Nick Clemens [Thu, 13 Aug 2020 12:56:33 +0000 (12:56 +0000)]
Bug 25872: Fix scoping of $limits

The code in build_query_compat contained a 'my' in the assigning of limits for the search in a conditional

This meant the limits were being set correctly during the conditional, but we blanked when passed to the rest
of the code. The effect was that the searches worked, however, the template params to repeat the search were
incomplete.

Removing the my ensures the same limits are applied during search and on re-sorting

To test:
1 - Enable Elasticsearch
2 - On OPAC perform advanced search, selecting only an itype, ccode, or LOC limit
3 - Attempt to sort results
4 - You are returned to Advanced search
5 - Apply patch
6 - Repeat
7 - It sorts!

Signed-off-by: Lisette Scheer <lisetteslatah@gmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
4 years agoBug 25872: Unit tests
Nick Clemens [Thu, 13 Aug 2020 12:55:21 +0000 (12:55 +0000)]
Bug 25872: Unit tests

Signed-off-by: Lisette Scheer <lisetteslatah@gmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
4 years agoBug 26119: Enable patron's attribute edition when PatronSelfRegistrationVerifyByEmail
Jonathan Druart [Mon, 3 Aug 2020 11:09:54 +0000 (13:09 +0200)]
Bug 26119: Enable patron's attribute edition when PatronSelfRegistrationVerifyByEmail

There is no good reason remove the ability to edit patron's attributes
if PatronSelfRegistrationVerifyByEmail is set.

We cannot have them in the self-registration form (because we don't
store patron's attributes during self-ref), but we can have them when
a patron show/edit their information.

Test plan:
0. Enable PatronSelfRegistrationVerifyByEmail and create patron's
attributes that can be edited at the OPAC
1. Create a new patron using the self-reg feature
=> You don't have the ability to fill in the patron's attribute
2. Edit your personal details (OPAC)
=> Without this patch you still don't see the patron's attribute that
can be edited at the OPAC
=> With this patch applied you can!
3. Notice the wording change on the "Modify patron attribute type" form
and confirm it makes sense

Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
4 years agoBug 26127: local_referer should not compare with OPACBaseURL case insensitive
Jonathan Druart [Mon, 3 Aug 2020 13:07:24 +0000 (15:07 +0200)]
Bug 26127: local_referer should not compare with OPACBaseURL case insensitive

In our test data we have OPACBaseURL that is filled with http://kohadev.myDNSname.org:8080,
but the CGI referer in local_referer is lowercase
We should compare it without case sensitivity

Test plan:
- Use koha-testing-docker
- Notice the value of OPACBaseURL
=> http://kohadev.myDNSname.org:8080
- Use the "reports a problem" feature at the OPAC
- Notice that the "Problem found on page" is correctly filled with the
referer

Signed-off-by: Kelly McElligott <kelly@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
4 years agoBug 26182: Clarify wording on CanMarkHoldsToPullAsLost and UpdateItemWhenLostFromHoldList
Andrew Fuerste-Henry [Thu, 13 Aug 2020 13:13:55 +0000 (13:13 +0000)]
Bug 26182: Clarify wording on CanMarkHoldsToPullAsLost and UpdateItemWhenLostFromHoldList

To test:
- apply patch, restart
- search sysprefs for CanMarkHoldsToPullAsLost
- confirm both sysprefs come up in search and syspref descriptions refer to each other

Signed-off-by: Holly Cooper <holly.teresa.cooper@gmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
4 years agoBug 26228: Update gulpfile to work with Node.js v12
Tomas Cohen Arazi [Mon, 17 Aug 2020 15:12:55 +0000 (12:12 -0300)]
Bug 26228: Update gulpfile to work with Node.js v12

This patch makes the gulpfile work with gulp v4 on Node v12. To test it,
make sure your dev env has Node.js v12.

It also replaces the use of 'gulp-util' (deprecated) by 'minimist' as
recommended on their site.

On both KTD and KohaDevBox edit your sources.list so the node line
points to 'node_12.x' instead of 'node_8.x'.

Once that's done:
1. On your clone run:
   $ yarn install
   $ npm install -E
2. Build the CSS:
   $ yarn build
   $ yarn build --view opac
=> SUCCESS: Things build correctly
3. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
4 years agoBug 26078: (follow-up) Use a boolean rather than changing returnbranch
Nick Clemens [Fri, 14 Aug 2020 11:30:12 +0000 (11:30 +0000)]
Bug 26078: (follow-up) Use a boolean rather than changing returnbranch

Bug 26078: (follow-up) used validTransfer instead of checking WrongTransfer message

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
4 years agoBug 26078: Prevent generating a new transfer from return policy when resolving a...
Nick Clemens [Thu, 30 Jul 2020 16:59:14 +0000 (16:59 +0000)]
Bug 26078: Prevent generating a new transfer from return policy when resolving a transfer

To test:
- Have 2+ branches
- Set your default return policy to Item returns to issuing library
- Find an item with holding branch of Branch A
- Set your library to Branch B
- Check item in
- Koha generates a transfer to Branch A. In doing so, it sets the item holding branch to Branch B
- Set your library to Branch A
- Check item in
- Koha generate a transfer to Branch B. In doing so, it sets the item holding branch to Branch A
- Set you library to Branch A
- Check the item in
 . . . Repeat indefinitely.
 Apply patch
 Repeat
 No more loop

Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
4 years agoBug 26090: Fix "item types" report
Jonathan Druart [Thu, 30 Jul 2020 12:16:09 +0000 (14:16 +0200)]
Bug 26090: Fix "item types" report

This report was broken with SQL strict mode, but also without.

DBD::mysql::st execute failed: 'koha_kohadev.itemtypes.itemtype' isn't
in GROUP BY [for Statement "

and, if no library was selected:

DBD::mysql::st execute failed: Unknown column 'biblioitems.itemtype' in
'field list' [for Statement "

This patch does the minimum to make it usable, but it would need more
love.

Test plan:
To test you will need to try the 4 combinaisons:
 item-level_itypes = item or biblio
 With or without a library selected in the dropdown list

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
4 years agoBug 16371: (follow-up) DB changes
Jonathan Druart [Thu, 13 Aug 2020 08:28:24 +0000 (10:28 +0200)]
Bug 16371: (follow-up) DB changes

We need to keep "opac" is the pref was set before the upgrade

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
4 years agoBug 16371: DBRev 20.06.00.023
Jonathan Druart [Thu, 13 Aug 2020 08:00:23 +0000 (08:00 +0000)]
Bug 16371: DBRev 20.06.00.023

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
4 years agoBug 16371: Fix inconsistencies with timestamp
Jonathan Druart [Thu, 13 Aug 2020 07:57:27 +0000 (09:57 +0200)]
Bug 16371: Fix inconsistencies with timestamp

The timestamp value needs to be updated for each quote returned by
get_daily_quote (even when there is a match)

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
4 years agoBug 16371: Combine get_daily_quote and get_daily_quote_for_interface
Emmi Takkinen [Fri, 31 Jul 2020 06:47:56 +0000 (09:47 +0300)]
Bug 16371: Combine get_daily_quote and get_daily_quote_for_interface

This patch combines get_daily_quote and get_daily_quote_for_interface
methods and moves them from Koha::Quote to Koha::Quotes. Also removes
some unused code and adjusts datetime parsing.

To test apply this patch and confirm 'QuoteOfTheDay' syspref still
works as expected (quote is shown in correct mainpage(s)).

Also prove t/db_dependent/Koha/Quotes.t

Sponsored-by: Koha-Suomi Oy
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
4 years agoBug 16371: Remove GetDailyQuote tests from Koha.t
Emmi Takkinen [Wed, 12 Aug 2020 06:16:43 +0000 (09:16 +0300)]
Bug 16371: Remove GetDailyQuote tests from Koha.t

Tests in Koha.t failed due GetDailyQuote tests. This patch
removes these tests since we test quotes in Quotes.t instead.

To test prove t/db_dependent/Koha.t

Sponsored-by: Koha-Suomi Oy
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
4 years agoBug 16371: Rewrite get_daily_quote
Emmi Takkinen [Tue, 7 Jul 2020 12:45:17 +0000 (15:45 +0300)]
Bug 16371: Rewrite get_daily_quote

An updated test plan:
1. Apply the patch(es).
2. Run the database update (updatedatabase on koha-testing-docker).
3. Check that the 'QuoteOfTheDay' system preference options
   work as expected:
   - OPAC: QOTD only appears in the OAPC
   - Staff interface: QOTD only appears in the staff interface
   - Both (Select all): QOTD appears in the staff interface and OPAC
4. Run the tests and make sure they pass:
   prove t/db_dependent/Koha/Quotes.t
5. Sign off!

Sponsored-by: Koha-Suomi Oy
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>
4 years agoBug 16371: Add database updates
Emmi Takkinen [Fri, 10 Jul 2020 07:20:56 +0000 (10:20 +0300)]
Bug 16371: Add database updates

Sponsored-by: Koha-Suomi Oy
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>
4 years agoBug 16371: Fix QA issues, change terminology
Emmi Takkinen [Thu, 9 Jul 2020 08:55:03 +0000 (11:55 +0300)]
Bug 16371: Fix QA issues, change terminology

Sponsored-by: Koha-Suomi Oy
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>
4 years agoBug 16371: Fix tests
Emmi Takkinen [Mon, 27 Apr 2020 05:55:38 +0000 (08:55 +0300)]
Bug 16371: Fix tests

Tests failed due ids already existing in 'quotes' table.
This patch removes hardcoded ids from tests.

Sponsored-by: Koha-Suomi Oy
Signed-off-by: David Nind <david@davidnind.com>
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>
4 years agoBug 16371: Use multi-select on syspref
Emmi Takkinen [Tue, 14 Apr 2020 09:51:50 +0000 (12:51 +0300)]
Bug 16371: Use multi-select on syspref

This patch replaces textbox with multi-select dropdown on
syspref 'QuoteOfTheDay' and changes tests to match this change.

To test:
1. Check 'OPAC', 'staff client' or both on 'QuoteOfTheDay'.
2. Make sure that quote is displayed on (both) mainpage(s).

Prove t/db_dependent/Koha/Quotes.t

Sponsored-by: Koha-Suomi Oy
Signed-off-by: David Nind <david@davidnind.com>
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>
4 years agoBug 16371: Quote of the Day (QOTD) - Display in different interfaces
Olli-Antti Kivilahti [Mon, 25 Apr 2016 08:22:04 +0000 (11:22 +0300)]
Bug 16371: Quote of the Day (QOTD) - Display in different interfaces

Set 'QuoteOfTheDay'-syspref to 'opac intranet' to allow displaying news in the
opac and the staff client.

Add 'commandline' to allow news in the commandline (where applicable)

Accepts all values accepted by the C4::Context->interface()

Test plan:
1. Set 'QuoteOfTheDay' syspref as 'intranet' or 'opac' or both
2. Check that quote is visible on both mainpages

Prove t/db_dependent/Koha/Quotes.t

Sponsored-by: Koha-Suomi Oy
Signed-off-by: David Nind <david@davidnind.com>
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>
4 years agoBug 16371: Add needed Koha::Exception
Emmi Takkinen [Tue, 7 Apr 2020 08:53:17 +0000 (11:53 +0300)]
Bug 16371: Add needed Koha::Exception

Add Koha::Exception needed in this bug.

Sponsored-by: Koha-Suomi Oy
Signed-off-by: David Nind <david@davidnind.com>
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>
4 years agoBug 16371: Rename test file
Emmi Takkinen [Mon, 20 Apr 2020 12:20:18 +0000 (15:20 +0300)]
Bug 16371: Rename test file

Signed-off-by: David Nind <david@davidnind.com>
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>
4 years agoBug 16371: Move GetDailyQuote to get_daily_quote
Emmi Takkinen [Fri, 17 Apr 2020 08:28:55 +0000 (11:28 +0300)]
Bug 16371: Move GetDailyQuote to get_daily_quote

This patch moves subroutine 'GetDailyQuote' to new
Koha::Quote object and adjusts tests.

To test:
1. Set 'QuoteOfTheDay' as 'enable'
2. Check that quote is displayed on OPAC mainpage

Prove t/db_dependent/Koha/GetDailyQuote.t

Sponsored-by: Koha-Suomi Oy
Signed-off-by: David Nind <david@davidnind.com>
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>
4 years agoBug 16371: Add Koha::Quote[s] classes
Emmi Takkinen [Fri, 17 Apr 2020 07:57:27 +0000 (10:57 +0300)]
Bug 16371: Add Koha::Quote[s] classes

Sponsored-by: Koha-Suomi Oy
Signed-off-by: David Nind <david@davidnind.com>
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>
4 years agoBug 25348: (QA follow-up) Silence irrelevant warnings
Tomas Cohen Arazi [Tue, 11 Aug 2020 15:41:57 +0000 (12:41 -0300)]
Bug 25348: (QA follow-up) Silence irrelevant warnings

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
4 years agoBug 25348: Add support for circulation status 12 ( lost )
Kyle M Hall [Fri, 1 May 2020 16:24:44 +0000 (12:24 -0400)]
Bug 25348: Add support for circulation status 12 ( lost )

We should support the SIP2 "circulation status" value 12, "lost".

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

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>
4 years agoBug 25347: Add support for circulation status 11 ( claimed returned )
Kyle M Hall [Fri, 1 May 2020 16:16:48 +0000 (12:16 -0400)]
Bug 25347: Add support for circulation status 11 ( claimed returned )

Now that we have return claims in Koha, we should support the SIP2
"circulation status" value 11, "claimed returned".

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

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>
4 years agoBug 25344: Add support for circulation status 10 ( item in transit )
Kyle M Hall [Fri, 1 May 2020 16:04:37 +0000 (12:04 -0400)]
Bug 25344: Add support for circulation status 10 ( item in transit )

We should support the SIP2 "circulation status" value 10, "in transit
between library locations"

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

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>
4 years agoBug 26114: ILL should mark status=RET only if a return happened
Tomas Cohen Arazi [Fri, 31 Jul 2020 14:14:20 +0000 (11:14 -0300)]
Bug 26114: ILL should mark status=RET only if a return happened

The original code assumed every codepath should be trated as a
successful check-in. Such is not the case and the regression tests
verify that the code acknowledges this.

To test:
1. Apply the regression tests patch
2. Run:
   $ kshell
  k$ prove t/db_dependent/Illrequests.t
=> FAIL: Tests fail
3. Apply this patch
4. Repeat 2
=> SUCCESS: Tests pass!
5. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
4 years agoBug 26114: Regression tests
Tomas Cohen Arazi [Fri, 31 Jul 2020 14:14:09 +0000 (11:14 -0300)]
Bug 26114: Regression tests

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
4 years agoBug 26132: (QA follow-up) Make tests more robust
Tomas Cohen Arazi [Wed, 12 Aug 2020 17:44:52 +0000 (14:44 -0300)]
Bug 26132: (QA follow-up) Make tests more robust

Tests fail is SearchEngine is set to Elasticsearch. This patch makes
tests build 'real' biblios.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
4 years agoBug 26132: (follow-up) Count all checkouts if no limits needed
Nick Clemens [Tue, 4 Aug 2020 19:01:30 +0000 (19:01 +0000)]
Bug 26132: (follow-up) Count all checkouts if no limits needed

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>
4 years agoBug 26132: Tidy _check_max_qty
Jonathan Druart [Tue, 4 Aug 2020 10:22:06 +0000 (12:22 +0200)]
Bug 26132: Tidy _check_max_qty

This is only a perltidy of _check_max_qty to remove some space
inconsistencies, like:
  if( $max_checkouts_allowed eq '' ){ return;}
  if ( $checkout_count - $onsite_checkout_count >= $max_checkouts_allowed ) {

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>
4 years agoBug 26132: Don't prefetch if not needed
Jonathan Druart [Tue, 4 Aug 2020 10:21:26 +0000 (12:21 +0200)]
Bug 26132: Don't prefetch if not needed

We only need to prefetch items if CircControl is set to ItemHomeLibrary

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>
4 years agoBug 26132: Remove raw SQL query for patron_maxissueqty
Jonathan Druart [Tue, 4 Aug 2020 10:12:56 +0000 (12:12 +0200)]
Bug 26132: Remove raw SQL query for patron_maxissueqty

Same as before but for patron_maxissueqty

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>
4 years agoBug 26132: Remove raw sql query
Jonathan Druart [Tue, 4 Aug 2020 10:05:53 +0000 (12:05 +0200)]
Bug 26132: Remove raw sql query

Making use of Koha::Checkouts make the code much more readable here.
It fixes 2 flaws:
 * $type was not quote escaped
 * the effective itemtype was not used which could lead to wrong
 calculation (for instance item-level_itypes is set but the item does
 not have the itype defined)

However there is something to note, we are going to make things a bit
less effective as we are now fetching the items to get their effective
itemtype (vs a SUM done at DB level)

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>
4 years agoBug 26132: TooMany refactoring
Jonathan Druart [Mon, 3 Aug 2020 16:25:10 +0000 (18:25 +0200)]
Bug 26132: TooMany refactoring

The different calls to _check_max_qty can be improved to highlight what
is really changing between each of them.

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>
4 years agoBug 21946: DBIC schema changes
Jonathan Druart [Thu, 13 Aug 2020 08:14:49 +0000 (10:14 +0200)]
Bug 21946: DBIC schema changes

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
4 years agoBug 21946: DBRev 20.06.00.022
Jonathan Druart [Thu, 13 Aug 2020 08:00:23 +0000 (08:00 +0000)]
Bug 21946: DBRev 20.06.00.022

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
4 years agoBug 21946: Restore defined vs ""
Jonathan Druart [Tue, 4 Aug 2020 08:39:24 +0000 (10:39 +0200)]
Bug 21946: Restore defined vs ""

The tests still pass. Was the original change really useful?

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
4 years agoBug 21946: (follow-up) Restore join to biblioitems
Nick Clemens [Mon, 3 Aug 2020 12:27:15 +0000 (12:27 +0000)]
Bug 21946: (follow-up) Restore join to biblioitems

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
4 years agoBug 21946: (follow-up) Add a hint
Nick Clemens [Wed, 29 Jul 2020 12:08:22 +0000 (12:08 +0000)]
Bug 21946: (follow-up) Add a hint

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
4 years agoBug 21946: (follow-up) Add optgroup label in circ rules
Owen Leonard [Tue, 28 Jul 2020 13:17:54 +0000 (13:17 +0000)]
Bug 21946: (follow-up) Add optgroup label in circ rules

This patch adds a label to the optgroup showing child itemtypes in the
circulation and fine rules interface.

The parent itemtype description is the optgroup label, and then the
parent itemtype is repeated as an <option> with the additional label
"All"

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
4 years agoBug 21946: Add test for parent method
Nick Clemens [Fri, 17 Jul 2020 15:18:09 +0000 (15:18 +0000)]
Bug 21946: Add test for parent method

Signed-off-by: Alex Arnaud <alex.arnaud@biblibre.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
4 years agoBug 21946: Update unit tests to pass under ES
Nick Clemens [Wed, 8 Jan 2020 12:30:41 +0000 (12:30 +0000)]
Bug 21946: Update unit tests to pass under ES

Signed-off-by: Alex Arnaud <alex.arnaud@biblibre.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
4 years agoBug 21946: Display parent-child relationship on smart-rules.pl
Nick Clemens [Tue, 9 Apr 2019 20:00:16 +0000 (20:00 +0000)]
Bug 21946: Display parent-child relationship on smart-rules.pl

To test:
 1 - Set some itemtypes to have a parent
 2 - Browse to Administration -> Circulation and fines rules
 3 - Note new description of parent/child relationships at top of page
 4 - Note that itemtype dropdown for circ rules shows child types under parents
 5 - Set a rule for a child type
 6 - Note it displays as Parent->Child
 7 - Have three child types under a parent
 8 - Set the parent 'Current checkouts allowed' to 3
 9 - Set the children 'Current checkouts allowed' to:
     type1 = 2
     type2 = 1
     type3 = 1
10 - Create some items of the type above
11 - Note you can checkout 2 of type 1, and not 3
12 - Note you can checkout 1 of type 2, but not 2
13 - Note that you now cannot checkout any of type3
14 - Note you cannot checkout any of the parent type
15 - Return one of the other items and note you can now checkout an item of type3
16 - Return another item and note you can checkout an item of the parent type
17 - Return all
18 - Set the parent type to 1
19 - Now note you can only checkout 1 of any of the children
20 - Set the parent to 0
21 - Note you cannot checkout any of the child types

Signed-off-by: Liz Rea <wizzyrea@gmail.com>
Signed-off-by: Lisette Scheer <lisetteslatah@gmail.com>
Signed-off-by: Alex Arnaud <alex.arnaud@biblibre.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
4 years agoBug 21946: Update Administration->Item types to allow for defining parent types
Nick Clemens [Tue, 2 Apr 2019 14:47:16 +0000 (14:47 +0000)]
Bug 21946: Update Administration->Item types to allow for defining parent types

To test:
1 - Browse to Administration -> Item types
2 - Not a new colum for prent type
3 - Edit an existing type and not you can select any type (except the current) as a parent
4 - Select one
5 - Edit the type you selected as parent
6 - Note it cannot have a parent defined
7 - Edit a new type, note you can select a parent

Signed-off-by: Liz Rea <wizzyrea@gmail.com>
Signed-off-by: Lisette Scheer <lisetteslatah@gmail.com>
Signed-off-by: Alex Arnaud <alex.arnaud@biblibre.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
4 years agoBug 21946: Update C4::Circulation->TooMany to check parent itemtypes
Nick Clemens [Wed, 1 May 2019 09:57:50 +0000 (09:57 +0000)]
Bug 21946: Update C4::Circulation->TooMany to check parent itemtypes

To test:
1 - prove -v t/db_dependent/Circulation/TooMany.t

Signed-off-by: Liz Rea <wizzyrea@gmail.com>
Signed-off-by: Lisette Scheer <lisetteslatah@gmail.com>
Signed-off-by: Alex Arnaud <alex.arnaud@biblibre.com>
JD amended patch: tidy the subtest

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
4 years agoBug 21946: Database updates
Nick Clemens [Wed, 13 Mar 2019 00:36:48 +0000 (00:36 +0000)]
Bug 21946: Database updates

Signed-off-by: Liz Rea <wizzyrea@gmail.com>
Signed-off-by: Lisette Scheer <lisetteslatah@gmail.com>
Signed-off-by: Alex Arnaud <alex.arnaud@biblibre.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
4 years agoBug 26179: Add Timothy Alexis Vass to contributors
Jonathan Druart [Thu, 13 Aug 2020 06:09:10 +0000 (08:09 +0200)]
Bug 26179: Add Timothy Alexis Vass to contributors

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
4 years agoBug 5428: Add searchid to the "Return to the record" button (batch del)
Jonathan Druart [Wed, 12 Aug 2020 12:03:00 +0000 (14:03 +0200)]
Bug 5428: Add searchid to the "Return to the record" button (batch del)

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
4 years agoBug 5428: (QA follow-up) Add searchid for deleting items in a batch and editing in...
Nick Clemens [Fri, 7 Aug 2020 00:43:29 +0000 (00:43 +0000)]
Bug 5428: (QA follow-up) Add searchid for deleting items in a batch and editing in batch

To test:
0 - Perform a search in the staff client
1 - Click a title to go to the details page for a record
2 - Click the 'Edit' button and select 'Edit items in a batch'
3 - Note the searchid is in the url
4 - Make a change and hit 'Save'
5 - Note the 'Return the the record' link at the top, and the button on the bottom include searchid in URL
6 - Click one and note the brwoser is stil there
7 - Click 'Edit' and select 'Delete items in a batch'
8 - Delete one item
9 - Click return to record
10 - Browser is there
11 - Click 'Delete items in a batch again
12 - Select all and check 'Delete records if no items remain'
13 - Delete them
14 - Note you have a link to 'Go back to the results'

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
4 years agoBug 5428: Jump back to the search result after deleting a record
Jonathan Druart [Tue, 4 Aug 2020 12:36:38 +0000 (14:36 +0200)]
Bug 5428: Jump back to the search result after deleting a record

This patch adds the ability to jump back to the search result after a
record has been deleted.
Also it keeps the "browser" when all items are deleted from a
bibliographic record

Test plan:
- Start a new search
- Select a record with items
- Delete all the items
=> You still see the browser
- Delete the record
=> You are back to the adv search form but we new link "Go back to the
results" is present at the top of the page

Limitation: As we delete the record we do not longer know the offset,
we are back to the first page of the result list

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>
4 years agoBug 20154: Stay in the open tab when editing authority record
Owen Leonard [Mon, 13 Jul 2020 20:09:17 +0000 (20:09 +0000)]
Bug 20154: Stay in the open tab when editing authority record

This patch adds some JavaScript to the authority record detail page in
the staff interface so that clicking "Edit" will take you to the
authority edit page while keeping the same tab open.

To test, apply the patch and locate an authority record in your catalog.

 - Click any of the numbered tabs besides tab 0.
 - Choose "Edit record" from the "Edit" dropdown menu.
 - When the authorities edit page loads the same tab should be
   preselected.

Signed-off-by: Marjorie <marjorie.barry-vila@collecto.ca>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
4 years agoBug 21345: Patron records with attached files not obvious from patron details view
Owen Leonard [Mon, 27 Jul 2020 15:57:40 +0000 (15:57 +0000)]
Bug 21345: Patron records with attached files not obvious from patron details view

This patch adds a section to the patron details page for listing files
which have been attached to the patron record.

To test, apply the patch and enable the EnableBorrowerFiles system
preference.

- If necessary, attach some files to a patron record by viewing a patron
  record and choosing "Files" from the sidebar menu.
- View the detail page (moremember.pl) for a patron who has files
  attached.
- You should see a new section under "Alternative contact" with the
  heading "Files."
  - Test the "Manage" button to make sure it takes you to that patron's
    files.
  - Confirm that all the attached files are listed.
  - Confirm that the links to each file work correctly.

Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk>
Signed-off-by: Barbara Johnson <barbara.johnson@bedfordtx.gov>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
JD amended patch: replace a html filter with uri

Bug 21345: (follow-up) Hide files information if EnableBorrowerFiles is disabled

This patch wraps the new patron file information in a check for the
EnableBorrowerFiles system preference.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
4 years agoBug 24134: Add placeholder for 2 digit years to allow autogeneration of dates in 008
Owen Leonard [Mon, 2 Dec 2019 16:42:59 +0000 (16:42 +0000)]
Bug 24134: Add placeholder for 2 digit years to allow autogeneration of dates in 008

This patch modifies the code for parsing MARC framework configurations
so that the placeholder "<<YY>>" translates to a two-year date.

To test, apply the patch and modify a framework to include placeholders.
For example, in MARC21:

 - Administration -> MARC structure -> 952 -> Edit subfields -> d
 - Expand "Advanced constraints" and add a default value:
   <<YYYY>> <<YY>> <<MM>> <<DD>> <<USER>>
 - Save your configuration and go to Cataloging.
 - Go to the add/edit items page for a record which uses the framework
   you edited.
 - In the "Add item" form, in the "Date aquired" field, you should see
   the correct values. For example: '2019 19 12 03 Leonard'

Perform the same test when adding an item during the Acquisitions
process (depending on your AcqCreateItem setting).

Note that acqui/neworderempty.pl has been modified because the
placeholder-replacement code is repeated there, but I couldn't discover
how to test it (if it is used at all?)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
4 years agoBug 24176: Add datalastseen column to holdings table
Lucas Gass [Sun, 2 Aug 2020 16:49:59 +0000 (16:49 +0000)]
Bug 24176: Add datalastseen column to holdings table

This patch adds the datelastseen column to the holdings table and also makes it column configurable.
To Test:
-Apply patch and have a look at some item records.
-Notice the datalastseen column
-Make sure it wroks and its displaying the datelastseen correctly
-Go to the column configuration tools and make sure you can properly hide this column.

Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
4 years agoBug 24306: (QA follow-up) Fix the XML
Tomas Cohen Arazi [Tue, 11 Aug 2020 14:45:14 +0000 (11:45 -0300)]
Bug 24306: (QA follow-up) Fix the XML

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
4 years agoBug 24306: (follow-up) Add documentation for debug option
Nick Clemens [Tue, 28 Jul 2020 12:01:05 +0000 (12:01 +0000)]
Bug 24306: (follow-up) Add documentation for debug option

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
4 years agoBug 24306: Add debug switch to koha-indexer
Nick Clemens [Tue, 24 Dec 2019 13:59:02 +0000 (13:59 +0000)]
Bug 24306: Add debug switch to koha-indexer

This raises the debug level a lot, it it a bit overwhelming, but may be useful in debugging indexing issues

To test:
1 - Apply patches
2 - sudo koha-indexer --stop instance
3 - sudo debian/scripts/koha-indexer --start --debug instance
4 - tail -f /var/log/koha/instance/indexer-output.log
5 - Note you get a listing that nothign in the queue
6 - Go to staff client and make a change to a record
7 - Note the logs have tons of info

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>
4 years agoBug 25663: Remove Koha::RefundLostItemFeeRule and uses
Martin Renvoize [Wed, 3 Jun 2020 13:51:42 +0000 (14:51 +0100)]
Bug 25663: Remove Koha::RefundLostItemFeeRule and uses

This patch replaces all calls to RefundLostItemFeeRules with
Koha::CirculationRules->get_lostreturn_policy and removes the module it
makes redundant.

Test plan
1/ Confirm that there are no longer any uses of RefundLostItemFeeRules
in the codebase
2/ Confirm circulation tests still all pass
3/ Confirm you can still set and unset the lost return rules
4/ Signoff

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
4 years agoBug 25663: Add get_lostreturn_policy method to CirculationRules
Martin Renvoize [Wed, 3 Jun 2020 11:59:21 +0000 (12:59 +0100)]
Bug 25663: Add get_lostreturn_policy method to CirculationRules

This patch adds a new get_lostreturn_policy method to
Koha::CirculationRules which returns a boolean to the caller which
denotes whether a refund should be applied or not on the return of
a lost item.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
4 years agoBug 25663: Add unit tests
Martin Renvoize [Wed, 3 Jun 2020 13:13:22 +0000 (14:13 +0100)]
Bug 25663: Add unit tests

This patch adds unit tests for a new get_lostretun_policy method which
is getting added to Koha::CirculationRules.

Test plan:
1/ Read the additions to t/db_dependent/CirculationRules.t code
   and compare to the t/db_dependent/RefundLostItemFeeRule.t.
2/ Run the test after applying the patch that adds the new method
3/ If the tests all pass, signoff

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
4 years agoBug 25879: (follow-up) Update overlooked guarantor markup
Owen Leonard [Sat, 8 Aug 2020 13:30:35 +0000 (13:30 +0000)]
Bug 25879: (follow-up) Update overlooked guarantor markup

This patch updates another section of guarantor markup which should have
been updated with the others.

To test, apply the patch and locate an adult patron.

 - Click "Add guarantee"
 - Confirm that the part of the form for adding a guarantee looks
   correct.
 - Confirm that the new patron information is saved correctly.

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
4 years agoBug 25879: Improve display of guarantor information in the patron entry form
Owen Leonard [Fri, 26 Jun 2020 18:51:15 +0000 (18:51 +0000)]
Bug 25879: Improve display of guarantor information in the patron entry form

This patch makes some changes to the patron entry template to improve
the display of guarantor information.

To test, apply the patch and locate a patron with a "Child" type
category.

 - Edit the patron's record
 - Under "Guarantor information," click the "Search to add" button.
 - Search for and select a patron.
 - The guarantor information should be added to the patron edit
   form. The information should be correct and well formatted.
 - Click the "Remove" link. The guarantor information should be
   removed.
 - Search for an select a guarantor again and save the record.
 - Edit the patron record again. The saved guarantor information should
   look correct.

Looks great!

Signed-off-by: Caroline Cyr La Rose <caroline.cyr-la-rose@inlibro.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
4 years agoBug 25906: Style corrections for OPAC serial pages
Owen Leonard [Sat, 11 Jul 2020 12:09:49 +0000 (12:09 +0000)]
Bug 25906: Style corrections for OPAC serial pages

This patch makes some CSS changes to the OPAC SCSS and to the OPAC
"full serial issues" page to improve the style.

I've expanded the in-page CSS on the full serial issues page for
readability and added Template Toolkit's "collapse" filter to remove the
whitespace on rendering.

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

- Locate a serial record in the OPAC.
- Click "More details" to view the issues page.
- Confirm that the "view" tabs look correct, with consistent padding.
- Click the "Full history" tab.
- In the sidebar, the filter should have full-width dropdowns and clear
  button.

Signed-off-by: Timothy Alexis Vass <timothy_alexis.vass@ub.lu.se>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
4 years agoBug 26008: Remove the use of jquery.checkboxes plugin from OPAC cart
Owen Leonard [Fri, 17 Jul 2020 14:43:39 +0000 (14:43 +0000)]
Bug 26008: Remove the use of jquery.checkboxes plugin from OPAC cart

This patch removes the use of the jquery.checkboxes plugin from the OPAC
cart and replaces its functionality with "plain" jQuery.

To test, apply the patch and add some items to the Cart in the OPAC.

 - Open the Cart window in the OPAC by clicking the "Cart" link in the
   header.
 - Test that the "Select all" and "Clear all" links work correctly to
   check and uncheck all checkboxes.
   - Controls like "Remove" and "Place hold" should be enabled or
     disabled according to whether there are any checked checkboxes.
 - Test that manually checking a checkbox correctly enables or disables
   the link options too.
 - Test that the "Remove" or "Place hold" controls work correctly,
   applying to only the checked checkboxes.

Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Bug 26008: (follow-up) Removed checkboxed class

This patch removes the "checkboxed" class which was previously
associated with the jquery.checkboxes plugin and is now obsolete.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
4 years agoBug 26010: Remove the use of jquery.checkboxes plugin from staff interface cart
Owen Leonard [Fri, 17 Jul 2020 17:29:15 +0000 (17:29 +0000)]
Bug 26010: Remove the use of jquery.checkboxes plugin from staff interface cart

This patch removes the use of the jquery.checkboxes plugin from the
staff interface cart and replaces its functionality with "plain" jQuery.

To test, apply the patch and add some items to the Cart in the staff
interface.

- Open the Cart window in the staff interface by clicking the "Cart"
  link in the header.
- Test that the "Select all" and "Clear all" links work correctly to
  check and uncheck all checkboxes.
- Test that the "Remove" or "Place hold" controls work correctly,
  applying to only the checked checkboxes whether they were checked
  using "Select all" or by manually checking them.

Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
4 years agoBug 26087: Add table configuration and export options to orders by fund report
Owen Leonard [Wed, 29 Jul 2020 13:49:16 +0000 (13:49 +0000)]
Bug 26087: Add table configuration and export options to orders by fund report

This patch adds column configuration to the orders by funds report
results table. The "Basket" column is excluded from being togglable.

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

- Go to Reports -> Orders by fund
- Submit parameters which will return multiple results.
- Test that the "Column visibility" button works to show and hide
  columns. The "Basket" column should be excluded.
- Test the export options (Excel, CSV, etc)
- Go to Administration -> Columns settings and edit the default
  configuration of the orders by fund report. Confirm that these changes
  are reflected in the report results.

Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
4 years agoBug 26091: Add column configuration and export options to catalog statistics report
Owen Leonard [Wed, 29 Jul 2020 16:21:10 +0000 (16:21 +0000)]
Bug 26091: Add column configuration and export options to catalog statistics report

This patch makes the catalog statistics report output a DataTable with
on-the-fly column configuration and export options.

Because the report can generate results with an arbitrary set of table
headers, the columns set to be passed to DataTables is built on the fly
along with the table. There is no global table setting.

Since the "grand total" cell might reflect a total which includes hidden
columns, the table footer label now indicates "all results."

To test, apply the patch and go to Reports.

- Submit a query to the "catalog" statistics wizard which will return
  multiple results.
- On the results page, confirm that the DataTable displays correctly and
  that all controls work as expected, including column configuration and
  export options.
- Submit other queries which will return a different set of columns in
  the result. Confirm that everything continues to work as expected.

Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Bug 26091: (follow-up) Remove unused TablesSettings usage

Since the table column information is built in the template rather than
in the columns_settings YML file we don't need "USE TablesSettings" in
this template.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
4 years agoBug 26160: Make POS items table configurable
Martin Renvoize [Thu, 6 Aug 2020 13:33:32 +0000 (14:33 +0100)]
Bug 26160: Make POS items table configurable

1)  System preference:  EnablePointOfSale - set to Enable
2)  System preference:  UseCashRegisters - set to Use
3)  Administration > Accounting > Cash registers - create a new cash register for the library you're logged in as
4)  Administration > Accounting > Debit types - create at least one debit type
5)  Home > Point of sale - verify that all four columns exist in the Items for purchase table:  Code, Description, Cost, Action
6)  Administration > Additional parameters > Table settings > Point of sale - change which columns can be hidden and/or toggled
7)  Home > Point of sale - verify that your choices have been implemented (columns are hidden, columns can be toggled, columns can't be toggled)
8) Repeat steps 6 and 7 for different combinations, checking that they all work.

Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Added Sally's test plan.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
4 years agoBug 26161: Move actions under rhs fieldsets
Martin Renvoize [Thu, 6 Aug 2020 14:22:07 +0000 (15:22 +0100)]
Bug 26161: Move actions under rhs fieldsets

This patch moves the action buttons div to within the column div that
contains the 'This sale' and 'Collect payment' fieldsets.

Test plan
1/ Apply patch
2/ Navigate to the 'Point of sale' page (having enabled UseCashRegisters
and EnablePointOfSale)
3/ Confirm the 'Confirm' and 'Cancel' button/link now appear on the
correct side.
4/ Signoff

Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
4 years agoBug 26179: Remove redundant import of Google font
Timothy Alexis Vass [Fri, 7 Aug 2020 12:59:16 +0000 (14:59 +0200)]
Bug 26179: Remove redundant import of Google font

Removed redundant @import of google font

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>
4 years agoBug 26012: Correctly format "paid for" info on the item details view
Jonathan Druart [Wed, 29 Jul 2020 14:49:14 +0000 (16:49 +0200)]
Bug 26012: Correctly format "paid for" info on the item details view

The string is built controller side, which does not let the template
format the info nicely.
We want to display patron's info using patron-title.inc and the date
with the KohaDates plugin

Test plan:
- Make sure there is a replacement cost in the item
- check it out
- Mark it lost
- Pay the lost item fee
- Go to the detail page and look on the items tab for the item
- It will show an entry with "Paid for?" label
The patron's info and date must be correctly formatted

Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
4 years agoBug 26165: Fix duplication of large saved reports
Jonathan Druart [Fri, 7 Aug 2020 10:44:28 +0000 (12:44 +0200)]
Bug 26165: Fix duplication of large saved reports

If the combined character length of a saved report's
title, notes and SQL is too long then pressing the
'duplicate' button will lead to an error:

"Request-URI Too Long
The requested URL's length exceeds the capacity limit
for this server."

Test plan:
1. Create a simple SQL report and add a lot of text
   into the notes field (the combined URL lenth must be
   >8225 characters)
2. Save the report
3. Press the duplicate the report from the saved reports page

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>
4 years agoBug 23542: Fix SRU import encoding
Fridolin Somers [Mon, 29 Jun 2020 13:07:10 +0000 (15:07 +0200)]
Bug 23542: Fix SRU import encoding

When importing records from a SRU server, the diacritics have bad encoding.
I reproduce with BNF server so it may be a UNIMARC issue.

Tests show that difference between Z39.50 server and SRU is that leader contains 'a' at postion 9.
Looking at MARC::Record->encoding() shows that encoding depends on leader even for UNIMARC.
So this patch adds a call to MARC::Record->encoding('UTF-8') in case of a SRU server in C4::Breeding.

Same use exists in Koha::MetadataRecord::Authority::get_from_breeding().

In case of import via Z3950, MarcToUTF8Record() is called,
 which calls SetMarcUnicodeFlag(),
 which calls MARC::Record->encoding('UTF-8')

Test plan :
1) Use a UNIMARC database
2) Configure a connexion to a UNIMARC SRU, for example BNF,
   see https://doc.biblibre.com/koha/autour_de_koha/serveurs_z3950_sru#serveur_de_la_bnf
3) Go to cataloguing module
4) Click on 'New from Z39.50/SRU'
5) Choose only the SRU target
6) Search for ISBN 2266072889
7) Confirm you see good encoding : diacritic on 'a' of title 'Strate-a-gemmes'
8) Click on 'Marc preview'
9) Confirm you see good encoding
10) Click import
11) Confirm you see good encoding
12) Check also Authorities import via SRU
13) Check also SRU imports on a MARC21 database

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Amended: Removed change to new_from_xml call. We should respect syntax.
But the added MARC::Record encoding does the tric! Which is implicit
for Z3950 targets where MarcToUTF8Record does the same.
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
4 years agoBug 25882: Remove phr indicator from limits when processing
Nick Clemens [Fri, 26 Jun 2020 13:19:47 +0000 (13:19 +0000)]
Bug 25882: Remove phr indicator from limits when processing

We assume all limits from advanced search to be a phrase and quote them
when doing this we should remove the phrase marker to avoid doulbe quoting

To test:
 1 - Have koha using ES
 2 - Go to advanced search
 3 - Limit by a single itemtype that exists
 4 - Get some results
 5 - Limit by a different itemtype that exists
 6 - Get some results
 7 - Limit by both itemtypes
 8 - Get only the results for the second itemtype
 9 - Enable DumpTemplateVarsIntranet and DumpSearchQueryTemplate
10 - Repeat search
11 - View page source and find 'search_query'
12 - See limit looks like itype:("("BK")" OR "("CR")")
13 - Apply patches
14 - Restart all the things
15 - Repeat search for both itemtypes
16 - Note results now include both types

Signed-off-by: Alex Arnaud <alex.arnaud@biblibre.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
4 years agoBug 25882: Unit test
Nick Clemens [Fri, 26 Jun 2020 13:19:32 +0000 (13:19 +0000)]
Bug 25882: Unit test

Signed-off-by: Alex Arnaud <alex.arnaud@biblibre.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
4 years agoBug 26162: Wait for the table to be refreshed
Jonathan Druart [Mon, 10 Aug 2020 09:59:58 +0000 (11:59 +0200)]
Bug 26162: Wait for the table to be refreshed

The previous patch did not work as expected. We still got a
StaleElementReference exception.
But this time on
10:43:47 selenium_1   | Caused by: org.openqa.selenium.NoSuchElementException: Unable to locate element: {"method":"xpath","selector":"//*[@id=\"branchname\"]"}
Because we found the one that existed on the page, not the one sent back
in AJAX.

The idea of this patch is to search for the "Showing 1 to X of Y entries" info and wait for X == Y

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
4 years agoBug 25826: fix failing test
Jonathan Druart [Mon, 10 Aug 2020 08:00:34 +0000 (10:00 +0200)]
Bug 25826: fix failing test

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
4 years agoBug 24201: fix failing tests
Jonathan Druart [Mon, 10 Aug 2020 07:57:23 +0000 (09:57 +0200)]
Bug 24201: fix failing tests

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
4 years agoBug 24201: (QA follow-up) Replace library select
Martin Renvoize [Fri, 7 Aug 2020 14:38:54 +0000 (15:38 +0100)]
Bug 24201: (QA follow-up) Replace library select

Removing the library select entirely results in a JS failure for desk
selection when independant branches is enabled and the user does not
have permission to select a library.

This patch adds a hidden select element so we can still grab the current
branch from the selection.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
4 years agoBug 24201: (QA follow-up) Make logic consistent
Martin Renvoize [Fri, 7 Aug 2020 14:20:55 +0000 (15:20 +0100)]
Bug 24201: (QA follow-up) Make logic consistent

The display logic for the desk details in the header bar was
inconsistent between the narrow display view and the full width display
view.  This patch updates the former to match the latter.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
4 years agoBug 24201: (QA follow-up) IndependentBranches
Martin Renvoize [Fri, 7 Aug 2020 12:37:30 +0000 (13:37 +0100)]
Bug 24201: (QA follow-up) IndependentBranches

This patch updates the IndependentBranches template display logic such
that the 'Select desk' and 'Select library and desk' options appear
correctly when IndependentBranches is enabled.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
4 years agoBug 24201: (QA follow-up) Add 'and desk' to menus and title
Martin Renvoize [Fri, 7 Aug 2020 10:47:39 +0000 (11:47 +0100)]
Bug 24201: (QA follow-up) Add 'and desk' to menus and title

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
4 years agoBug 24201: (QA follow-up) Another capitalization fix
Josef Moravec [Wed, 5 Aug 2020 05:04:18 +0000 (05:04 +0000)]
Bug 24201: (QA follow-up) Another capitalization fix

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>