]> git.koha-community.org Git - koha.git/log
koha.git
4 years agoBug 20484: Allow configuration of ES before switching to ES
Nick Clemens [Wed, 8 Apr 2020 10:11:38 +0000 (10:11 +0000)]
Bug 20484: Allow configuration of ES before switching to ES

To test:
1 - Set SearchEngine syspref to Zebra
2 - Be a user with permission to manage search engine configuration (manage_search_engine_config)
3 - Confirm you do not see 'Search engine configuration' on Admin main page
4 - Apply patch
5 - Confirm you see it with '(Elasticsearch)' appended
6 - Be a user without above permission
7 - Confirm you cannot see the 'Search engine configuration'
8 - Confirm you cannot access directly:
    /cgi-bin/koha/admin/searchengine/elasticsearch/mappings.pl

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 25135: Improve clarity and navigation of columns settings administration
Owen Leonard [Mon, 13 Apr 2020 17:45:22 +0000 (17:45 +0000)]
Bug 25135: Improve clarity and navigation of columns settings administration

This patch makes some modifications to the columns setting
administration template so that the headings are a little clearer.
In-page navigation is added for each section.

To test, apply the patch and go to Administration -> Columns settings.

 - Confirm that the collapsing panels work correctly.
 - Expand a section and confirm that the "jump to" links work correctly.

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Looks good, works good.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 23349: (follow-up) Correct translation function
Owen Leonard [Fri, 17 Apr 2020 13:32:35 +0000 (13:32 +0000)]
Bug 23349: (follow-up) Correct translation function

This patch corrects the translation function inside results.js. It
should be two underscores instead of one.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 23349: Add batch operations to staff interface catalog search results
Owen Leonard [Mon, 6 Apr 2020 20:39:35 +0000 (20:39 +0000)]
Bug 23349: Add batch operations to staff interface catalog search results

This patch adds three new options to the staff interface catalog search
results for users with cataloging permission: batch edit, batch delete,
and merge. The choices are found in an "Edit" menu which is disabled by
default. Checking any boxes in the search results table enables the
button.

To test, apply the patch and log in to Koha as a user with
edit_catalogue permission.

 - Perform a search in the catalog
 - You should see a disabled "Edit" button in the toolbar at the top of
   the search results table.
 - Check a single checkbox. The button should become enabled.
   - Test the "Batch edit" and "Batch delete" menu items. They should
     work correctly.
   - Test the "Merge records" item. It should warn you that you must
     select at least two records.
 - Check more than one checkbox and test each menu item again. All
   should work as expected.
 - Log in to the staff client as a user who does not have edit_catalogue
   permission. The "Edit" menu should no longer appear on the search
   results page.

Signed-off-by: Abbey Holt <aholt@dubuque.lib.ia.us>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 13557: Add hint for on-site checkouts to list of current checkouts in OPAC
Katrin Fischer [Mon, 13 Apr 2020 21:45:22 +0000 (21:45 +0000)]
Bug 13557: Add hint for on-site checkouts to list of current checkouts in OPAC

In the list of checkouts it's currently not possible for the
patront or tell the difference between normal checkouts (item
is at home with them) and on-site checouts (items remained at
the library). This patch adds a hint to the list of checkouts to
allow differentiating these kinds of checkouts.

To test:
- In your patron account, have multiple checkouts, some on-site,
  some others, overdue items, etc.
- Go to: OPAC > your summary > Checked out
- Verify that there is no hint for the on-site checkouts
- Apply patch
- Check again, there should now be a note

The note also has a class, so would be easy to be hidden
or formatted differently: class="onsite_checkout".

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 21211: Add patron toolbar to suggestions, discharges and ill requests tabs
Katrin Fischer [Tue, 14 Apr 2020 13:14:37 +0000 (13:14 +0000)]
Bug 21211: Add patron toolbar to suggestions, discharges and ill requests tabs

When paging through the patron account in staff, using the tabs on
the right, you notice that some pages are missing the patron toolbar
on top and that the headings, where they exist, vary in size.

This patch adds the patron toolbar to 3 more tabs and changes headings
to h1 to be consistent with older tabs. It has also been suggested on
another tab that this is preferrable for screen readers.

Note: Modification log was left out for now, as this is also used in tools.

To test:
- Activate ILL (ILLModule pref)
- Activate discharges (UseDischarge pref)
- Go to any patron account, tab through the tabs...
- Verify that discharge, purchase suggestions and ill requests are
  missing the toolbar
- Apply patch
- Verify that the toolbar now appears on these pages and works
  correctly
- Also veriy that the headings are now consistently h1 on all pages

Signed-off-by: David Roberts <david@koha-ptfs.co.uk>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 18680: Add an empty entry by default to sort1/sort2 values in patron account
Katrin Fischer [Tue, 14 Apr 2020 16:57:38 +0000 (16:57 +0000)]
Bug 18680: Add an empty entry by default to sort1/sort2 values in patron account

When using sort1/sort2 with authorised values to create a pull down
list, there will be no empty entry unless one is manually added to
the authorised values list.

This is not a good default behaviour, as it can easily
cause errors on patron creation. Without the empty entry, the first
alphabetic value is pre-selected and will be saved if not explicitly
changed. It also doesn't allow to mark sort1/sort2 as mandatory,
as the value is always 'set', the required message won't be triggered.

This adds an empty parameter to av-build-dropbox.inc to allow selectively
adding this empty entry without causing side-effects in other places
this include is used.

To test:
- Create authorised values for either Bsort1 or Bsort2 authorised
  value category
- Create a new patron:
  - you should see a pull down list on one and an input field for the other
  - for the pull down list, there will be no empty entry and the first
    alphabetic value will be preselected
- Make your sort1 and sort2 mandatory using BorrowerMandatoryField
- Verify there is still on empty entry
- Apply patch
- Repeat tests and verify that the behaviour is as expected
  - There should now be an empty entry
  - When the field is marked mandatory and empty is left, the required
    warning will be shown.

Signed-off-by: David Roberts <david@koha-ptfs.co.uk>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 10561: Rephrase DisplayOPACiconsXSLT and DisplayIconsXSLT slightly
Katrin Fischer [Mon, 13 Apr 2020 01:46:25 +0000 (03:46 +0200)]
Bug 10561: Rephrase DisplayOPACiconsXSLT and DisplayIconsXSLT slightly

As the pref removes the whole 'line' of information, this tries to makes
the behaviour a little clearer by adding a 'and descriptions' to the pref
text. It now reads:

[Show|Don't show]  the format, audience, and material type icons and
descriptions in XSLT MARC21 results and detail pages in ...

To test:
- Check both preference descriptions in the staff client
- Verify the text reads correctly and this helps things

Signed-off-by: David Roberts <david@koha-ptfs.co.uk>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 13518: Delete patron's modifications along with the patron
Jonathan Druart [Fri, 17 Apr 2020 09:22:04 +0000 (11:22 +0200)]
Bug 13518: Delete patron's modifications along with the patron

The table borrower_modifications has no FK constraint on the borrowernumber
and will remain untouched when the patron is deleted.
If the borrowernumber doesn't exist in the database, the modification entry is no longer visible in Koha.

The problem is that this table is used for the borrower modifications and the self-registration features.

So far borrowernumber is the PK (int(11) NOT NULL DEFAULT '0'), for the self-registration feature we can have borrowernumber that is not defined (0 is used)

Ideally we would like to have borrowernumber a DEFAULT NULL, and use NULL for self-reg, but then we will loose the PK (PK cannot be NULL).

As we cannot keep the correct constraints at DB level anyway, we will need to handle consistency at code-level.

Test plan:
Create a new patron
Do some modification at the OPAC
Delete the patron
Confirm that the modifications as been removed (directly in DB)

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 25176: Compiled CSS
Martin Renvoize [Mon, 20 Apr 2020 11:17:44 +0000 (12:17 +0100)]
Bug 25176: Compiled CSS

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 25176: Fix style of checkout form
Owen Leonard [Fri, 17 Apr 2020 11:40:36 +0000 (11:40 +0000)]
Bug 25176: Fix style of checkout form

This patch makes a small CSS change in order to fix a display problem
with the checkout form where the form's width doesn't match that of the
"last checked out" message.

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

Check an item out to a patron. Confirm that the green-bordered "Checked
out" message under the checkout form matches the width of the form.

Signed-off-by: David Roberts <david@koha-ptfs.co.uk>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24768: (RM follow-up) Add missing koha_object_class's
Martin Renvoize [Fri, 17 Apr 2020 15:05:43 +0000 (16:05 +0100)]
Bug 24768: (RM follow-up) Add missing koha_object_class's

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24768: Add 'Return claims' to column configuration for checkouts tables
Katrin Fischer [Sat, 11 Apr 2020 10:36:36 +0000 (10:36 +0000)]
Bug 24768: Add 'Return claims' to column configuration for checkouts tables

The checkouts tables on the checkouts and details tabs in the staff
patron account support column confiugration, but the new column
"Return claims" was missing.

This patch adds the column to the column configuration.

To test:
- Make sure to test with a patron having return claims and without
- Verify cou can toggle the visibility of the return claims column
  from top of the tables in the checkouts and details tabs
- Go to administrastion > column configuration
- Change the settings for the issues tables in the Patrons and
  Circulation sections
- Verify the changes have been applied to the tables as configured

Signed-off-by: David Roberts <david@koha-ptfs.co.uk>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 25138: (follow-up) Terminology: Point of sale should use library instead of branch
Devinim [Thu, 16 Apr 2020 11:09:54 +0000 (11:09 +0000)]
Bug 25138: (follow-up) Terminology: Point of sale should use library instead of branch

Signed-off-by: Devinim <kohadevinim@devinim.com.tr>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 25138: Terminology: Point of sale should use library instead of branch
Katrin Fischer [Sun, 12 Apr 2020 02:25:48 +0000 (02:25 +0000)]
Bug 25138: Terminology: Point of sale should use library instead of branch

This fixes the navigation on the Point of sale page:
Branch details => Library details

And the heading and the 'no register defined for this branch/library'
message on the page it links to.

To test:
- Activate cash registers and point of sales features
- Go to the point of sales page
- Verify text on the menu to the left
- Click on the Branch/library details - verify text and heading

Signed-off-by: Devinim <kohadevinim@devinim.com.tr>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 23727: DBRev 19.12.00.077
Martin Renvoize [Fri, 17 Apr 2020 12:48:47 +0000 (13:48 +0100)]
Bug 23727: DBRev 19.12.00.077

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 23727: (QA follow-up) Fix for boolean flags
Martin Renvoize [Thu, 20 Feb 2020 17:15:57 +0000 (17:15 +0000)]
Bug 23727: (QA follow-up) Fix for boolean flags

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 23727: (QA follow-up) Fix script tags
Martin Renvoize [Thu, 20 Feb 2020 17:10:49 +0000 (17:10 +0000)]
Bug 23727: (QA follow-up) Fix script tags

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 23727: Editing course reserve items is broken
Kyle M Hall [Fri, 14 Feb 2020 20:22:17 +0000 (15:22 -0500)]
Bug 23727: Editing course reserve items is broken

Adding an item to course reserves and trying to edit any values in a second step does not work. Values are not saved and the table shows all values as "Unchanged".

This patch set adds two new sets of columns to the course_items table.

The first set determines if the specified column should be swapped or
not. The was previously 'implied' by the column being set to undef which
has been the root problem with that way of knowing if a column should
swap or not.

The second set of new columns are for storing the item field values
while the item is on course reserve. Previously, the column values
were swapped between the items table and the course_items table,
which leaves ambiguity as to what each value is. Now, the original
columns *always* store the value when the item is on course reserve,
and the new storage columns store the original item value while the
item is on reserve, and are NULL when an item is *not* on reserve.

Test Plan:
1) Apply this patch
2) Add and edit course items, not the new checkboxes for enabling fields
3) Everything should function as before

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 23727: Add Koha Object(s) related to course reserves
Kyle M Hall [Fri, 14 Feb 2020 13:57:05 +0000 (08:57 -0500)]
Bug 23727: Add Koha Object(s) related to course reserves

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 23727: Update Schema
Kyle M Hall [Fri, 14 Feb 2020 13:45:11 +0000 (08:45 -0500)]
Bug 23727: Update Schema

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 23727: Add new columns
Kyle M Hall [Fri, 14 Feb 2020 13:41:28 +0000 (08:41 -0500)]
Bug 23727: Add new columns

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 21901: (RM follow-up) Use TestBuilder to fix tests
Martin Renvoize [Fri, 17 Apr 2020 12:36:39 +0000 (13:36 +0100)]
Bug 21901: (RM follow-up) Use TestBuilder to fix tests

A few tests failed due to missing values for foreign key relationships.
Switching to TestBuilder for data mocking resolves this elegantly.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 23463: Remove double store call
Jonathan Druart [Fri, 17 Apr 2020 08:42:21 +0000 (10:42 +0200)]
Bug 23463: Remove double store call

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 22887: (RM follow-up) Restore warnings in updatedatabase
Martin Renvoize [Fri, 17 Apr 2020 09:20:27 +0000 (10:20 +0100)]
Bug 22887: (RM follow-up) Restore warnings in updatedatabase

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 21901: DBRev 19.12.00.076
Martin Renvoize [Fri, 17 Apr 2020 09:17:32 +0000 (10:17 +0100)]
Bug 21901: DBRev 19.12.00.076

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 21901: (QA follow-up) Add a few NOT NULL constraints in dbrev
Marcel de Rooy [Fri, 17 Apr 2020 08:04:14 +0000 (08:04 +0000)]
Bug 21901: (QA follow-up) Add a few NOT NULL constraints in dbrev

We need to specify NOT NULL on subscription and -history as well.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 21901: Add a warning if we removed entries
Jonathan Druart [Mon, 9 Mar 2020 14:25:29 +0000 (15:25 +0100)]
Bug 21901: Add a warning if we removed entries

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 21901: (QA follow-up) Ensure consistent data before adding keys
Martin Renvoize [Fri, 31 Jan 2020 13:21:41 +0000 (13:21 +0000)]
Bug 21901: (QA follow-up) Ensure consistent data before adding keys

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 21901: Add FK on subscription and serial tables
Jonathan Druart [Wed, 11 Dec 2019 07:29:27 +0000 (08:29 +0100)]
Bug 21901: Add FK on subscription and serial tables

In order to improve performance in the serial modules and add DB constraints,
this patch is going to add missing foreign key on the following columns:
 * serial.biblionumber
 * serial.subscription
 * subscriptionhistory.biblionumber
 * subscriptionhistory.subscriptionid
 * subscription.biblionumber

Once done, some code can be removed from the Del* subroutines, as the ON
CASCASE clause will make the RDBMS handles the deletions.

Test plan:
0/ It would be useful to test the update DB entry on a big and old
production DB, to make sure the constraints will be added correctly.
We could remove the entries before creating the constraints, but it can
be unecessary
1/ Make sure you can recreate a fresh install with the kohastructure.sql
from this patch
2/ Make sure you can upgrade from a master install
3/ Create a subscription, serial, etc. and delete the biblio
=> The subscription/serials should have been deleted from the DB
4/ Create a subscription, serial, etc. and delete the subscription
=> The serials should have been deleted from the DB

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 25016: Coce should not return a 1-pixel Amazon cover image
Owen Leonard [Sun, 29 Mar 2020 00:19:39 +0000 (00:19 +0000)]
Bug 25016: Coce should not return a 1-pixel Amazon cover image

This patch adds an onload function to the JavaScript which loads images
from Coce. In the case where the image is 1 x 1 pixel the image should
be removed.

To test you should have Coce enabled and Amazon.com included in the list
of sources.

 - Apply the patch and view the bibliographic details page under a
  variety of conditions:
   - A title which has a matching Amazon image:
     - The image should load as expected.
   - A title which doesn't have a matching Amazon image
     - The image should not be found in the source at all after the page
       has loaded.
  - Test with local cover images enabled

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24715: Cache repeatable subfield in TransformKohaToMarc
Marcel de Rooy [Mon, 24 Feb 2020 12:52:13 +0000 (12:52 +0000)]
Bug 24715: Cache repeatable subfield in TransformKohaToMarc

Implemented by calling GetMarcSubfieldStructure and improving
_check_split which may check repeatability in a specific framework,
and return the framework hash.

Test plan:
Run t/db_dependent/Biblio/TransformKohaToMarc.t
Optionally, follow the test plan of bug 21800#comment7.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Ere Maijala <ere.maijala@helsinki.fi>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 20116: Cache language list
Jonathan Druart [Wed, 31 Jan 2018 17:51:22 +0000 (14:51 -0300)]
Bug 20116: Cache language list

Signed-off-by: Liz Rea <wizzyrea@gmail.com>
Signed-off-by: Bouzid Fergani <bouzid.fergani@inlibro.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 20116: Flush the caches
Jonathan Druart [Wed, 16 May 2018 20:26:09 +0000 (17:26 -0300)]
Bug 20116: Flush the caches

When languages are added or removed when need to flush the caches to
keep the interface consistent

Signed-off-by: Liz Rea <wizzyrea@gmail.com>
Signed-off-by: Bouzid Fergani <bouzid.fergani@inlibro.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 20116: Prepare the ground
Jonathan Druart [Wed, 31 Jan 2018 17:36:22 +0000 (14:36 -0300)]
Bug 20116: Prepare the ground

Just refactoring to make the next patch more readable

Signed-off-by: Liz Rea <wizzyrea@gmail.com>
Signed-off-by: Bouzid Fergani <bouzid.fergani@inlibro.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 25011: Improve display of MARC21 508 - Production credits in staff and OPAC
Katrin Fischer [Fri, 27 Mar 2020 22:48:56 +0000 (23:48 +0100)]
Bug 25011: Improve display of MARC21 508 - Production credits in staff and OPAC

Makes some tiny changes to improve display and consistency between
OPAC and staff:
- Capitalization fix: Production Credits - Production credits
- Changes div to span avoiding display issues
- Make sequence of fields in display match (505, 508, 586)

To test:
- Catalog one or more records with none, one and multiple 508 $a
- Check and compare the staff and OPAC detail pages, both
  should display the production credits information correctly

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 20101: Cronjob automatic_item_modification_by_age.pl does not log run in action...
Kyle M Hall [Tue, 30 Jan 2018 16:10:07 +0000 (11:10 -0500)]
Bug 20101: Cronjob automatic_item_modification_by_age.pl does not log run in action logs

C4::Log::cronlogaction() was never implemented in automatic_item_modification_by_age.pl.

Test Plan:
1) Apply this patch
2) Enable CronjobLog
3) Run automatic_item_modification_by_age.pl succesfully
4) Note the run is noted in the action logs

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 25086: DBRev 19.12.00.075
Martin Renvoize [Fri, 17 Apr 2020 08:13:13 +0000 (09:13 +0100)]
Bug 25086: DBRev 19.12.00.075

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 25086: Set changed_fields column as nullable
Agustin Moyano [Wed, 8 Apr 2020 19:53:43 +0000 (16:53 -0300)]
Bug 25086: Set changed_fields column as nullable

This patch changed_fields column as nullable.

To test:
1. Do not apply any patch
2. Set PatronSelfRegistrationVerifyByEmail preference to require
3. Fill self registration form in opac and submit
CHECK => OPAC dies with a nasty message, that says Field 'changed_fields' doesn't have a default value
4. Apply this patch and updatedatabase
5. Repeat step 3
SUCCESS => Registry process continues as expected
6. Sign off

Sponsored-by: Orex Digital
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 25147: (RM follow-up) Update pref references.
Martin Renvoize [Fri, 17 Apr 2020 08:02:58 +0000 (09:02 +0100)]
Bug 25147: (RM follow-up) Update pref references.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 25147: (RM follow-up) Update display
Martin Renvoize [Fri, 17 Apr 2020 07:30:40 +0000 (08:30 +0100)]
Bug 25147: (RM follow-up) Update display

I missed the display change in the preference name change.. oops.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 25147: DBRev 19.12.00.074
Martin Renvoize [Fri, 17 Apr 2020 07:24:57 +0000 (08:24 +0100)]
Bug 25147: DBRev 19.12.00.074

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 25147: Clarify section name
Martin Renvoize [Fri, 17 Apr 2020 07:18:44 +0000 (08:18 +0100)]
Bug 25147: Clarify section name

Clarify the preference section headings for Self-checkout and
Self-checkin.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 25147: Rename preference
Martin Renvoize [Fri, 17 Apr 2020 07:16:10 +0000 (08:16 +0100)]
Bug 25147: Rename preference

This patch renames the preference from the ambiguous 'AllowSelfCheckReturns'
to 'SCOAllowCheckin' which is more consistent with other preferences
affecting this module.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 25152: (RM follow-up) Correction to update description
Martin Renvoize [Fri, 17 Apr 2020 06:55:09 +0000 (07:55 +0100)]
Bug 25152: (RM follow-up) Correction to update description

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 25147: AllowSelfCheckReturns is in the wrong system preference section
Martin Renvoize [Fri, 17 Apr 2020 06:51:16 +0000 (07:51 +0100)]
Bug 25147: AllowSelfCheckReturns is in the wrong system preference section

This reverts commit 8aa9f2cc078932a0a4db434f8bd793de29a8ff7b.

I agree with the following comment and as such have reverted the patch.

Quoting Phil Ringnalda <phil@chetcolibrary.org>:

  Everything currently in the chunk labelled "Self Checkout" is
  preferences used to control sco-main.pl, a feature that does checkout
  and renewal, and optionally with the preference AllSelfCheckReturns,
  also checkin.

  Everything currently in the chunk labelled "Self check-in module" is
  preferences used to control sci-main.pl, a separate feature that does
  only checkin, and does checkin whether or not AllowSelfCheckReturns is
  set.

  I'd think a better solution would be to either rename the preference,
  which is actually AllowReturnsInSelfCheckout, or rename the chunks to
  make it more clear that they are preferences for two different features.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 25147: AllowSelfCheckReturns is in the wrong system preference section
David Roberts [Wed, 15 Apr 2020 16:34:40 +0000 (16:34 +0000)]
Bug 25147: AllowSelfCheckReturns is in the wrong system preference section

This patch moves the AllowSelfCheckReturns system preference to the "Self check-in module" section of the Circulation system preferences.

To test:

1) Check that the AllowSelfCheckReturns system preference is currently
in the "Self Checkout" section of the Circulation system preferences.
2) Apply the patch
3) The preference should now be in the "Self check-in module" section of
the Circulation system preferences.

Signed-off-by: Devinim <kohadevinim@devinim.com.tr>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 25136: Join the 2 ifs
Jonathan Druart [Thu, 16 Apr 2020 09:51:32 +0000 (11:51 +0200)]
Bug 25136: Join the 2 ifs

Highlight that we only need this for action="new"

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 25136: Make PatronSelfRegistrationLibraryList only effect new registration
Lucas Gass [Wed, 15 Apr 2020 22:46:23 +0000 (22:46 +0000)]
Bug 25136: Make PatronSelfRegistrationLibraryList only effect new registration

This patch makes it so PatronSelfRegistrationLibraryList will only effect the registration from and not the modification form.
TO TEST:
1. Turn on self reg and add some libaries to PatronSelfRegistrationLibraryList.
2. Notice that the libaries that display in the borrower_branchcode dropdown are the ones you selected on both the new registration from and the modification form.
3. Apply patch.
4. Now only the new registration from should show libaries on PatronSelfRegistrationLibraryList.
5. The modifciation dropdown should still show all libraries.

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 25007: (follow-up) Fix the way image check alters layout
Owen Leonard [Sat, 28 Mar 2020 17:42:50 +0000 (17:42 +0000)]
Bug 25007: (follow-up) Fix the way image check alters layout

A question in the bug report asks: Why is is necessary to change the
Bootstrap class to col-xs-12? The JavaScript which checks for the
existence of an Amazon cover image is designed to remove the Amazon
cover's container if there is none. Changing the class of
cover image column is gone.

However, the check is incorrect because it doesn't account for Local
Covers. There might be both a 1 x 1 pixel Amazon image and a local cover
image, so the layout shouldn't be changed unless there are no images
present.

To test, apply the patch and view the bibliographic details page of
various titles including:
- Amazon cover present, no local cover
- No Amazon cover, local cover image present
- Both Amazon and local cover image

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 25007: Check for normaalized ISBN when building Amazon link
Lucas Gass [Fri, 27 Mar 2020 20:40:30 +0000 (20:40 +0000)]
Bug 25007: Check for normaalized ISBN when building Amazon link

TO RECREATE:
-Have Amazon images turned on and local images too.
-Have a record with a local cover image
-Make sure the record has no ISBN in 020 field.
-Load detail page of that record and see that the local cover images is
 not on the right hand side like it should be but forced underneath
 'catalogue_detail_biblio' in an odd spot.
-Apply patch and reload page
-The image should be back in its normal spot

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 25131: (QA follow-up) Move test for needs_install outside the plugin
Tomas Cohen Arazi [Wed, 15 Apr 2020 14:48:23 +0000 (11:48 -0300)]
Bug 25131: (QA follow-up) Move test for needs_install outside the plugin

This follow-up patch moves the check outside the register routine. The
Mojo plugin won't be loaded unless there's no need to install.

As the original tests rely on V1.pm to be able to load the plugin, they
are still valid, and they should still pass as there's no behaviour
change.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 25131: Skip loading API plugins if Koha is not installed
Tomas Cohen Arazi [Tue, 14 Apr 2020 19:24:38 +0000 (16:24 -0300)]
Bug 25131: Skip loading API plugins if Koha is not installed

This patch adds a check on Koha being actually installed to the
PluginRoutes Mojolicious plugin.

If Koha is not installed, plugin routes won't be tried to get installed.
This has the effect of making the webinstaller functional again (when
enable_plugins is set to 1).

To test:
1. Apply the regression tests patch
2. Run:
   $ kshell
  k$ prove t/db_dependent/Koha/REST/Plugin/PluginRoutes.t
=> FAIL: Tests fail!
3. Apply this patch
4. Repeat 2
=> SUCCESS: Tests pass!
5. Reset your working branch
6. Delete your database (e.g. in koha-testing-docker):
   $ mysql -hdb -ppassword
   > DROP DATABASE koha_kohadev;
   > CREATE DATABASE koha_kohadev; \q
7. Set enable_plugins to 1 in koha-conf.xml
8. Restart all:
   $ service memcached restart
   $ koha-plack --restart kohadev
9. Open the staff interface
=> FAIL: Hangs, the logs show nasty errors (koha-plack-err)
10. Apply this patches
11. Restart all
12. Repeat 10
=> SUCCESS: The web installer shows up :-D
13. Sign off :-D

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 25131: Regression tests
Tomas Cohen Arazi [Tue, 14 Apr 2020 19:24:33 +0000 (16:24 -0300)]
Bug 25131: Regression tests

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 25131: Add C4::Context->needs_install
Tomas Cohen Arazi [Tue, 14 Apr 2020 19:21:37 +0000 (16:21 -0300)]
Bug 25131: Add C4::Context->needs_install

This trivial patch adds a new convenient way to ask if Koha is
installed. It uses the same approach as C4::Auth:730

To test:
1. Apply this patch
2. Run:
   $ kshell
  k$ t/Context.t
=> SUCCESS: Tests pass!
3. Sign off :-D

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24131: Prevent the first description to be displayed twice
Jonathan Druart [Wed, 15 Apr 2020 13:17:11 +0000 (15:17 +0200)]
Bug 24131: Prevent the first description to be displayed twice

If there are several lines to display, the first one was displayed
twice:
Upgrade to 19.12.00.071 done [13:10:22]: Bug 22887 - Add unique constraint to authorised_values
                                                   - Add unique constraint to authorised_values
                                                   - WARNING - Cannot create unique constraint on authorised_value(category, authorised_value)
                                                   - The following entries are duplicated: COUNTRY:aaa (2)

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 22887: Remove superfluous warn statements
Jonathan Druart [Wed, 15 Apr 2020 13:04:16 +0000 (15:04 +0200)]
Bug 22887: Remove superfluous warn statements

We print them in the description later

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 22887: Fix SQL syntax for MySQL 5.5
Jonathan Druart [Wed, 15 Apr 2020 13:03:15 +0000 (15:03 +0200)]
Bug 22887: Fix SQL syntax for MySQL 5.5

This does not happen on MySQL 8 or latest MariaDB, but does on MySQL 5.5

"Non-grouping field 'c' is used in  HAVING clause"

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 25152: DBRev 19.12.00.073
Martin Renvoize [Wed, 15 Apr 2020 11:37:24 +0000 (12:37 +0100)]
Bug 25152: DBRev 19.12.00.073

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 25152: Make subscription.closed tinyint(1)
Jonathan Druart [Wed, 15 Apr 2020 09:29:21 +0000 (11:29 +0200)]
Bug 25152: Make subscription.closed tinyint(1)

https://wiki.koha-community.org/wiki/Coding_Guidelines#SQL12:_Booleans

Boolean fields must be tinyint(1), not int(1)

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 22468: Standardize on labelling ccode table columns as Collections
Katrin Fischer [Mon, 13 Apr 2020 02:32:56 +0000 (04:32 +0200)]
Bug 22468: Standardize on labelling ccode table columns as Collections

We now display the descriptions everywhere, so we should drop the
'code' from labels.

This changes text in a lot of playes in Koha, including:

- The relatives checkouts table when displayed for the guarantor
- The new order and order receive forms in acquisitoins (item creation)
- The description of CCODE in the authorised values table
- The column description on results in item search
- The branch tranfers page
- Course reserves: add reserve items (one and in batch)
- Patron account > statistics tab

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24939: Fix capitalization of labels in sys pref editor
Katrin Fischer [Mon, 13 Apr 2020 02:18:36 +0000 (04:18 +0200)]
Bug 24939: Fix capitalization of labels in sys pref editor

The headings/labels of sections in the sys pref editor didn't follow
Koha's capitalization rules.

To test:
- Go to Administration > System preferences
- Check all tabs for the spelling of the headings

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24380: DBRev 19.12.00.072
Martin Renvoize [Wed, 15 Apr 2020 11:30:12 +0000 (12:30 +0100)]
Bug 24380: DBRev 19.12.00.072

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24380: (QA follow-up) Simplify condition
Jonathan Druart [Wed, 15 Apr 2020 10:44:47 +0000 (12:44 +0200)]
Bug 24380: (QA follow-up) Simplify condition

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24380: (QA follow-up) Do not use compare float with precision
Jonathan Druart [Wed, 15 Apr 2020 10:48:44 +0000 (12:48 +0200)]
Bug 24380: (QA follow-up) Do not use compare float with precision

Forbidden pattern: Do not use compare float with precision (bug 24408).

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24380: Add syspref CalculateFinesOnBackdate
Kyle M Hall [Wed, 8 Apr 2020 14:39:28 +0000 (10:39 -0400)]
Bug 24380: Add syspref CalculateFinesOnBackdate

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24380: Backdated returns do not update fines unless CalculateFinesOnReturn is...
Kyle M Hall [Wed, 8 Jan 2020 20:27:31 +0000 (15:27 -0500)]
Bug 24380: Backdated returns do not update fines unless CalculateFinesOnReturn is enabled

In Koha 18.11 backdating a return triggered a recalculation of the fine. This was removed in bug 14591, and I believe it was in error. The bug report itself has no justification for the change in behavior.

Test Plan:
1) Disable CalculateFinesOnReturn
2) Backdate an overdue with fines, note the fine does not change
3) Apply this patch
4) Repeat step 2
5) The fine should be updated!

Signed-off-by: Kelly McElligott <kelly@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24380: Unit Test
Kyle M Hall [Wed, 22 Jan 2020 19:01:14 +0000 (14:01 -0500)]
Bug 24380: Unit Test

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 25120: Make accounting the default tab when opening the pref editor
Katrin Fischer [Sat, 11 Apr 2020 13:40:39 +0000 (13:40 +0000)]
Bug 25120: Make accounting the default tab when opening the pref editor

The default/active tab when opening the sys pref editor used
to be 'Acquisitions' as the first tab, but should now be the new
first 'Accounting'

To test:
- Go to Administration > System preferences
- Verify the Aquisition tab is second and preselected
- Apply patch
- Repeat
- Verify now Accounting is selected

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 22784: (QA follow-up) booleans should be TINYINT
Tomas Cohen Arazi [Tue, 14 Apr 2020 20:02:24 +0000 (17:02 -0300)]
Bug 22784: (QA follow-up) booleans should be TINYINT

As per the coding guidelines, they should be TINYINT(1).

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24820: (RM follow-up) Fix test after switch to 'date' field
Martin Renvoize [Wed, 15 Apr 2020 10:51:12 +0000 (11:51 +0100)]
Bug 24820: (RM follow-up) Fix test after switch to 'date' field

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 25137: (bug 23084 follow-up) Fix incorrect grep ternary condition
Jonathan Druart [Tue, 14 Apr 2020 10:00:01 +0000 (12:00 +0200)]
Bug 25137: (bug 23084 follow-up) Fix incorrect grep ternary condition

The lack of parenthesis makes the condition evaluated wrong.

Test plan:
- confirm you have a branch with code X
- enter X in PatronSelfRegistrationLibraryList
- go to cgi-bin/koha/opac-memberentry.pl (either as a logged in patron or as a self-reg patron)
- confirm branch dropdown is not empty and contain X
- empty out PatronSelfRegistrationLibraryList
- reload cgi-bin/koha/opac-memberentry.pl and confirm branches show

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24820: Use 'date' instead of 'timestamp' for cashup
Martin Renvoize [Fri, 6 Mar 2020 11:38:03 +0000 (11:38 +0000)]
Bug 24820: Use 'date' instead of 'timestamp' for cashup

Prior to this patch we were comparing cash register action timestamp to
accountlines date fields to fetch the list of outstanding accountlines.

accountlines.date is a transient field used as 'updated_on' and so this
was a logical mistake. We should be using the 'date' field which is
fixed 'created_on' time.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 25139: Corrections to date picker handling
Martin Renvoize [Tue, 14 Apr 2020 09:16:58 +0000 (10:16 +0100)]
Bug 25139: Corrections to date picker handling

It would appear one has to format the dates in the controller rather
than in the template for input fields.. I wasn't aware of this caveat
until now.

Test plan
1/ Prior to applying patch attempt to look at previous transactions
ensuring you enter a 'to' date.
2/ Note a catastrophic failure
3/ Apply patch
4/ Look at the same date range and note you no longer get a failure but
are instead faced with the requested transactions.
5/ Signoff

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24697: Split items.uri on staff detail view
Marcel de Rooy [Thu, 20 Feb 2020 12:10:57 +0000 (12:10 +0000)]
Bug 24697: Split items.uri on staff detail view

If there are more URIs, we split on vertical bar and show the real URL
instead of duplicated text. Otherwise display depends on the pref
URLLinkText.

Test plan:
Create item with uri = A | B | C
Create another item with uri = D
Check the results on staff detail view (items table).

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 22887: (RM follow-up) Fix Charges Test
Martin Renvoize [Tue, 14 Apr 2020 18:51:45 +0000 (19:51 +0100)]
Bug 22887: (RM follow-up) Fix Charges Test

The charges test added a duplicate authorised value needlessly (it's
already present in the sample data).

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 22887: DBRev 19.12.00.071
Martin Renvoize [Tue, 14 Apr 2020 16:21:25 +0000 (17:21 +0100)]
Bug 22887: DBRev 19.12.00.071

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 22887: Remove dup fr-FR for existing installs
Jonathan Druart [Tue, 14 Apr 2020 08:12:57 +0000 (10:12 +0200)]
Bug 22887: Remove dup fr-FR for existing installs

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 22887: Schema changes
Lari Taskula [Tue, 7 Apr 2020 11:47:44 +0000 (11:47 +0000)]
Bug 22887: Schema changes

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 22887: Rely on unique constraint in av admin
Jonathan Druart [Thu, 26 Mar 2020 09:29:11 +0000 (10:29 +0100)]
Bug 22887: Rely on unique constraint in av admin

Test plan:
Try to create 2 AV with the same code for the same category.
You should see a warning

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Lari Taskula <lari.taskula@hypernova.fi>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 22887: Remove dup in fr-FR av.sql
Jonathan Druart [Thu, 26 Mar 2020 09:36:03 +0000 (10:36 +0100)]
Bug 22887: Remove dup in fr-FR av.sql

https://en.wikipedia.org/wiki/Cocos_(Keeling)_Islands
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Lari Taskula <lari.taskula@hypernova.fi>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 22887: Warn if duplicates exist
Jonathan Druart [Thu, 26 Mar 2020 09:28:50 +0000 (10:28 +0100)]
Bug 22887: Warn if duplicates exist

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 22887: Add unique constraint to authorised_values
Martin Renvoize [Fri, 10 May 2019 14:32:03 +0000 (15:32 +0100)]
Bug 22887: Add unique constraint to authorised_values

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24620: Fix test, remove replaced code, use dt_from_string
Nick Clemens [Tue, 10 Mar 2020 11:12:07 +0000 (07:12 -0400)]
Bug 24620: Fix test, remove replaced code, use dt_from_string

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24620: Close existing transfers when setting item to waiting
Nick Clemens [Mon, 10 Feb 2020 18:19:07 +0000 (18:19 +0000)]
Bug 24620: Close existing transfers when setting item to waiting

This patch adds a clause in ModReserveAffect to check if there
are existing transfers and close them when setting a hold to waiting

To test:
 1 - Set AutomaticItemReturn to Do
 2 - Checkin an item from Library B at Library A
 3 - Confirm item is in transfer (check the details page)
 4 - Place a item level hold for pickup at library A
 5 - Checkin the item at Library A
 6 - Confirm the hold
 7 - View the details page
 8 - Note the item is in transit and waiting
 9 - Apply patch
10 - Delete hold and repeat
11 - Confirm that transfer is closed when hold marked waiting

Signed-off-by: Sally <sally.healey@cheshirewestandchester.gov.uk>
Signed-off-by: Stina Hallin <stina.hallin@ub.lu.se>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24620: Unit tests
Nick Clemens [Mon, 10 Feb 2020 18:18:45 +0000 (18:18 +0000)]
Bug 24620: Unit tests

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 23571: (QA follow-up) Remove perlcritic warning
Jonathan Druart [Tue, 14 Apr 2020 08:18:31 +0000 (10:18 +0200)]
Bug 23571: (QA follow-up) Remove perlcritic warning

Bareword file handle opened at line 138, column 5.  See pages 202,204 of PBP.  (Severity: 5)

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 23571: (QA follow-up) Add missing newline in warning
Tomas Cohen Arazi [Mon, 13 Apr 2020 18:50:54 +0000 (15:50 -0300)]
Bug 23571: (QA follow-up) Add missing newline in warning

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 23571: Prevent concurrent execution of fines.pl
Tomas Cohen Arazi [Sun, 12 Apr 2020 13:27:57 +0000 (10:27 -0300)]
Bug 23571: Prevent concurrent execution of fines.pl

This patch introduces locking in fines.pl. It does so by leveraging on
bug 25109, which introduces a generic locking implementation on
Koha::Script.

The introduced changes:
1. Try to get the lock
2.a. If success, normal execution happens
2.b. If rejected, cronlogaction is called with a meaningful message and
  a normal exit happens, so we don't flood the logs in vain. --verbose
  will make the script print the same message on STDERR, as already is
  the case with this script

To test:
1. Apply this patch
2. In two separate consoles run:
   $ kshell
  k$ perl misc/cronjobs/fines.pl --verbose
SUCCESS => The first one runs normally, the second one exists really fast
  and prints a message about the lock.
3. Sign off :-D

Sponsored-by: Orex Digital
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 25109: (QA follow-up) Add a test for lockdir writable in about.pl
Tomas Cohen Arazi [Mon, 13 Apr 2020 18:45:50 +0000 (15:45 -0300)]
Bug 25109: (QA follow-up) Add a test for lockdir writable in about.pl

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 25109: (QA follow-up) Fix typo in configuration entry name
Tomas Cohen Arazi [Mon, 13 Apr 2020 15:02:29 +0000 (12:02 -0300)]
Bug 25109: (QA follow-up) Fix typo in configuration entry name

This patch fixes an error in the configuration retrieving line.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 25109: Add 'wait' tests
Tomas Cohen Arazi [Mon, 13 Apr 2020 11:43:10 +0000 (08:43 -0300)]
Bug 25109: Add 'wait' tests

This simple patch introduces a test for the lock waiting scenario. It
replicates the previous tests, but calls a script that passes the wait
=> 1 parameter to ->lock_exec.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 25109: Add ->new and ->lock_exec to Koha::Script
Tomas Cohen Arazi [Fri, 10 Apr 2020 22:37:31 +0000 (19:37 -0300)]
Bug 25109: Add ->new and ->lock_exec to Koha::Script

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 25109: Add entry in about.pl about the configuration lockdir entry
Tomas Cohen Arazi [Fri, 10 Apr 2020 22:36:41 +0000 (19:36 -0300)]
Bug 25109: Add entry in about.pl about the configuration lockdir entry

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 25109: Add lockdir configuration entry
Tomas Cohen Arazi [Fri, 10 Apr 2020 22:36:09 +0000 (19:36 -0300)]
Bug 25109: Add lockdir configuration entry

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 23871: data inconsistencies - check title exists
Fridolin Somers [Tue, 22 Oct 2019 12:31:08 +0000 (14:31 +0200)]
Bug 23871: data inconsistencies - check title exists

In biblio records, a field must be linked to biblio.title.
200$a in UNIMARC, 100$a MARC21 (and other).

If this field is undefined, some pages like checkouts table can fail.

Test plan :
1) Remove biblio title in SQL :
   UPDATE biblio SET title='' WHERE biblionumber=XXX
2) Run misc/maintenance/search_for_data_inconsistencies.pl
3) You see the record as an inconsistency
4) Reset a title
   UPDATE biblio SET title='50 shades of Grey' WHERE biblionumber=XXX
5) Run misc/maintenance/search_for_data_inconsistencies.pl
6) Record is no longer an inconsistency

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 21865: allow test arg alone
Fridolin Somers [Wed, 11 Mar 2020 14:39:18 +0000 (17:39 +0300)]
Bug 21865: allow test arg alone

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 21865: add confirm to remove_unused_authorities.pl script
Fridolin Somers [Mon, 19 Nov 2018 14:45:49 +0000 (15:45 +0100)]
Bug 21865: add confirm to remove_unused_authorities.pl script

Like in most scripts in misc, add confirm argument
to ensure script is not run without knowing what it does.

Test plan:
1) Run misc/migration_tools/remove_unused_authorities.pl -h
2) You see help line for confirm
3) Run misc/migration_tools/remove_unused_authorities.pl
4) You see help and script does nothing
5) Run misc/migration_tools/remove_unused_authorities.pl -c
6) Script runs like wanted

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 21865: ES compatiblity of remove_unused_authorities.pl
Fridolin Somers [Mon, 19 Nov 2018 14:19:46 +0000 (15:19 +0100)]
Bug 21865: ES compatiblity of remove_unused_authorities.pl

The script misc/migration_tools/remove_unused_authorities.pl directly checks if Zebra search is OK.

This patch changes so that this test is only if Zebra is the search engine.
It also adds a test on the search off any authority number indexed (index 'an').
With Zebra its : an,alwaysmatches=''
With ES its : an:*
This test ensure that biblios records are indexed and that not all autorities will be deleted.

Test plan:
1) On a catalog create a new authority
2) Use Zebra in systempreference SearchEngine
3) Stop Zebra server
4) Run misc/migration_tools/remove_unused_authorities.pl -c
5) The script does nothing and says :
   Zebra server seems not to be available. This script needs Zebra runs.
6) Restart Zebra server
7) Delete biblio index base
8) Run misc/migration_tools/remove_unused_authorities.pl -c
9) The script does nothing and says :
   Searching authority number in biblio records seems not to be available : an,alwaysmatches=''
10) Use ElasticSearch in systempreference SearchEngine
11) Delete biblio index base
12) Run misc/migration_tools/remove_unused_authorities.pl -c
13) The script does nothing and says :
    Searching authority number in biblio records seems not to be available : an:*

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 21865: improve remove_unused_authorities.pl script
Fridolin Somers [Mon, 19 Nov 2018 13:46:05 +0000 (14:46 +0100)]
Bug 21865: improve remove_unused_authorities.pl script

remove_unused_authorities.pl script can be improved.

This patch changes changes verbosity so than test mode can be used
to know the autorities that are used and those that can be deleted.
It also writes a line in output if limited authority type(s).

This patch also removes the unused vars $thresholdmin and $thresholdmax.

It also changes the query to use SQL with parameters for authority types.

Test plan :
1) On a catalog create a new authority
2) Be sure catalog is well indexed
3) Run misc/migration_tools/remove_unused_authorities.pl -t
4) You will see the line :
   *** Testing only, authorities will not be deleted. ***
5) You will see lines of :
   authid=x type=y : used X time(s)
6) You will see the line for the authority created in 1) :
   authid=x type=y : can be deleted
7) You will see at the end :
   x authorities parsed
   y can be deleted because unused
   z unchanged because used
8) Run misc/migration_tools/remove_unused_authorities.pl
9) You don't see the line :
   *** Testing only, authorities will not be deleted. ***
10) You will see lines of :
   authid=x type=y : used X time(s)
11) You will see the line for the authority created in 1) :
   authid=x type=y : deleted
12) You will see at the end :
   x authorities parsed
   y deleted because unused
   z unchanged because used
13) Run misc/migration_tools/remove_unused_authorities.pl --auth NP --auth CO
14) You see the line :
    Restricted to authority type(s) : NP,CO.

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>