]> git.koha-community.org Git - koha.git/log
koha.git
6 years agoBug 20499: Unit Test to prove the problem
Mark Tompsett [Thu, 29 Mar 2018 18:44:32 +0000 (18:44 +0000)]
Bug 20499: Unit Test to prove the problem

TEST PLAN
---------
1) apply this patch
2) prove t/db_dependent/Circulation.t
   -- horrible death.
3) apply next path
4) prove t/db_dependent/Circulation.t
   -- passes.
5) run koha qa test tools

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 7143: Update about page for new dev - Joachim Ganseman
Jonathan Druart [Fri, 13 Apr 2018 14:47:47 +0000 (11:47 -0300)]
Bug 7143: Update about page for new dev - Joachim Ganseman

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 17981: (QA follow-up) Fix and update pod in svc/letters/get
Josef Moravec [Tue, 10 Apr 2018 18:30:09 +0000 (18:30 +0000)]
Bug 17981: (QA follow-up) Fix and update pod in svc/letters/get

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 17981: Do not crash if the template is already using TT syntax
Jonathan Druart [Wed, 11 Apr 2018 18:55:04 +0000 (15:55 -0300)]
Bug 17981: Do not crash if the template is already using TT syntax

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 17981: Remove uneeded module JS var
Jonathan Druart [Fri, 15 Sep 2017 15:50:32 +0000 (12:50 -0300)]
Bug 17981: Remove uneeded module JS var

As we only support CHECKIN and CHECKOUT for now, we do not need this
module variable. It may be useful to re-add it later.

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 17981: Move the divs to the top of the modal
Jonathan Druart [Tue, 24 Jan 2017 16:38:17 +0000 (17:38 +0100)]
Bug 17981: Move the divs to the top of the modal

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 17981: Better error handling
Jonathan Druart [Tue, 24 Jan 2017 16:13:07 +0000 (17:13 +0100)]
Bug 17981: Better error handling

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 17981: Add a preview mode for notice templates
Jonathan Druart [Tue, 24 Jan 2017 12:31:30 +0000 (13:31 +0100)]
Bug 17981: Add a preview mode for notice templates

This patch is a first step to provide a preview mode for notice
templates.

CHECKIN, CHECKOUT and HOLD_SLIP are supported so far.
Maybe more, but I have not tested yet and the interface will not allow
you to generate the preview.

The idea is to provide an idea of how will render the messages generated
from a notice template.

A new "Preview" button is added close to each textarea on the editing
notice templates view.
For each notice template code (letter_code), we will need some input
data to produce the preview.

For instance, for CHECKIN we need an barcode. From the barcode we
can guess all the other data.
For CHECKOUT we will need the borrowernumber and the barcode.
Note that the way to enter the data for the preview is not really
user-friendly, for CHECKOUT you will have to fill
'borrowernumber|barcode', but the placeholder will help you to know how
and what to fill.
In the modal window, you will see 4 blocks:
1/ the content of the letter (with the placeholds << >>)
2/ the generated message (with the data filled)
3/ if the letter contained historical syntax markers, the screen will
try to generate a notice template using the TT syntax
4/ the generated message from this TT syntax
=> You will be able to compare the 2 generated messages.

What is the goal of this first patchset:
- Show this first POC and get feedback from other developpers
- Add a way to easily visualise the differences between the 2 syntaxes
- Confort users with the TT syntax and the migration step from the
historical syntax.

I'd like to get opinions before going further.

The possibilities:
- Mock data to get fully working generated messages for any notice
templates. For instance, for CHECKIN and CHECKOUT, the item is not
checked in/out yet. So we cannot access the issue's information.
(I have no idea how to do that)
- Browse the data to get the ones we want to use for the preview (big).

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 17981: Add a 'letter' param to GetPreparedLetter
Jonathan Druart [Tue, 24 Jan 2017 10:18:46 +0000 (11:18 +0100)]
Bug 17981: Add a 'letter' param to GetPreparedLetter

This will allow us to call GetPreparedLetter with a letter content that
does not exist in the DB

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 17981: Move svc/letters to svc/letters/get
Jonathan Druart [Tue, 24 Jan 2017 09:09:26 +0000 (10:09 +0100)]
Bug 17981: Move svc/letters to svc/letters/get

To allow another script under svc/letters

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 20426: Fix default fund value when adding orders from iso2709 file
Jonathan Druart [Mon, 2 Apr 2018 15:56:21 +0000 (12:56 -0300)]
Bug 20426: Fix default fund value when adding orders from iso2709 file

A new bug has been highlighted since:
  commit b830349f45007629f141a9835e05b95f90ee4b92
  Bug 19453: Incorrect jQuery selector for fund drop down validation

Prior to bug 19453 the check on the existence of the fund did not work
as expected, no select with name='budget_code' existed and the error was
never raised.
Now it works but expect a fund to be selected for every record to
import.
This check must only be done if there is no default value selected.

Test plan:
- Create an order from a staged file
- Do not select any funds
=> You must get a warning
- Select a specific fund for some of the records
=> You must get a warning
- Select a default fund in the last tab
=> You must not get a warning and the records must be imported and
inserted with the correct fund

Signed-off-by: Sonia Bouis <sonia.bouis@univ-lyon3.fr>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 18904: (follow-up) Use Ctrl+Shift+L
Nick Clemens [Wed, 11 Apr 2018 18:19:58 +0000 (18:19 +0000)]
Bug 18904: (follow-up) Use Ctrl+Shift+L

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 18904: (QA follow-up) Do not put authid in searchbox of blinddetail
Marcel de Rooy [Mon, 9 Apr 2018 10:55:38 +0000 (12:55 +0200)]
Bug 18904: (QA follow-up) Do not put authid in searchbox of blinddetail

Adding trivial test if subfield equals 9.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 18904: (follow-up) Rebase onto 14769
Nick Clemens [Fri, 6 Apr 2018 12:30:16 +0000 (12:30 +0000)]
Bug 18904: (follow-up) Rebase onto 14769

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Amended: simplified if-then-else around cur_field.setIndicator[12].

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 18904: (follow-up) Set indicators and correct js path
Nick Clemens [Thu, 15 Mar 2018 10:18:54 +0000 (10:18 +0000)]
Bug 18904: (follow-up) Set indicators and correct js path

TO test:
1 - Have an authority with some indicators
2 - Link a field in rancor to that authority
3 - See that you get some indicators (same in unimarc, diff in marc21)

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 18904: Remove debugging code
Nick Clemens [Fri, 27 Oct 2017 11:17:09 +0000 (11:17 +0000)]
Bug 18904: Remove debugging code

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 18904: (follow-up) Retrieve subfield in the order they are stored
Nick Clemens [Thu, 20 Jul 2017 10:23:49 +0000 (10:23 +0000)]
Bug 18904: (follow-up) Retrieve subfield in the order they are stored

Use subfields in the order they are stored.

This patch removes use of an intermediate hash for storing values. Order
of subfields as obtained from authority is now preserved.

Also removes useless code that was intended to set $2 subfields

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 18904: (follow-up) Fix whitespace and don't use hardcoded path
Nick Clemens [Thu, 6 Jul 2017 17:49:14 +0000 (17:49 +0000)]
Bug 18904: (follow-up) Fix whitespace and don't use hardcoded path

Fix whitespace/tabs
use [% interface %] not intranet-tmpl

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 18904: Advanced editor - Rancor - Add authority support
Nick Clemens [Thu, 6 Jul 2017 16:35:38 +0000 (16:35 +0000)]
Bug 18904: Advanced editor - Rancor - Add authority support

This patchset adds the ability to use the authorities search to select
or clear fields in the advanced editor

To test:
 1 - Open a record in the advanced cataloging editor
 2 - Press 'Ctrl+L' while in a field that shuold not be linked to
authorities (300 for instance)
 3 - Nothing should happen
 4 - Try it in a field that should be linked
 5 - You should get the authorities pop-up
 6 - Values in pop-up should be populated from values in record (as
        appropriate for authority type)
 7 - Correct authority type should be selected ( PERSO_NAME for 100,
        TOPIC_TERM for 650, etc.)
 8 - Press 'Clear', field should be blanked
 9 - Search again and select an authority
10 - Field should be correctly populated

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 14769: DBRev 17.12.00.029
Jonathan Druart [Tue, 10 Apr 2018 17:50:16 +0000 (14:50 -0300)]
Bug 14769: DBRev 17.12.00.029

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 14769: (QA follow-up) Remove global var $cached_indicators
Marcel de Rooy [Thu, 12 Apr 2018 06:54:34 +0000 (08:54 +0200)]
Bug 14769: (QA follow-up) Remove global var $cached_indicators

As requested by RM, this patch replaces using the global $cached_indicators
by saving state temporarily during the (limited) lifetime of the object.

Essentially this affects two places in code:
[1] blinddetail-biblio-search.pl (loading auth record in editor)
[2] AuthoritiesMarc::merge (merging authority into biblios)

Concurrent runs of [1] and/or [2] together with a simultaneous pref change
just in between could cause slight (hypothetical) side-effects.
The current approach of keeping state in the object makes that a series of
controlled_indicators calls during an immediate merge of one specific
authority is not affected by a simultaneous pref change. So the same rules
are applied to the set of attached biblio record for that authority.
Note also that the cron job ignores a simultaneous pref change, since
it reads from the unchanged L1 cache (yes, also hypothetical).

Test plan:
[1] Run t/Koha/Authority/ControlledIndicators.t
[2] Run t/db_dependent/Authority/Merge.t
[3] Run t/db_dependent/Koha/Authorities.t

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 14769: (Follow-up) Let blinddetail look at indicator values
Marcel de Rooy [Fri, 9 Feb 2018 11:18:10 +0000 (12:18 +0100)]
Bug 14769: (Follow-up) Let blinddetail look at indicator values

If the indicators are not controlled, blinddetail should not overwrite
what the user already entered. Very strictly seen, we could say that it
is outside the scope. But it is strongly related.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Tested with 100 and 600 in the cataloging editor.
For 100 the second indicator should not be overwritten. For 600 it should.
Also tested "ind2:" which should blank ind2.

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 14769: (Follow-up) Reduce number of preference parses
Marcel de Rooy [Fri, 9 Feb 2018 08:03:26 +0000 (09:03 +0100)]
Bug 14769: (Follow-up) Reduce number of preference parses

In sub merge the Koha::Authority object was already created, so it was kind
of silly to recreate it each time with new.
In Koha::Authority, the ControlledIndicators object can be saved in the
object too for reuse during its life time. Similarly, we prevent repeated
lookups for the reporting tag (via authority type).

Test plan:
[1] Run t/db_dependent/Authority/Merge.t
[2] Run t/db_dependent/Koha/Authorities.t

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Limited benchmarking shows me a reduction of 11% on Merge.t and a
reduction of 4% on Authorities.t when comparing with and without this
last patch. The larger impact on Merge.t could be expected.

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 14769: Put ControlledIndicators to work
Marcel de Rooy [Fri, 26 Jan 2018 09:17:33 +0000 (10:17 +0100)]
Bug 14769: Put ControlledIndicators to work

This patch does:
[1] Adds Koha::Authority->controlled_indicators (with a test).
[2] Adds a call to controlled_indicators in AuthoritiesMarc::merge.
    Unit test Merge.t is extended too.
[3] Simplifies the code in authorities/blinddetail-biblio-search.pl by
    calling controlled_indicators.

Test plan:
[1] Run t/db_dependent/Koha/Authorities.t
[2] Run t/db_dependent/Authority/Merge.t
[3] Steps 3 to 7 for MARC21:
    Create a PERSO_NAME authority with 008/11=r and ind1=3
[4] Edit a biblio and add a 600 linked to the new authority.
[5] Verify that the biblio has ind1==3 and ind2==7 and $2==aat.
    (If $2 is not visible, check the metadata in biblio_metadata.)
[6] Edit the PERSO_NAME authority and change 008/11 to '|' (bar).
[7] Verify that merge updated your biblio record: $ind2==4 and $2 gone.
[8] UNIMARC: Follow the pattern from steps 3 to 7.
    Create authority, link it in a biblio, check indicators (they should
    be copied both). Edit authority, change indicators and verify the
    merge results in the biblio record.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Tested PERSO_NAME and UNIF_TITLE.
For UNIF_TITLE the second authority indicator is copied to ind1 or ind2,
depending on the biblio tag involved.
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 14769: Add preference AuthorityControlledIndicators
Marcel de Rooy [Thu, 8 Feb 2018 11:59:08 +0000 (12:59 +0100)]
Bug 14769: Add preference AuthorityControlledIndicators

Including:

[1] Atomic update to add pref for existing installs
[2] Add new pref to sysprefs.sql for new installs
[3] Add description to authorities preference file.

Test plan:
[1] Run new install or upgrade to add pref.
[2] Check value of pref via System preferences in staff interface.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 14769: Add tests for _thesaurus_info in ControlledIndicators.t
Marcel de Rooy [Tue, 6 Feb 2018 15:47:12 +0000 (16:47 +0100)]
Bug 14769: Add tests for _thesaurus_info in ControlledIndicators.t

Apart from adding tests for this sub, we make the following change
too and support it with a test.

The fallback to $code in the construction
    $thes_mapping{ $code } // $code // '4'
is removed by this patch. When $code is not in $thes_mapping, we cannot
assume that it is a valid code for a biblio indicator. In this case it is
more safe to mark it as 4 (Source not specified).

Test plan:
Run t/Koha/Authority/ControlledIndicators.t

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 14769: Biblio indicators based on authority's thesaurus code
Janusz Kaczmarek [Fri, 24 Nov 2017 21:21:48 +0000 (22:21 +0100)]
Bug 14769: Biblio indicators based on authority's thesaurus code

Original patch from Janusz Kaczmarek on November 24, 2017.
Amended by Marcel de Rooy on February 6, 2018.
Code moved from AuthoritiesMarc.pm to ControlledIndicators.pm.

Special attention has been paid to the proper application of 008/11
while controlling 6XX in MARC 21, specially if 008/11 =~ /[rsz]/
(and if it is 'z' and 040 $f is defined).

Test plan:
See next patch.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
The construction $thes_mapping{ $code } // $code // '4' will still get
some attention on a follow-up.
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 14769: Introduce Koha::Authority::ControlledIndicators
Marcel de Rooy [Fri, 26 Jan 2018 10:06:59 +0000 (11:06 +0100)]
Bug 14769: Introduce Koha::Authority::ControlledIndicators

This module reads its settings from pref AuthorityControlledIndicators.
The get method allows you to retrieve indicator values for specific
biblio fields.

Test plan:
Run t/Koha/Authority/ControlledIndicators.t

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Amended: Added a test to show that "ind1:" returns empty string.

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 9701: DBRev 17.12.00.028
Jonathan Druart [Thu, 12 Apr 2018 13:48:17 +0000 (10:48 -0300)]
Bug 9701: DBRev 17.12.00.028

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 9701: (QA follow-up) DBIx schema changes
Marcel de Rooy [Mon, 9 Apr 2018 07:08:59 +0000 (09:08 +0200)]
Bug 9701: (QA follow-up) DBIx schema changes

Changes in MarcTagStructure.pm

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 9701: (follow-up) Adjust tests
Josef Moravec [Mon, 19 Feb 2018 10:36:04 +0000 (10:36 +0000)]
Bug 9701: (follow-up) Adjust tests

Test plan:

prove t/db_dependent/Biblio.t
should be green

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 9701: Configure default indicator
Joachim Ganseman [Sat, 4 Jun 2016 12:58:36 +0000 (12:58 +0000)]
Bug 9701: Configure default indicator

This patch adds the possibility to define default indicators in
the MARC frameworks. It adds 2 columns in the marc_tag_structure table in
the database in order to accomplish this. All files that reference this
table have also been updated to reflect these added fields.

Test: Add or edit a MARC framework. In the Field list should be 2 extra
columns. It should be possible to add default indicators (1 character)
    in these fields. Nothing else should have changed in the meantime.
    The default indicator values are not yet visible in the cataloguing module.

The default values are also loaded in the cataloguing form.

Test: Define default values in some MARC framework. Go to cataloguing
and create a new record using this framework. Verify that the defined
defaults are visible when set. Verify the default is empty (as before)
    if no default was set. Verify that if the default is changed, the
    record is saved with the manually changed value. Verify that upon
    changing such a new record, the manually set indicator value is used
    and not the default one from the framework.

Don't forget to run database and database schema update

Signed-off-by: Eugene Jose Espinoza <eugenegf@yahoo.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 19936: Reuse existing userid if none provided
Jonathan Druart [Fri, 23 Feb 2018 16:45:09 +0000 (13:45 -0300)]
Bug 19936: Reuse existing userid if none provided

Found this regression when working on other patches:
If you edit a patron and blank the userid field, it will be regenerated
with an incremented value (firstname.surname will be firstname.surname1)

This is because we use a non-existing patron and ->in_storage in
has_valid_userid is always false.
The trick here is to backup the value, generate the userid, then reset
userid to the previous value.

As the POD says, it will be fix later, when AddMember and ModMember will
be replaced with Koha::Patron->store

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 19936: Replace Check_userid - Update the occurrences
Jonathan Druart [Wed, 21 Feb 2018 19:10:30 +0000 (16:10 -0300)]
Bug 19936: Replace Check_userid - Update the occurrences

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 19936: Remove warnings from tests
Jonathan Druart [Tue, 9 Jan 2018 13:33:25 +0000 (10:33 -0300)]
Bug 19936: Remove warnings from tests

C4::Members did not "use warnings;"

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 19936: Remove the subroutine Generate_Userid
Jonathan Druart [Tue, 9 Jan 2018 13:27:34 +0000 (10:27 -0300)]
Bug 19936: Remove the subroutine Generate_Userid

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 19936: Replace Generate_Userid - Update the occurrences
Jonathan Druart [Mon, 8 Jan 2018 21:44:25 +0000 (18:44 -0300)]
Bug 19936: Replace Generate_Userid - Update the occurrences

Test plan:
Same test plan as previous patch:
add/update/import patrons and watch the userid

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 19936: Adapt tests
Jonathan Druart [Mon, 8 Jan 2018 21:48:49 +0000 (18:48 -0300)]
Bug 19936: Adapt tests

And prove that we are not cheating

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 19936: Add the Koha::Patron->generate_userid method
Jonathan Druart [Mon, 8 Jan 2018 21:44:56 +0000 (18:44 -0300)]
Bug 19936: Add the Koha::Patron->generate_userid method

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 19936: Move and add tests for Generate_Userid
Jonathan Druart [Mon, 8 Jan 2018 21:35:58 +0000 (18:35 -0300)]
Bug 19936: Move and add tests for Generate_Userid

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 19936: Remove the subroutine Check_Userid
Jonathan Druart [Mon, 8 Jan 2018 21:05:29 +0000 (18:05 -0300)]
Bug 19936: Remove the subroutine Check_Userid

It is no longer in user, we can remove it.

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 19936: Replace Check_userid - Update the occurrences
Jonathan Druart [Mon, 8 Jan 2018 21:04:56 +0000 (18:04 -0300)]
Bug 19936: Replace Check_userid - Update the occurrences

We previously prove that the method and the subroutine were equivalent,
we know update the controller calls.

Test plan:
- Add and update a patron with different variations of userid
(automatically generated or not)
- Import patrons with and without userid, as well as with existing
userid

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 19936: Add the Koha::Patron->has_valid_userid method
Jonathan Druart [Mon, 8 Jan 2018 20:50:48 +0000 (17:50 -0300)]
Bug 19936: Add the Koha::Patron->has_valid_userid method

Reuse how C4::Members::Check_Userid works and adapt it to write
Koha::Patron->check_userid
Adapt the tests to use this new method.
The tests still pass, we can adapt the different callers

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 19936: Replace Check_userid - just move the tests
Jonathan Druart [Mon, 8 Jan 2018 20:14:49 +0000 (17:14 -0300)]
Bug 19936: Replace Check_userid - just move the tests

This patch moves the tests related to Check_userid out of Members.t
The tests must pass with only this patch applied

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 20123: (follow-up) Mock timezone in t/Auth_with_shibboleth.t
Tomas Cohen Arazi [Wed, 11 Apr 2018 21:08:56 +0000 (18:08 -0300)]
Bug 20123: (follow-up) Mock timezone in t/Auth_with_shibboleth.t

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 19904: (follow-up) Add Nick Clemens as RM assistant
Marcel de Rooy [Tue, 10 Apr 2018 14:31:44 +0000 (16:31 +0200)]
Bug 19904: (follow-up) Add Nick Clemens as RM assistant

See comments on Bugzilla report and wiki roles page for 18.05.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 19904: Release team for 18.05
Marcel de Rooy [Mon, 9 Apr 2018 12:29:40 +0000 (14:29 +0200)]
Bug 19904: Release team for 18.05

First moved all relevant 17.11 release team entries to the development
section, and then updated the release team section from the wiki 18.05
roles page.

Test plan:
[1] Check if Koha team tab on about looks as it should.
[2] Verify changes with 17.11 and 18.05 roles.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 19289: DBRev 17.12.00.027
Jonathan Druart [Wed, 11 Apr 2018 19:50:37 +0000 (16:50 -0300)]
Bug 19289: DBRev 17.12.00.027

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 19289: (follow-up) Add existing fields to the ACQ framework
Jonathan Druart [Mon, 9 Apr 2018 15:52:31 +0000 (12:52 -0300)]
Bug 19289: (follow-up) Add existing fields to the ACQ framework

Changes for other frameworks

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 19289: Extend size of inputs to 50
Jonathan Druart [Fri, 6 Apr 2018 20:15:34 +0000 (17:15 -0300)]
Bug 19289: Extend size of inputs to 50

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 19289: Use copyrightdate instead of publicationyear for MARC21
Jonathan Druart [Tue, 27 Feb 2018 13:38:47 +0000 (10:38 -0300)]
Bug 19289: Use copyrightdate instead of publicationyear for MARC21

See comment 24

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 19289: Use jQuery validate plugin
Jonathan Druart [Fri, 19 Jan 2018 17:13:48 +0000 (14:13 -0300)]
Bug 19289: Use jQuery validate plugin

This is quite dirty but rewrite the JS checks is out of the scope of
this bug report.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 19289: Use the ACQ framework to display bibliographic details
Jonathan Druart [Fri, 13 Oct 2017 20:35:11 +0000 (17:35 -0300)]
Bug 19289: Use the ACQ framework to display bibliographic details

The ACQ MARC framework is only used for the â€˜Item’ block.
This patch add the ability to define biblio fields (!= 995 or 952) to
customize the display of the bibliographic details when ordering.

This new feature is controlled by a new pref:
UseACQFrameworkForBiblioRecords

Test plan:
- Create a new installation to populate the ACQ framework correctly
- Set the pref UseACQFrameworkForBiblioRecords to "Use"
- Create a new order
=> You will see the lib from the ACQ framework
- Add/remove/update biblio subfields in the ACQ framework
- Create a new order
=> You should see the new subfields displayed

Note for QA: I though I would be able to refactor existing code to make
it more flexible, but it is a bit messy and lost a lot of time. I
finally decided to copy/paste the existing code. I simplified it as, I
think, we do not want the plugin, etc. like in the full biblio editor.

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Nicolas Legrand <nicolas.legrand@bulac.fr>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 19289: Add existing fields to the ACQ framework
Jonathan Druart [Thu, 26 Oct 2017 20:29:36 +0000 (17:29 -0300)]
Bug 19289: Add existing fields to the ACQ framework

When ordering, the bibliographic details contain the title, author,
publisher code, publication year, isbn and series info.
To avoid regression to provide the same behaviour, we will add these
fields to the ACQ framework

NOTE: This patch makes the change only for
  - en
  - fr / unimarc complet

Other frameworks will be updated before to be pushed, to avoid
unecessary rebases

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Nicolas Legrand <nicolas.legrand@bulac.fr>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 20540: (follow-up) Remove debug line
Katrin Fischer [Sat, 7 Apr 2018 08:59:47 +0000 (10:59 +0200)]
Bug 20540: (follow-up) Remove debug line

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>
6 years agoBug 20540: Fix TransformHtmlToXml if last tag is empty
Jonathan Druart [Fri, 6 Apr 2018 20:16:30 +0000 (17:16 -0300)]
Bug 20540: Fix TransformHtmlToXml if last tag is empty

This bug has been found during testing bug 19289.

In some conditions C4::Biblio::TransformHtmlToXml will generate a malformed XML structure. The last </datafield> can be duplicated.

For instance, if a call like:
my $xml = TransformHtmlToXml( \@tags, \@subfields, \@field_values );

with the last value of @field_values is empty, it will return:

<?xml version="1.0" encoding="UTF-8"?>
<collection
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://www.loc.gov/MARC21/slim http://www.loc.gov/standards/marcxml/schema/MARC21slim.xsd"
  xmlns="http://www.loc.gov/MARC21/slim">
<record>
<datafield2 tag="020" ind1=" " ind2=" ">
<subfield code="a">l</subfield>
</datafield>
<datafield1 tag="100" ind1=" " ind2=" ">
<subfield code="a">k</subfield>
</datafield>
<datafield1 tag="245" ind1=" " ind2=" ">
<subfield code="a">k</subfield>
</datafield>
<datafield1 tag="250" ind1=" " ind2=" ">
<subfield code="a">k</subfield>
</datafield>
<datafield1 tag="260" ind1=" " ind2=" ">
<subfield code="b">k</subfield>
<subfield code="c">k</subfield>
</datafield>
</datafield>
</record>
</collection>

Which will result later in the following error:
:23: parser error : Opening and ending tag mismatch: record line 6 and datafield
</datafield>
            ^
:24: parser error : Opening and ending tag mismatch: collection line 2 and record
</record>
         ^
:25: parser error : Extra content at the end of the document
</collection>

Test plan:
You can test it along with bug 19289 and confirm that it fixes the problem
raised on bug 19289 comment 30

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>
6 years agoBug 18625: (QA follow-up) Simplify update_lastseen
Marcel de Rooy [Wed, 11 Oct 2017 12:41:17 +0000 (14:41 +0200)]
Bug 18625: (QA follow-up) Simplify update_lastseen

No need to check the pref.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 18625: Update lastseen in patron info request
Colin Campbell [Thu, 18 May 2017 14:59:49 +0000 (15:59 +0100)]
Bug 18625: Update lastseen in patron info request

Many services use SIP patron req info to validate a patron against
the koha database. If recording lastseen sites will
also want to record that the user has accessed these
library facilities although they have not logged into koha

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Verified that Patron Info request (63) updates lastseen when the pref has
been enabled.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 18625: (QA follow-up) Unit tests
Nick Clemens [Fri, 27 Oct 2017 02:23:22 +0000 (02:23 +0000)]
Bug 18625: (QA follow-up) Unit tests

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 20104: Update minimum version of Perl to 5.20
Mark Tompsett [Tue, 30 Jan 2018 19:53:32 +0000 (19:53 +0000)]
Bug 20104: Update minimum version of Perl to 5.20

This patch not only updates the version check, but repurposes
the perlversion parameter, so as to not have to retranslate
templates again when the version number changes after this.

The changes are very self-evident.

Signed-off-by: Roch D'Amour <roch.damour@inlibro.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 20536: (ILL) authnotrequired should be explicitly unset on opac
Martin Renvoize [Fri, 6 Apr 2018 09:22:20 +0000 (10:22 +0100)]
Bug 20536: (ILL) authnotrequired should be explicitly unset on opac

* koha/opac-illrequest.pl - Added explicit setting of authnotrequired

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 20552: Fix HTML tag for search facets
Claire Gravely [Tue, 10 Apr 2018 12:46:11 +0000 (12:46 +0000)]
Bug 20552: Fix HTML tag for search facets

The tags for home library and holding library in the 'refine your
search' list should be h5.

This patch changes the html tag for the availability, holding library and home library
facets.

To test:
- Search for an item in the OPAC where the relevant facet appears
- Use 'Inspect element' to check the tag
- Apply patch
- Confirm the facet now has the h5 tag
- Confirm spacing is improved

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 19538: Move EnableAdvancedCatalogingEdtor from 'Labs' to 'Cataloging'
Nick Clemens [Fri, 27 Oct 2017 11:38:51 +0000 (11:38 +0000)]
Bug 19538: Move EnableAdvancedCatalogingEdtor from 'Labs' to 'Cataloging'

To test:
1 - View sysprefs
2 - Note 'Labs' tab
3 - Note EnableAdvancedCatalogingEditor is the only pref there
4 - Note that prefs works
5 - Apply patch
6 - Note 'Labs' tba is gone
7 - Check the 'Cataloging' tab (under Interface)
8 - There it is!
9 - Verify it still works

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Maksim Sen <maksim.sen@inlibro.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 20518: Don't show "Messages" header and link on patron details if there are no...
Owen Leonard [Wed, 4 Apr 2018 16:33:34 +0000 (16:33 +0000)]
Bug 20518: Don't show "Messages" header and link on patron details if there are no messages

This patch modifies the patron detail page so that the "Messages" header
is not displayed if there are no messages.

Unrelated: A minor change was made to moremember.pl to quiet an error in
the log, "Use of uninitialized value $print in string eq at
members/moremember.pl line 219."

To test, apply the patch and open the detail page for a patron who has
no messages. There should be no "Messages" header or "add message" link.

Add a message to the patron's account. The message should appear, along
with the "Messages" header and "add message" link.

The error logs should show no errors.

Signed-off-by: Maksim Sen <maksim.sen@inlibro.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 9634: Allow for combining same paraneters in SQL reports
Nick Clemens [Mon, 15 Jan 2018 14:11:29 +0000 (14:11 +0000)]
Bug 9634: Allow for combining same paraneters in SQL reports

This patch combines report paramters with the same name and data type
(authorised value)

This presereves the past ability to provide all parameters as
'sql_params' in order to preserve existing public report links

To test:
 1 - Create a report that takes multiple parameters, e.g.:
SELECT <<cat>> AS one, <<dog|branches>> AS two, <<dog|YES_NO>> as three,
       <<cat>> as four, <<dog|branches>> as five
 2 - Run this report, note you are asked for five parameters
 3 - Apply patch
 4 - Update database
 5 - Run report, note you are asked for three params
 6 - Verify the results reflect the supplied parameters
 7 - Export the report and verify results
 8 - Alter the URL and provide 5 params as sql_params and no param_name
 variables i.e.
 http://localhost:8081/cgi-bin/koha/reports/guided_reports.pl?reports=1&phase=Run+this+report&sql_params=Banana&sql_params=CPL&sql_params=0&sql_params=Orange&sql_params=LPL
 9 - Verify results come out as expected. i.e. 5 different values that
       are those of the URL.

Signed-off-by: Victor Grousset <victor.grousset@biblibre.com>
Signed-off-by: Charles Farmer <charles.farmer@inLibro.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 18674: (QA follow-up) Add date and time
Tomas Cohen Arazi [Wed, 11 Apr 2018 18:47:01 +0000 (15:47 -0300)]
Bug 18674: (QA follow-up) Add date and time

This patch adds current date and time, formatted as configured.
It makes the timezone name be displayed the system uses it (important
for the 'local' use case).

It removes some warnings too.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 18674: TZ error handling
Tomas Cohen Arazi [Thu, 5 Apr 2018 19:29:23 +0000 (16:29 -0300)]
Bug 18674: TZ error handling

This patch adds C4::Context->timezone bad timezone handling.
The calculated 'effective' timezone is tested with the right tool and a
fallback to 'local' is added. A warning is printed in the logs.

A test for this is added to about.pl too, along with the right warning
messages in case of problems.

Tests are added for both invalid TZ and to make sure the warning is
raised.

To test:
- Apply the patch
- Run:
  $ kshell
 k$ prove t/timezones.t
=> SUCCESS: All tests pass

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 18674: Style changes to match other entries
Tomas Cohen Arazi [Wed, 4 Apr 2018 20:49:07 +0000 (20:49 +0000)]
Bug 18674: Style changes to match other entries

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 18674: Allow TZ SetEnv for plack
Mark Tompsett [Mon, 2 Apr 2018 19:24:25 +0000 (15:24 -0400)]
Bug 18674: Allow TZ SetEnv for plack

It should also be noted that
    /etc/apache2/sites-enabled/{configuration file}
should also contain:
    RequestHeader add X-Koha-SetEnv "TZ {timezone}"
Where {timezone} is the desired instance timezone.

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 18674: Added timezone information to about page
Mark Tompsett [Mon, 26 Feb 2018 15:00:54 +0000 (15:00 +0000)]
Bug 18674: Added timezone information to about page

Before patch: No timezone section
After patch: timezone section at bottom of
             Server information tab.

Actual is what is being used. Config overrides environment variables.
So if there is confusion why the environment variables aren't working,
it will be visible why.

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 20123: Make the timezone entry empty and uncommented by default
Tomas Cohen Arazi [Thu, 5 Apr 2018 13:31:04 +0000 (10:31 -0300)]
Bug 20123: Make the timezone entry empty and uncommented by default

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 20123: Add commented out example to koha-conf.xml
Kyle M Hall [Fri, 9 Mar 2018 14:26:13 +0000 (09:26 -0500)]
Bug 20123: Add commented out example to koha-conf.xml

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 20123: (QA follow-up) If tz is 'local', no need to tell database to set the timezone
Kyle M Hall [Tue, 27 Feb 2018 12:10:59 +0000 (12:10 +0000)]
Bug 20123: (QA follow-up) If tz is 'local', no need to tell database to set the timezone

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 20123: Allow multiple instances of Koha to have different timezones on the same...
Kyle M Hall [Thu, 1 Feb 2018 18:21:54 +0000 (13:21 -0500)]
Bug 20123: Allow multiple instances of Koha to have different timezones on the same server

Most of Koha depends on the local timezone of the server, except for Koha::Database which support an ENV override with the key TZ.

We should take this a step further. We should not only accept the TZ environment variable for all of Koha, we should really be able to set the timezone in the koha conf file as well so we don't have to pass that environment variable to things like cronjobs and one-off scripts.

Test Plan:
1) Apply this patch
2) Set a timzone in your koha_conf file, that is *not* your local time zone
   Available timzones are listed here: https://en.wikipedia.org/wiki/List_of_tz_database_time_zones
3) Restart apache/plack
4) Perform some actions, check the timestamps in the database and in the
   html output, note they are for the set timezone and not the local
   timezone.

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 20557: Prevent Koha/Acquisition/Order.t to fail randomly
Jonathan Druart [Tue, 10 Apr 2018 16:08:43 +0000 (13:08 -0300)]
Bug 20557: Prevent Koha/Acquisition/Order.t to fail randomly

https://jenkins.koha-community.org/job/Koha_Master_D8/427/consoleFull

t/db_dependent/Koha/Acquisition/Order.t .. 1/2         # No tests run!

    #   Failed test 'No tests run for subtest "entrydate"'
    #   at t/db_dependent/Koha/Acquisition/Order.t line 97.
    # Looks like you failed 1 test of 1.

 #   Failed test 'store'
 #   at t/db_dependent/Koha/Acquisition/Order.t line 99.
 Cannot insert order: Mandatory parameter quantity is missing at t/db_dependent/Koha/Acquisition/Order.t line 77.
 # Looks like your test exited with 255 just after 2.

It happens when basket.is_standing is 0

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 3841: (follow-up) Add the ACQ framework for pl-PL
Jonathan Druart [Tue, 10 Apr 2018 15:04:59 +0000 (12:04 -0300)]
Bug 3841: (follow-up) Add the ACQ framework for pl-PL

No idea why I missed pl-PL!

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 19581: Fix Koha_Elasticsearch.t
Jonathan Druart [Mon, 9 Apr 2018 20:43:41 +0000 (17:43 -0300)]
Bug 19581: Fix Koha_Elasticsearch.t

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 19804: Fix test in maxsuspensiondays.t
Jonathan Druart [Mon, 9 Apr 2018 20:39:35 +0000 (17:39 -0300)]
Bug 19804: Fix test in maxsuspensiondays.t

We do not want a random value of suspension_chargeperiod from
TestBuilder

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 19804: Fix test in GetHardDueDate.t
Jonathan Druart [Mon, 9 Apr 2018 20:33:37 +0000 (17:33 -0300)]
Bug 19804: Fix test in GetHardDueDate.t

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 19804: DBRev 17.12.00.026
Jonathan Druart [Mon, 9 Apr 2018 19:14:23 +0000 (16:14 -0300)]
Bug 19804: DBRev 17.12.00.026

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 19804: (follow-up) Fix wording and columns order
Jonathan Druart [Wed, 4 Apr 2018 20:36:28 +0000 (17:36 -0300)]
Bug 19804: (follow-up) Fix wording and columns order

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 19804: Add the new column to the circ rules interface
Jonathan Druart [Wed, 13 Dec 2017 21:05:50 +0000 (18:05 -0300)]
Bug 19804: Add the new column to the circ rules interface

Signed-off-by: Hugo Agud <hagud@orex.es>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 19804: Add a 'Fine charging interval' for suspension days
Jonathan Druart [Wed, 13 Dec 2017 19:57:40 +0000 (16:57 -0300)]
Bug 19804: Add a 'Fine charging interval' for suspension days

We already have a chargeperiod (Fine charging interval) value which is
taken into account for fine ($) for not for the suspension period.

This patch adds a new column suspension_chargeperiod (Fine day charging
interval) to add the same behaviour when a suspension is calculated.

Test plan:
Add overdue item and play with the circulation rules (and the calendar).
The suspension period must be correctly calculated.
Please provide the different tests you made.

Signed-off-by: Hugo Agud <hagud@orex.es>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 19804: DBIC Schema changes
Jonathan Druart [Wed, 13 Dec 2017 19:56:57 +0000 (16:56 -0300)]
Bug 19804: DBIC Schema changes

Signed-off-by: Hugo Agud <hagud@orex.es>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 19804: Add new DB column issuingrules.suspension_chargeperiod
Jonathan Druart [Wed, 13 Dec 2017 19:56:38 +0000 (16:56 -0300)]
Bug 19804: Add new DB column issuingrules.suspension_chargeperiod

Signed-off-by: Hugo Agud <hagud@orex.es>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 19581: (follow-up) Fix handling of new and old arrays for auth compat
Nick Clemens [Fri, 16 Mar 2018 09:03:46 +0000 (09:03 +0000)]
Bug 19581: (follow-up) Fix handling of new and old arrays for auth compat

Stolen from bug 20244

Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 19581: Remove unused comment and line
Nick Clemens [Tue, 13 Mar 2018 09:32:04 +0000 (09:32 +0000)]
Bug 19581: Remove unused comment and line

Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 19581: Unit tests
Nick Clemens [Sun, 5 Nov 2017 01:47:49 +0000 (01:47 +0000)]
Bug 19581: Unit tests

This patch makes a few changes to the tests to take into account the
change to indexing.

To test:
prove t/db_dependent/Koha_Elasticsearch_Indexer.t
Should return green

Signed-off-by: David Bourgault <david.bourgault@inlibro.com>
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 19581: Remove 'split' option from Catmandu fixes for marc
Nick Clemens [Sun, 5 Nov 2017 01:51:39 +0000 (01:51 +0000)]
Bug 19581: Remove 'split' option from Catmandu fixes for marc

This option in combination with append seems to add null entries in the indexes
for fields that don't exist. These fields then affect sorting. Removing it solves
the issue

To test:
1 - Have an ES setup
2 - Catalog and index some records
3 - View a record in ES:
    curl 'localhost:9200/koha_kohadev_biblios/data/4?pretty=yes'
4 - Note there are 'null' entries in the indexes, save this result for
comparison
5 - Apply patch
6 - Reindex, amking sure to delete existing indexes
    perl misc/search_tools/rebuild_elastic_search.pl -d
7 - View the record again
8 - Note the null entries are removed
9 - Note indices are otherwise intact

Signed-off-by: David Bourgault <david.bourgault@inlibro.com>
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 20122: Explicitly set path to fix emptying cart functionality
Mark Tompsett [Fri, 6 Apr 2018 14:59:28 +0000 (14:59 +0000)]
Bug 20122: Explicitly set path to fix emptying cart functionality

This is caused by bib_list not being deleted.
The path was not explicitly set.
This patch adds path=/ explicitly to ensure it
does get deleted.

TEST PLAN
---------
1) search for 'the' in OPAC
2) add several items to cart.
3) look at your cart.
4) empty and close the cart, select all->remove
   -- either way window closes and it looks empty.
5) refresh the page
   -- cart comes back.
   -- in chromium inspecting the page, specifically
      the "Application" area, bib_list is shown as
      a cookie still.
6) apply patch
7) restart_all and empty cache forcing JS reload
8) repeat steps 1-5
   -- this time cart stays empty.
   -- and the bib_list cookie is gone

Signed-off-by: Roch D'Amour <roch.damour@inlibro.com> using firefox 59.0.2
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 20180: [sql_modes] Remove GROUP BY clause in manage-marc-import.pl
Jonathan Druart [Wed, 7 Feb 2018 15:26:53 +0000 (12:26 -0300)]
Bug 20180: [sql_modes] Remove GROUP BY clause in manage-marc-import.pl

Replaced with a distinct.

Fix for:
'koha_kohadev.me.frameworktext' isn't in GROUP BY

t/db_dependent/www/search_utf8.t

NOTE: I added a [% frameworks.count %] into the template file,
      and compared master and a branch with this applied when
      managing a staged marc import. Values were identical.

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 20179: [sql_modes] Remove GROUP BY in get_shelves_containing_record
Jonathan Druart [Tue, 6 Feb 2018 14:04:50 +0000 (11:04 -0300)]
Bug 20179: [sql_modes] Remove GROUP BY in get_shelves_containing_record

Replaced with distinct.
Fix for:
'koha_kohadev.me.shelfname' isn't in GROUP BY

t/db_dependent/Virtualshelves.t

Signed-off-by: Roch D'Amour <roch.damour@inlibro.com>
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 18789: (follow-up) Pass a Koha::Patron object from returns.pl
Jonathan Druart [Mon, 9 Apr 2018 18:59:32 +0000 (15:59 -0300)]
Bug 18789: (follow-up) Pass a Koha::Patron object from returns.pl

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 20298: (follow-up) fix labels' for attributes
Jonathan Druart [Fri, 6 Apr 2018 17:08:40 +0000 (14:08 -0300)]
Bug 20298: (follow-up) fix labels' for attributes

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 20181: (QA follow-up) Remove double check
Kyle M Hall [Thu, 29 Mar 2018 11:11:40 +0000 (07:11 -0400)]
Bug 20181: (QA follow-up) Remove double check

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 20181: Add POD for new plugin
Kyle M Hall [Tue, 13 Feb 2018 19:08:25 +0000 (14:08 -0500)]
Bug 20181: Add POD for new plugin

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 20181: (follow-up) Ensure test runs
Mark Tompsett [Tue, 13 Feb 2018 18:50:02 +0000 (18:50 +0000)]
Bug 20181: (follow-up) Ensure test runs

If EnablePlugins was 0, this test before this patch fails.
After this patch, it passes.

TEST PLAN
---------
1) Apply all but this patch
2) Run the following commands
    kshell
    prove t/Koha_Template_Plugin_KohaPlugins.t
   -- two tests fail, if you have the conf or syspref set to 0.
3) Apply this patch
4) Repeat step 2.
   -- all tests pass, including the positive and negative case checks.
5) run koha qa test tools

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 20181: Unit tests
Kyle M Hall [Mon, 12 Feb 2018 16:15:47 +0000 (11:15 -0500)]
Bug 20181: Unit tests

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 20181: Allow plugins to add css and javascript to OPAC
Kyle M Hall [Mon, 12 Feb 2018 14:09:20 +0000 (09:09 -0500)]
Bug 20181: Allow plugins to add css and javascript to OPAC

A number of Koha plugins have been written that enhance Koha's public catalog. These plugins often make due to adding css and javascript to the various opac system preferences. It would be nice if the plugin system had hooks so plugin developers could add code the the head block and the area where we include javascript in the opac template.

Test Plan:
1) Apply this patch
2) Download and install the Kitchen Sink plugin ( v2.1.12 or later )
   https://github.com/bywatersolutions/koha-plugin-kitchen-sink/releases/download/v2.1.12/koha-plugin-kitchen-sink-v2.1.12.kpz
3) Install the plugin
4) Restart all the things if you can ( restart_all if you are using kohadevbox )
   This will ensure the plugin takes effect right away, it should be
   necessary but it won't hurt anything!
5) Load the opac, notice you get an alert message and the background
   for your opac is now orange ( assuming you've not customized the
   opac in any way )

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 18816: (QA follow-up) Fix Circulation.t
Marcel de Rooy [Fri, 6 Apr 2018 06:05:58 +0000 (08:05 +0200)]
Bug 18816: (QA follow-up) Fix Circulation.t

Resolve:
ok 33 - Can renew, item is marked not for loan, hold does not block
Can't use string ("1") as a HASH ref while "strict refs" in use at /usr/share/koha/devclone/C4/Items.pm line 557.

Trivial fix. Remove fourth parameter.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>