]> git.koha-community.org Git - koha.git/log
koha.git
6 years agoBug 18336: Shift *TEXT columns size
Tomas Cohen Arazi [Fri, 16 Feb 2018 14:25:31 +0000 (11:25 -0300)]
Bug 18336: Shift *TEXT columns size

Because of the 3-byte vs. 4-byte char size change in utf8mb4, altering a
column's encoding from utf8 into utf8mb4 results in this changes:

TEXT => MEDIUMTEXT
MEDIUMTEXT => LONGTEXT

The column size in the rows (the text itself goes to a separate object
storage) shifts by 1 byte, because all chars are shifted in bytes size
too, so there needs to be room for the byte-count in the column.

This is a debatable change, but the path needs to be included along with
the rest of the patchset for consistency.

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>
6 years agoBug 18336: Fix missing utf8_bin > utf8mb4_bin translation in kohastructure.sql
Tomas Cohen Arazi [Mon, 29 Jan 2018 13:02:21 +0000 (10:02 -0300)]
Bug 18336: Fix missing utf8_bin > utf8mb4_bin translation in kohastructure.sql

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 18336: Add explicit index names to kohastructure.sql
Tomas Cohen Arazi [Tue, 23 Jan 2018 15:26:26 +0000 (12:26 -0300)]
Bug 18336: Add explicit index names to kohastructure.sql

This patch just adds an explicit index name to the search_marc_map
table. The atomicupdate on this patchset is a good example of why we
better have them.

Sponsored-by: Hotchkiss School
Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 18336: Atomic update
Tomas Cohen Arazi [Tue, 23 Jan 2018 14:46:05 +0000 (11:46 -0300)]
Bug 18336: Atomic update

Sponsored-by: Hotchkiss School
Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 18336: DBIC update
Tomas Cohen Arazi [Mon, 22 Jan 2018 15:35:49 +0000 (12:35 -0300)]
Bug 18336: DBIC update

Sponsored-by: Hotchkiss School
Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 18336: Convert schema from utf8 to utf8mb4
Tomas Cohen Arazi [Mon, 22 Jan 2018 15:32:36 +0000 (12:32 -0300)]
Bug 18336: Convert schema from utf8 to utf8mb4

This patch adapts the DB structure so it uses utf8mb4 encoding and
utf8mb4_generic_ci collation.

Indexes for columns of type VARCHAR with prefix lenght higher than 191
are shortened because of the smaller max index lenght for utf8mb4

Note: please beware that testing this patchset risks your data and the
patchset includes reinitializing the DB.

To test:
- Be on the master branch
- Have a clean DB:
  $ reset_all
  (y)
- Apply the first patch (Unit tests)
- Run:
  $ kshell
 k$ prove t/db_dependent/www/search_utf8.t \
          t/db_dependent/www/auth_values_input_www.t
=> FAIL: Tests fail because Koha doesn't support supplemental (UTF-8)
         chars.
- Apply the rest of this patchset
- Upgrade the schema:
  $ kshell
 k$ perl installer/data/mysql/updatedatabase.pl
- Run the tests:
 k$ prove t/db_dependent/www/search_utf8.t \
          t/db_dependent/www/auth_values_input_www.t
=> SUCCESS: Tests pass!
- Now start from a clean DB
- Run:
  $ reset_all
  (y)
- Run the tests:
 k$ prove t/db_dependent/www/search_utf8.t \
          t/db_dependent/www/auth_values_input_www.t
=> SUCCESS: Tests pass!

Verify you can use emojis all over the place (MARC records, AV
        descriptions, etc).

Sponsored-by: Hotchkiss School
Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
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>
6 years agoBug 18336: SET NAMES utf8mb4 in Koha::Database
Tomas Cohen Arazi [Mon, 22 Jan 2018 15:32:21 +0000 (12:32 -0300)]
Bug 18336: SET NAMES utf8mb4 in Koha::Database

Sponsored-by: Hotchkiss School
Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
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>
6 years agoBug 18336: Full stack tests for supplemental UTF-8 chars
Tomas Cohen Arazi [Mon, 22 Jan 2018 16:16:26 +0000 (13:16 -0300)]
Bug 18336: Full stack tests for supplemental UTF-8 chars

This patch introduces tests for Koha's support for 4-byte supplemental
UTF-8 chars. encoding/decoding tools handle this gracefuly. The missing
piece is the MySQL DB backend.

The tests in this patch:
- Adds a couple records for each flavour (MARC21 and UNIMARC) so
  search_utf8.t tests 4-byte chars are handled correctly
- Adds emoji testing in auth_values_input_www.t

To test:
- Apply this patch
- Run:
  $ kshell
 k$ prove t/db_dependent/www/search_utf8.t \
          t/db_dependent/www/auth_values_input_www.t
=> FAIL: It should fail if the DB hasn't been migrated into using
utf8mb4

Sponsored-by: Hotchkiss School
Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
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>
6 years agoBug 20004: Fix POD
Kyle M Hall [Fri, 16 Feb 2018 16:23:14 +0000 (16:23 +0000)]
Bug 20004: Fix POD

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 20004: Adapt /v1/cities to new naming guidelines
Tomas Cohen Arazi [Wed, 17 Jan 2018 17:03:28 +0000 (14:03 -0300)]
Bug 20004: Adapt /v1/cities to new naming guidelines

This patch implements the changes required by the cities endpoint RFC
[1].

It uses the objects.search helper, and relies on bug 19686.

To test:
- Apply the patches
- Compare the spec with the RFC (api/v1/swagger/definitions/city.json)
=> SUCCESS: It makes sense
- Run:
  $ kshell
 k$ prove t/db_dependent/api/v1/cities.t
=> Tests pass!
- Sign off :-D

Signed-off-by: Claire Gravely <claire.gravely@bsz-bw.de>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 20004: Unit tests
Tomas Cohen Arazi [Wed, 17 Jan 2018 17:03:52 +0000 (14:03 -0300)]
Bug 20004: Unit tests

This patch adapts the unit tests for the cities endpoint to the
requirements from the RFC. This tests are expected to just fail
without the needed followup.

To test:
- Run:
  $ kshell
 k$ prove t/db_dependent/api/v1/cities.t
=> FAIL: Tests obviously don't pass without the followup patch.

Signed-off-by: Claire Gravely <claire.gravely@bsz-bw.de>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 20229: Explicitly list the SQL modes we support
Jonathan Druart [Fri, 16 Feb 2018 15:23:26 +0000 (12:23 -0300)]
Bug 20229: Explicitly list the SQL modes we support

In our installation procedure we ask the administrator to edit the
MySQL|MariaDB configuration file to specify the SQL modes we support
(see bug 17258 comment 6 and 7 for more information).

We are on the way to catch and fix all these issues and support these
stricter modes (as they highlight problem in our codebase/DB structure)
but in the meanwhile it may be good to remove this step and revert the
changes when we are ready.

TODO:
- Remove that for dev installations (to let developers catch these bugs)
- Edit the wiki page to remove this step

Test plan:
0. Do not apply this patch
1. Edit your MySQL|MariaDB config and add:
sql-mode = "ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION"
to the [mysqld] section (or edit it)
2. Restart your DBMS
3. Try to make the app explode (watch the logs)
(tips: you should get "'koha_kohadev.me.id' isn't in GROUP BY" when
editing an order)
4. Apply the patch, restart_all, restart your DBMS
5. Try to recreate the failure
=> You should no longer see the error in the logs

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 18789: (follow-up) Fix page title when creating a new patron
Jonathan Druart [Fri, 16 Feb 2018 18:03:17 +0000 (15:03 -0300)]
Bug 18789: (follow-up) Fix page title when creating a new patron

This has been caught by selenium test, the category name must be
displayed when we are creating a new patron, and so does not depends on
the "patron" variable

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 18789: (follow-up) Fix perlcritic issue - housebound.pl
Jonathan Druart [Fri, 16 Feb 2018 17:26:46 +0000 (14:26 -0300)]
Bug 18789: (follow-up) Fix perlcritic issue - housebound.pl

"$branch" is declared but not used at line 65, column 1.  Unused
variables clutter code and make it harder to read.  (Severity: 3)

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 19686: (follow-up) Add to_api param for completeness
Tomas Cohen Arazi [Wed, 17 Jan 2018 17:33:33 +0000 (14:33 -0300)]
Bug 19686: (follow-up) Add to_api param for completeness

This patch adds (yet) another param to objects.search: a reference
to a to_api function to be applied when processing the search results
for output.

To test:
- Apply this patch
- Run:
  $ kshell
 k$ prove t/db_dependent/Koha/REST/Plugin/Objects.t
=> SUCCESS: Test count raised, and tests pass!
- Sign off :-D

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>
6 years agoBug 19686: Add objects.search a 'to_model' param
Tomas Cohen Arazi [Thu, 23 Nov 2017 20:10:42 +0000 (17:10 -0300)]
Bug 19686: Add objects.search a 'to_model' param

This patch introduces a new parameter to the objects.search Mojo helper.
The idea behind this, is that if there's any attribute name mapping
between the DB objects and the API exposed ones, we should be able to
pass it to objects.search so the filtering query params are mapped
correctly for building the DBIC query, like this example:

  my $patrons_set = Koha::Patrons->new;
  my @patrons = $c->objects->search( $patrons_set,
                                     \&to_model
                                    )->as_list;
  # and probably
  @patrons = map {to_api($_)} @patrons;

The to_model function needs to avoid autovivification, to prevent
messing with the query parameters (undef params).

To test:
- Apply this patches
- Run:
  $ kshell
 k$ prove t/db_dependent/Koha/REST/Plugin/Objects.t
=> SUCCESS: Tests pass! Params get mapped!
- Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: David Bourgault <david.bourgault@inlibro.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 19686: Unit tests
Tomas Cohen Arazi [Thu, 23 Nov 2017 20:10:13 +0000 (17:10 -0300)]
Bug 19686: Unit tests

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: David Bourgault <david.bourgault@inlibro.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 19947: Update popup window templates to use Bootstrap grid: Acquisitions transfer...
Owen Leonard [Wed, 10 Jan 2018 17:19:57 +0000 (17:19 +0000)]
Bug 19947: Update popup window templates to use Bootstrap grid: Acquisitions transfer order

This patch updates the acquisitions transfer order template to use the
Bootstrap grid instead of the YUI grid.

Also fixed: Corrected footer include for popup window.

To test, apply the patch and go to Acquisitions -> Vendor -> Open order
-> Transfer.

In the popup window search for a vendor, select, and choose a basket.

Signed-off-by: Charlotte Cordwell <charlotte.cordwell123@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 19932: (follow-up) Add fixed footer to cataloging Z39.50 popup
Owen Leonard [Wed, 7 Feb 2018 14:24:04 +0000 (14:24 +0000)]
Bug 19932: (follow-up) Add fixed footer to cataloging Z39.50 popup

This patch adds additional Bootstrap framework markup to the search form
so that the "Save" and "Cancel" controls are in a fixed footer at the
bottom of the window. This prevents the controls from disappearing down
off screen.

To test, apply the patch and go to Cataloging -> New from Z39.50/SRU.
In the popup window, both the search form and search results pages
should look correct.

Signed-off-by: Claire Gravely <claire.gravely@bsz-bw.de>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 19932: Update popup window templates to use Bootstrap grid: Cataloging Z39.50...
Owen Leonard [Tue, 9 Jan 2018 13:49:02 +0000 (13:49 +0000)]
Bug 19932: Update popup window templates to use Bootstrap grid: Cataloging Z39.50 search

This patch updates the cataloging Z39.50 search template to use the
Bootstrap grid instead of the YUI grid.

Also fixed: Several un-quoted HTML attributes have been corrected.

To test, apply the patch and go to Cataloging -> New from Z39.50/SRU.
In the popup window, both the search form and search results pages
should look correct.

Signed-off-by: Zoe Bennett <zoebennett1308@gmail.com>
Signed-off-by: Claire Gravely <claire.gravely@bsz-bw.de>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 20227: Check for categorycode in default_borrower_circ_rules
Marcel de Rooy [Fri, 16 Feb 2018 11:01:36 +0000 (12:01 +0100)]
Bug 20227: Check for categorycode in default_borrower_circ_rules

Fixes silent crash when adding the same category twice.
DBD::mysql::st execute failed: Duplicate entry 'ST' for key 'PRIMARY' [for Statement "
                INSERT INTO default_borrower_circ_rules
                    (categorycode, maxissueqty, maxonsiteissueqty, max_holds)
                    VALUES (?, ?, ?, ?)
            " with ParamValues: 0="ST", 1=undef, 2=undef, 3="3"] at /usr/share/koha/devclone/admin/smart-rules.pl line 309.

(Line number affected by bug 15524.)

Very trivial solution.

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 12598: Fix POD
Kyle M Hall [Fri, 16 Feb 2018 13:43:32 +0000 (08:43 -0500)]
Bug 12598: Fix POD

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 12598: Use Pod::Usage and make the help more explicit
Jonathan Druart [Thu, 4 Jan 2018 13:06:17 +0000 (10:06 -0300)]
Bug 12598: Use Pod::Usage and make the help more explicit

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 12598: Remove warnings from tests and make them pass
Jonathan Druart [Thu, 4 Jan 2018 13:05:46 +0000 (10:05 -0300)]
Bug 12598: Remove warnings from tests and make them pass

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 12598: Add use Koha::Patron::debarments statement
Jonathan Druart [Tue, 29 Aug 2017 13:31:08 +0000 (10:31 -0300)]
Bug 12598: Add use Koha::Patron::debarments statement

Signed-off-by: Colin Campbell <colin.campbell@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 12598: Re-add bug 18555: Create patron list from patron import
Jonathan Druart [Tue, 22 Aug 2017 16:34:17 +0000 (13:34 -0300)]
Bug 12598: Re-add bug 18555: Create patron list from patron import

Signed-off-by: Colin Campbell <colin.campbell@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 12598: Allow matched patron to be updated
Colin Campbell [Thu, 10 Aug 2017 12:56:24 +0000 (13:56 +0100)]
Bug 12598: Allow matched patron to be updated

When a test was introduced to not add duplicate userids
it overlooked that if you were matching on userid you
do not want the update to be rejected.

Add a test to overcome this logical flaw if updating
by matching userid

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 12598: Re-add some missing stuffs
Jonathan Druart [Tue, 25 Jul 2017 13:19:20 +0000 (10:19 -0300)]
Bug 12598: Re-add some missing stuffs

This patch will have to be squashed with previous ones, but for
readability I prefer to let it alone for now.

It reintroduces 2 missing changes:
  commit fd123903651435c56ca14d88897e9ce4d7a38bb5
    Bug 15010: Import patron tool creates 'duplicate' restrictions (
    debarments )
  commit 011d8e9855ffeb1779f5c1aadc9f4367c298cee7
    Bug 12543 - Add userid as matchpoint for "Import patrons" tool

Signed-off-by: Colin Campbell <colin.campbell@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 12598: Fix conflict with 17829 - GetMember
Jonathan Druart [Tue, 25 Jul 2017 13:10:54 +0000 (10:10 -0300)]
Bug 12598: Fix conflict with 17829 - GetMember

Signed-off-by: Colin Campbell <colin.campbell@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 12598: Fix conflict with bug 16911
Jonathan Druart [Thu, 6 Jul 2017 15:49:01 +0000 (12:49 -0300)]
Bug 12598: Fix conflict with bug 16911

Tests will have to be written for this change

Signed-off-by: Colin Campbell <colin.campbell@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 12598: Update code to use new modules
Jonathan Druart [Thu, 1 Jun 2017 13:12:48 +0000 (10:12 -0300)]
Bug 12598: Update code to use new modules

Signed-off-by: Colin Campbell <colin.campbell@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 12598: New misc/import_borrowers.pl command line tool
Kyle M Hall [Mon, 21 Jul 2014 17:50:08 +0000 (13:50 -0400)]
Bug 12598: New misc/import_borrowers.pl command line tool

Test Plan:
1) Apply this patch
2) Test importing patrons from command line,
   options are availble with --help.

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Tested with minimal csv
(cardnumber,surname,firstname,categorycode,branchcode,password,userid)

Overwrite does not change category or branch.
Patrons are loaded, userid & password works

Updated license to GPLv3
No other koha-qa errors.

Signed-off-by: Benjamin Rokseth <benjamin.rokseth@kul.oslo.kommune.no>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Bug 12598 - Tidy import_borrowers.pl

Signed-off-by: Benjamin Rokseth <benjamin.rokseth@kul.oslo.kommune.no>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Bug 12598 - Move importing code to a subroutine

Signed-off-by: Benjamin Rokseth <benjamin.rokseth@kul.oslo.kommune.no>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Bug 12598 - Update command line script to use patron import subroutine

Signed-off-by: Benjamin Rokseth <benjamin.rokseth@kul.oslo.kommune.no>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Bug 12598 [QA Followup]

* Fix copyright on import_borrowers.pl
* Changes -c --csv to -f --file
* Adds -c --confirm option
* Renames misc/import_borrowers.pl to misc/import_patrons.pl
* Restore userid matchpoint option

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Bug 12598 - Fix merge to master. Backport 3 updates from latest import_borrowers.pl

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Bug 12598 - Started regression tests. Fix missing C4::Members::Attributes package

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Bug 12598 - More refactoring and regression tests in Koha::Patrons::Import

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Bug 12598 - Creating objects in misc/import_patrons.pl and tools/import_borrowers.pl

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Bug 12598 - Refactoring Koha::Patrons::Import includes bug fixed for critical date types and header column parsing

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Bug 12598 - Rebase + backport of 16426 plus fixing 16426

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Bug 12598: catch warnings raised by import_patrons in tests

Signed-off-by: Colin Campbell <colin.campbell@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 18789: Add POD for is_adult and is_child
Jonathan Druart [Fri, 16 Feb 2018 16:57:07 +0000 (13:57 -0300)]
Bug 18789: Add POD for is_adult and is_child

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 18789: (QA follow-up) Fix viewlog when accessed via circulation
Josef Moravec [Fri, 16 Feb 2018 11:00:25 +0000 (11:00 +0000)]
Bug 18789: (QA follow-up) Fix viewlog when accessed via circulation

Test plan:
Go to any patron and then to Modification log of this patron
-- without patch you will not see the left side menu and patron information
-- with patch menu and patron information is here, and should be fully
working (links)

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 18789: (QA follow-up) Update holdshistory.pl, fix is_child, is_adult, patron...
Josef Moravec [Fri, 16 Feb 2018 10:58:42 +0000 (10:58 +0000)]
Bug 18789: (QA follow-up) Update holdshistory.pl, fix is_child, is_adult, patron->image, clear template params

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 18789: (QA follow-up) Use is_child in circulation.pl
Josef Moravec [Fri, 16 Feb 2018 10:57:15 +0000 (10:57 +0000)]
Bug 18789: (QA follow-up) Use is_child in circulation.pl

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 18789: (QA follow-up) Use patron object in batch checkout template
Josef Moravec [Fri, 16 Feb 2018 10:15:14 +0000 (10:15 +0000)]
Bug 18789: (QA follow-up) Use patron object in batch checkout template

1) Enable batch checkouts in system preferences and set it on for some
patron categories
2) Try to batch checkout for some patron with one of these categories
--> without patch the batch checkout page is even not shown
--> with patch batch checking out is working as expected

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 18789: (QA follow-up) Fix showing cardnumber when creating a hold
Josef Moravec [Fri, 16 Feb 2018 10:00:22 +0000 (10:00 +0000)]
Bug 18789: (QA follow-up) Fix showing cardnumber when creating a hold

Test plan:
1) Try to create a hold request for a patron
2) On place hold form on the first line is shown the patron name
--> without patch the cardnumber is not shown
--> with patch there is cardnumber right after the patron name

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 18789: (QA follow-up) Fix showing patron name when checking in
Josef Moravec [Fri, 16 Feb 2018 09:57:48 +0000 (09:57 +0000)]
Bug 18789: (QA follow-up) Fix showing patron name when checking in

Test plan:
1) Have a patron with more then one checkouts
2) Check in one of the checkouts
--> without patch patron name is not shown in checked-in items table
--> with patch the patron is shown with name, category, number of
checkouts and both links are working

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 18789: (QA follow-up) Fix loading saved address data to edit patron form
Josef Moravec [Fri, 16 Feb 2018 09:01:26 +0000 (09:01 +0000)]
Bug 18789: (QA follow-up) Fix loading saved address data to edit patron form

Test plan:
1) Have patron with address filled in
2) Edit the patron
-- without this patch the fields for address are blank
-- with patch the fields are filled with actual data

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 18789: (QA follow-up) Use first_valid_email_address on Tranfers to receive page
Josef Moravec [Fri, 16 Feb 2018 08:15:31 +0000 (08:15 +0000)]
Bug 18789: (QA follow-up) Use first_valid_email_address on Tranfers to receive page

For consistancy with waitng reserves

Test plan:
1) Have a hold for patron which need to be transfered, inititate
transfer and go to target library
2) Go to Circulation -> transfers to receive page and you should see any
first valid email for tha patron in column "On hold for"

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 18789: (QA follow-up) Fix showing the name of basket creator on booksellers page
Josef Moravec [Fri, 16 Feb 2018 08:02:39 +0000 (08:02 +0000)]
Bug 18789: (QA follow-up) Fix showing the name of basket creator on booksellers page

Test plan:
1) Go to Acquisition and search for a vendor, you are presented with vendors and their baskets
2) Look to Created by column
--> without patch only firstname is shown
--> with patch you should see full name

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 18789: (QA follow-up) Fix borrowernumber in menu item links
Josef Moravec [Fri, 16 Feb 2018 07:46:49 +0000 (07:46 +0000)]
Bug 18789: (QA follow-up) Fix borrowernumber in menu item links

Test plan:
Go to patrons routing list
Try to click Holds history or ILL requests menu link
--> without page blank page
--> with page desired page

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 18789: (QA follow-up) Fix tab char
Josef Moravec [Fri, 16 Feb 2018 07:45:35 +0000 (07:45 +0000)]
Bug 18789: (QA follow-up) Fix tab char

Test plan:

run koha qa tools, should be green

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 18789: Use the patron variable in circulation.[pl|tt]
Jonathan Druart [Thu, 15 Feb 2018 18:06:04 +0000 (15:06 -0300)]
Bug 18789: Use the patron variable in circulation.[pl|tt]

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 18789: Add tests for is_adult and is_child
Jonathan Druart [Thu, 15 Feb 2018 17:10:13 +0000 (14:10 -0300)]
Bug 18789: Add tests for is_adult and is_child

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 18789: (follow-up) Use Koha::Patron->image from the templates
Jonathan Druart [Wed, 7 Feb 2018 18:54:31 +0000 (15:54 -0300)]
Bug 18789: (follow-up) Use Koha::Patron->image from the templates

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 18789: (follow-up) Send Koha::Patron object to the templates
Jonathan Druart [Mon, 12 Jun 2017 17:20:26 +0000 (14:20 -0300)]
Bug 18789: (follow-up) Send Koha::Patron object to the templates

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 18789: Update other occurences where is_child should be used
Jonathan Druart [Thu, 1 Jun 2017 17:03:52 +0000 (14:03 -0300)]
Bug 18789: Update other occurences where is_child should be used

Trivial changes here, just do a code review on the QA step

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 18789: Remove adultborrower from the pay* scripts
Jonathan Druart [Thu, 1 Jun 2017 16:58:48 +0000 (13:58 -0300)]
Bug 18789: Remove adultborrower from the pay* scripts

This flag is not used in the templates

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 18789: Remove useless IS_ADULT variable
Jonathan Druart [Thu, 1 Jun 2017 16:58:04 +0000 (13:58 -0300)]
Bug 18789: Remove useless IS_ADULT variable

Test plan:
  git grep IS_ADULT
must not return any results

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 18789: Use Koha::Patron->is_adult where needed
Jonathan Druart [Thu, 1 Jun 2017 16:57:12 +0000 (13:57 -0300)]
Bug 18789: Use Koha::Patron->is_adult where needed

Test plan:
When editing adult's info you must see the "Add child" button

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 18789: Use Koha::Patron->is_child where needed
Jonathan Druart [Thu, 1 Jun 2017 16:52:30 +0000 (13:52 -0300)]
Bug 18789: Use Koha::Patron->is_child where needed

Test plan:
When you are on a page related to a child you should see the "Update
child to adult patron" button

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 18789: Add tests for is_adult and is_child
Jonathan Druart [Thu, 1 Jun 2017 16:51:09 +0000 (13:51 -0300)]
Bug 18789: Add tests for is_adult and is_child

This patch add 2 methods to the Koha::Patron module: is_adult and
is_child.
That way the business logic is at only one place and covered by tests.

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 18789: Use Koha::Patron->image from the templates
Jonathan Druart [Thu, 1 Jun 2017 16:29:45 +0000 (13:29 -0300)]
Bug 18789: Use Koha::Patron->image from the templates

Now that we have the 'patron' variable in all our templates, we can call
Koha::Patron->image and do the check from the templates.

Test plan:
On the different pages of the patron module, you should see the default
image if there is no image attached or the one that has been attached
(see pref patronimages)

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 18789: Pass a Koha::Patron object from returns.pl
Jonathan Druart [Thu, 1 Jun 2017 16:14:29 +0000 (13:14 -0300)]
Bug 18789: Pass a Koha::Patron object from returns.pl

This is a specific patch for returns.pl

Test plan:
Do some checkin for a patron and make sure the info are correctly
displayed (and info from someone that has placed a hold on this item)

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 18789: Send Koha::Patron object to the templates
Jonathan Druart [Thu, 1 Jun 2017 17:47:40 +0000 (14:47 -0300)]
Bug 18789: Send Koha::Patron object to the templates

In order to simplify and make uniform the code, the controller scripts send
a Koha::Patron object to the templates instead of all attributes of a patron.

That will make the code much more easier to maintain and will be less
error-prone.

The variable "patron" sent to the templates is supposed to represent the
patron the librarian is editing the detail.

In the members module and some scripts of the circulation module, the
patron's detail are sent one by one to the template. That leads to
frustration from developpers (making sure everything is passed from all
scripts) and to regression (we got tone of bugs in the last year because
of this way to do).
With this patch set it will be easy access patron's detail, passing only
1 variable from the controllers.

Test plan:
Play with the patron and circulation module and make sur the detail of
the patron you are editing/seeing info are correctly displayed.

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 20205: Add IDs to buttons in patron-toolbar.inc
Magnus Enger [Thu, 15 Feb 2018 09:14:56 +0000 (10:14 +0100)]
Bug 20205: Add IDs to buttons in patron-toolbar.inc

The buttons in patron-toolbar.inc lack unique IDs, making them
hard to style/remove with CSS. This patch adds IDs to all three
buttons.

To test:
- Look in koha-tmpl/intranet-tmpl/prog/en/includes/patron-toolbar.inc
  and verify there are no IDs
- Apply the patch and look at the file again to verify the IDs have
  been added
- Test the "New patron" and "Quick add new patron" buttons to verify
  they still work as intended
- Check that the new buttons are globally unique:
  $ grep -rn "new-patron-button" *
  $ grep -rn "patron-lists-button" *

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 20185: Remove warnings from stats.print.pl
Jonathan Druart [Mon, 12 Feb 2018 18:37:18 +0000 (15:37 -0300)]
Bug 20185: Remove warnings from stats.print.pl

This needs a full rewrite!

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 20185: Remove warnings from aqplan.pl
Jonathan Druart [Mon, 12 Feb 2018 16:58:28 +0000 (13:58 -0300)]
Bug 20185: Remove warnings from aqplan.pl

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 20182: [sql_modes] Remove group by clause in search_patrons_to_anonymise
Jonathan Druart [Mon, 5 Feb 2018 20:06:55 +0000 (17:06 -0300)]
Bug 20182: [sql_modes] Remove group by clause in search_patrons_to_anonymise

Not trivial, more attention needed on this one!

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

Looks like the query is complexified, perf tests needed, see bug 19599.

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 20176: [sql_modes] Set biblio.datecreated to NOW if not defined
Jonathan Druart [Mon, 5 Feb 2018 18:59:09 +0000 (15:59 -0300)]
Bug 20176: [sql_modes] Set biblio.datecreated to NOW if not defined

Fix at ->store level, this issue appears in lot of places.

Fix for:
Field 'datecreated' doesn't have a default value

Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 12904: Add KOHA_VERSION to few more .css
Jonathan Druart [Fri, 16 Feb 2018 15:58:34 +0000 (12:58 -0300)]
Bug 12904: Add KOHA_VERSION to few more .css

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 20193: Path to Greybox CSS broken after Bug 12904
Owen Leonard [Wed, 14 Feb 2018 14:12:00 +0000 (14:12 +0000)]
Bug 20193: Path to Greybox CSS broken after Bug 12904

Bug 12904 changed the way CSS and JS assets should be linked, but the
Greybox CSS path wasn't changed in the process. This patch adds the
required VERSION template variable to greybox.inc.

To test, apply the patch and test usage of Greybox in the staff client.
For instance:

- Go to Tools -> Labels -> Manage -> Label batches
- Select a batch for export and click the 'Export selected' button
- A Greybox modal should be triggered, and the export process should
  proceed correctly.

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 20191: Use find with unique key combination
Jonathan Druart [Fri, 16 Feb 2018 15:12:00 +0000 (12:12 -0300)]
Bug 20191: Use find with unique key combination

To prevent unexpected issues later.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 20191: Make OAI/Server.t tests use timestamps from the DB
Tomas Cohen Arazi [Thu, 15 Feb 2018 17:14:18 +0000 (14:14 -0300)]
Bug 20191: Make OAI/Server.t tests use timestamps from the DB

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 20221: Fix for JavaScript error during checkout patron search
Owen Leonard [Thu, 15 Feb 2018 19:43:39 +0000 (19:43 +0000)]
Bug 20221: Fix for JavaScript error during checkout patron search

This patch fixes a bug caused by the changes in Bug 19641. JavaScript
embedded in circ-patron-search-results.inc executes before jQuery is
loaded.

This patch adds a separate javascript file which can be included both in
circulation.tt and request.tt since both use the same include.

To test, apply the patch and submit a patron name in the check out form.
On the page of search results, clicking a table row should work the same
as clicking the patron name link.

Perform the same test during the hold process: Locate and place a hold
on a title. In the patron search form, submit a patron name and test the
behavior of the search results screen.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 18403: Prevent Modifications.t to fail randomly
Jonathan Druart [Fri, 16 Feb 2018 13:49:43 +0000 (10:49 -0300)]
Bug 18403: Prevent Modifications.t to fail randomly

    #   Failed test 'pending_count() correctly returns 2 if filtered by library'
    #   at t/db_dependent/Koha/Patron/Modifications.t line 355.
    #          got: '0'
    #     expected: '2'

    #   Failed test 'pending_count() correctly returns 2'
    #   at t/db_dependent/Koha/Patron/Modifications.t line 360.
    #          got: '0'
    #     expected: '2'

    #   Failed test 'pending_count() correctly returns 1'
    #   at t/db_dependent/Koha/Patron/Modifications.t line 365.
    #          got: '0'
    #     expected: '1'
    # Looks like you failed 3 tests of 16.

 #   Failed test 'pending_count() and pending() tests'
 #   at t/db_dependent/Koha/Patron/Modifications.t line 374.
 # Looks like you failed 1 test of 6.
 [19:45:28] t/db_dependent/Koha/Patron/Modifications.t

The logged in patron did not have permissions to view patron's info from other branches.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 19881: Remove authorities-list.pl
Jonathan Druart [Tue, 26 Dec 2017 21:05:56 +0000 (18:05 -0300)]
Bug 19881: Remove authorities-list.pl

For obvious reasons...

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 19847: Track links within the records and 404 for others
Jonathan Druart [Wed, 20 Dec 2017 15:13:10 +0000 (12:13 -0300)]
Bug 19847: Track links within the records and 404 for others

Test plan:
Behave like a robot, you will get 404
Be a human, you will be tracked

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 19738: Fix XSS on vendor name in serials module
Josef Moravec [Sun, 3 Dec 2017 22:21:57 +0000 (22:21 +0000)]
Bug 19738: Fix XSS on vendor name in serials module

Test plan:

1) do not apply this patch
2) Have at least one vendor which name does contain javascript, for
example: <i>Vendor 1</i><script>alert('Hi');</script>
3) go to serial module and create new subscription
4) use "Search for vendor"
5) Search for your vendor, when search results table is presented, the
javascript is executed
6) go through subscription creation and save the new subscription
7) On subscription detail page, the javascript is executed as well
8) apply this patch
9) Repeat 3-7, the script is not executed, the input is escaped

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 20216: Correctly populate values in itemtype editor
Nick Clemens [Thu, 15 Feb 2018 17:05:29 +0000 (17:05 +0000)]
Bug 20216: Correctly populate values in itemtype editor

Caused by a bad merge conflict on bug 12768.

To test:
1 - Edit an item type, define a replacement cost,processing fee, and
remote image url
2 - Save the item type
3 - Values are correct in list
4 - Edit again
5 - note values in fields are not populated
6 - Save itemtype, values are lost
7 - Apply patch
8 - Repeat 1-4
9 - Values should be correctly populated and saved now

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Bug 20216: (follow-up) - Fix other use of remote_image

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 19641: (follow-up) Update circulation.tt too
Jonathan Druart [Thu, 15 Feb 2018 18:20:16 +0000 (15:20 -0300)]
Bug 19641: (follow-up) Update circulation.tt too

Fix bad merge conflict with bug 18403

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 19641: (follow-up) Move patron templates to the footer
Jonathan Druart [Thu, 15 Feb 2018 18:09:35 +0000 (15:09 -0300)]
Bug 19641: (follow-up) Move patron templates to the footer

Fix bad merge conflict with bug 12904

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 20038: Switch single-column templates to Bootstrap grid: Acquisitions
Owen Leonard [Thu, 18 Jan 2018 19:41:45 +0000 (19:41 +0000)]
Bug 20038: Switch single-column templates to Bootstrap grid: Acquisitions

This patch updates several acquisitions module templates to use the
Bootstrap grid.

- acqui/z3950_search.tt - Acquisitions -> Vendor -> View basket -> Add
  to basket -> From an external source. The Z39.50 search form should
  look correct.
  - Search for a title. The search results page should look correct.

- acqui/addorder.tt - Acquisitions -> Vendor -> View basket -> Add to
  basket. Add an order to the basket which costs more than is available
  in the fund you select. The error/confirmation screen should look
  correct.

- acqui\modordernotes.tt - Acquisitions -> Vendor -> View basket -> Add
  internal or vendor note. The note add form should look correct.

- acqui/cancelorder.tt - Acquisitions -> Vendor -> View basket -> Cancel
  order (from an open basket which has existing orders). The
  confirmation screen should look correct.

- acqui\basketheader.tt - Acquisitions -> Vendor -> New basket. The new
  basket edit form should look correct.

Signed-off-by: Claire Gravely <claire.gravely@bsz-bw.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 20036: Switch single-column templates to Bootstrap grid: Offline circulation
Owen Leonard [Thu, 18 Jan 2018 18:00:20 +0000 (18:00 +0000)]
Bug 20036: Switch single-column templates to Bootstrap grid: Offline circulation

This patch updates three single-column offline circulation templates to
use the Bootstrap grid.

- offline_circ\process_koc.tt - Circulation -> Upload offline
  circulation.

- offline_circ\enqueue_koc.tt - After uploading offline circulation
  file -> Add to offline circulation queue. The confirmation page is the
  page to be tested.

- offline_circ\list.tt - From the confirmation page -> View pending
  offline circulation actions.

Each of these pages should look correct, with a single centered column
with wide margins on either side. At lower browser widths the margins
should disappear.

Signed-off-by: Claire Gravely <claire.gravely@bsz-bw.de>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 20035: Switch single-column templates to Bootstrap grid: Patron clubs
Owen Leonard [Thu, 18 Jan 2018 17:33:00 +0000 (17:33 +0000)]
Bug 20035: Switch single-column templates to Bootstrap grid: Patron clubs

This patch updates two single-column Patron clubs templates to
use the Bootstrap grid.

- clubs/clubs-add-modify.tt - Tools -> Patron clubs -> New club.
- clubs/templates-add-modify.tt - Tools -> Patron clubs -> New club
  template. Also changed in this file: Markup corrections. Label "for"
  attribute should match the form field's id attribute.

Each of these pages should look correct, with a single centered column
with wide margins on either side. At lower browser widths the margins
should disappear.

Signed-off-by: Claire Gravely <claire.gravely@bsz-bw.de>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 20034: Switch single-column templates to Bootstrap grid: Circulation
Owen Leonard [Thu, 18 Jan 2018 16:45:05 +0000 (16:45 +0000)]
Bug 20034: Switch single-column templates to Bootstrap grid: Circulation

This patch updates two single-column circulation templates to
use the Bootstrap grid.

- circulation-home.tt - Circulation home page. This patch corrects what
  appears to have been a long-broken three-column layout.

- article-requests.tt - Article requests list. Turn on the
  ArticleRequests system preference if necessary. Go to Circulation ->
  Article requests.

Each of these pages should look correct, with a single centered column
with wide margins on either side. At lower browser widths the margins
should disappear.

Signed-off-by: Claire Gravely <claire.gravely@bsz-bw.de>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 20033: Switch single-column templates to Bootstrap grid: Catalog
Owen Leonard [Thu, 18 Jan 2018 16:08:26 +0000 (16:08 +0000)]
Bug 20033: Switch single-column templates to Bootstrap grid: Catalog

This patch updates a few catalog-related single-column templates to use
the Bootstrap grid.

- basket/basket.tt - The staff client cart. Add some items to the cart
  and open the cart.

- catalogue/advsearch.tt - The advanced search page.

- catalogue/itemsearch.tt - The item search page, both the initial form
  and the search results.

Signed-off-by: Claire Gravely <claire.gravely@bsz-bw.de>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 20032: Switch single-column templates to Bootstrap grid: Tools
Owen Leonard [Thu, 18 Jan 2018 15:32:56 +0000 (15:32 +0000)]
Bug 20032: Switch single-column templates to Bootstrap grid: Tools

This patch updates several single-column Tools templates to
use the Bootstrap grid.

- batchMod-del.tt - Tools -> Batch item deletion -> Submit barcodes or
  item numbers for deletion. The grid is changed for the results and
  confirmation screens.

- batchMod-edit.tt - Tools -> Batch item modification -> Submit barcodes
  or item numbers for modification. The grid is changed for the results
  and confirmation screens.

- koha-news.tt - Tools -> News -> Edit or create a new news item. The
  grid is changed for the edit screen.

- letter.tt - Tools -> Notices and Slips -> Edit or create a notice. The
  grid is changed for the edit screen.

Each of these pages should look correct. The News and Notices page
should have a single centered column with wide margins on either side.
At lower browser widths the margins should disappear.

The batch mod screens should be displayed at full screen width.

Signed-off-by: Claire Gravely <claire.gravely@bsz-bw.de>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 19982: Switch single-column templates to Bootstrap grid: Patrons
Owen Leonard [Tue, 16 Jan 2018 16:00:23 +0000 (16:00 +0000)]
Bug 19982: Switch single-column templates to Bootstrap grid: Patrons

This patch updates two single-column patron module templates to use
the Bootstrap grid:

- discharges.tt - The list of pending discharges. One or more
  discharges must have been made via the OPAC. From the staff client
  home page, look for "Discharge requests pending."

- members-update.tt - The list of pending patron updates. One or more
  updates must have been submitted via the OPAC. From the staff client
  home page, look for "Patrons requesting modifications."

Each of these pages should look correct, with a single centered column
with wide margins on either side. At lower browser widths the margins
should disappear.

Signed-off-by: Claire Gravely <claire.gravely@bsz-bw.de>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 19960: Update popup window templates to use Bootstrap grid: Add to list
Owen Leonard [Thu, 11 Jan 2018 18:53:33 +0000 (18:53 +0000)]
Bug 19960: Update popup window templates to use Bootstrap grid: Add to list

This patch updates add-to-list template to use the Bootstrap grid
instead of the YUI grid.

To test, open the detail page for a bibliographic record in the staff
client and choose "Add to -> List." The resulting pop-up window should
look correct.

Signed-off-by: Zoe Bennett <zoebennett1308@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 19950: Update popup window templates to use Bootstrap grid: Serials
Owen Leonard [Wed, 10 Jan 2018 19:21:46 +0000 (19:21 +0000)]
Bug 19950: Update popup window templates to use Bootstrap grid: Serials

This patch updates the two serials templates to use the Bootstrap grid
instead of the YUI grid.

Apply the patch and go to Serials and locate an existing
subscription.

- Click the "Edit routing list" in the sidebar.
- Save the routing list, and click "Save and preview routing slip."
- The routing slip preview should look correct and buttons should work
  correctly.

- When viewing the details of a subscription, click the "Renew" button
  in the toolbar. The popup window should look correct.

Signed-off-by: Zoe Bennett <zoebennett1308@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 19755: Move template JavaScript to the footer: Acquisitions, part 3
Owen Leonard [Tue, 5 Dec 2017 18:30:08 +0000 (18:30 +0000)]
Bug 19755: Move template JavaScript to the footer: Acquisitions, part 3

This patch modifies even more staff client acquisitions templates so
that JavaScript is included in the footer instead of the header.

To test, apply the patch and test the JavaScript-driven features of the
modified templates: All button controls, DataTables functionality, tabs,
etc.

- Acquisitions -> Vendor -> Vendor details
  - Contracts datatable
  - Edit vendor
    - Add contacts, form validation
- Acquisitions -> Vendor -> Invoices -> Invoice -> "Go to receipt"
  - Datatables, MARC and Card previews
    - Transfer
      - Confirmation of transfer, window closes
- Acquisitions -> Vendor -> Receive shipments
  - Datatables, date pickers
- Acquisitions -> Available funds table -> Spent report
  - Datatables
- Acquisitions -> Vendor -> Uncertain prices
  - Datatables, form validation
- Acquisitions -> Vendor -> Basket -> Add to basket from external source
  - Select and clear all on search form
  - Search results
    - Datatables, MARC and Card previews, in-table pop-up controls
      (click any table cell)

Signed-off-by: Claire Gravely <claire.gravely@bsz-bw.de>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 19682: Move JS to the footer: Two patron-related tools
Owen Leonard [Wed, 22 Nov 2017 19:33:48 +0000 (19:33 +0000)]
Bug 19682: Move JS to the footer: Two patron-related tools

This patch modifies two patron-related tools templates in the staff
client so that JavaScript is included in the footer instead of the
header.

To test, apply the patch and test the JavaScript-driven features of
each modified template: All button controls, DataTables functionality,
form validation, etc.

  - Import patrons
  - Upload patron images

Signed-off-by: Claire Gravely <claire.gravely@bsz-bw.de>
Edit for QA: Fixed datepickers on import patron form

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 19641: (follow-up) Fix update child menu option
Owen Leonard [Fri, 26 Jan 2018 13:12:16 +0000 (13:12 +0000)]
Bug 19641: (follow-up) Fix update child menu option

This follow-up corrects handling of clicks on the "Update child" menu
option when the patron is an adult. Previously the click handler was
conditionally added via template markup. This patch modifies it to use
the data-tooltip attribute as an indicator that the option is disabled.

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

- Open an adult patron's record for viewing.
- Choose More -> Update child from the toolbar menu.
- The menu item should be disabled, and should show a tooltip.
- Clicking the menu item should do nothing.

- Open a child patron's record for viewing.
- Choose More -> Update child from the toolbar menu.
- The patron should be updated to an adult category.

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 19641: (follow-up) Correct popup templates
Owen Leonard [Thu, 11 Jan 2018 17:37:49 +0000 (17:37 +0000)]
Bug 19641: (follow-up) Correct popup templates

This patch corrects the footer include for two patron-related popup
windows. popup-bottom.inc should be considered obsolete, and
"'intranet-bottom.inc' popup_window=1" used in its place.

To test you must have more than one adult-type patron category defined.

- Locate and view a child-type patron record.
- From the "More" menu in the toolbar, choose "Update child to adult
  patron."
  - The popup window which appears should look correct and work
    correctly.
- Add a new patron and enter the first and last names of an existing
  patron.
  - When Koha asks to confirm a possible duplicate record, click the
    "View existing record" link. The popup which is triggered should
    look correct.

Signed-off-by: Zoe Bennett <zoebennett1308@gmail.com>
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 19641: (follow-up) Update circulation.tt too
Owen Leonard [Thu, 11 Jan 2018 16:15:01 +0000 (16:15 +0000)]
Bug 19641: (follow-up) Update circulation.tt too

This patch makes the same JS-to-footer changes to circulation.tt.
Inclusion of this template in this bug is necessary because it includes
members-toolbar.inc.

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

- Enter a patron card for checkout
- Test any JavaScript-driven actions on the checkout page, for instance:
    - Select all/clear all controls
    - Datepicker/timepickers
    - Datatable sorting, columns configuration
    - Renewals, check-ins
    - Patron message interactions, print slip, and other toolbar actions
    - Checkout exports
    - Search to hold
    - Tab loading: Restrictions, Holds, Clubs

Signed-off-by: Zoe Bennett <zoebennett1308@gmail.com>
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 19641: Move patron templates to the footer
Owen Leonard [Thu, 16 Nov 2017 16:08:07 +0000 (16:08 +0000)]
Bug 19641: Move patron templates to the footer

This patch modifies the staff client patron module templates so that
JavaScript is included in the footer instead of the header.

This patch touches a lot of files because the changes are all
interdependent, affecting a couple of module-wide include files.

To test, apply the patch and test the JavaScript-driven features of the
modified templates: All button controls, DataTables functionality, tabs,
etc.

Patrons -> Patrons home, patron search results
  -> Manage pending modification requests
  -> Patron detail page
    -> Edit patron
      -> Set guarantor
    -> Fines
       -> Account, Pay fines, Create manual invoice, Create manual
          credit
       -> Print receipts for different kinds of charges
    -> Routing lists
    -> Circulation history
    -> Holds history
    -> Notices
    -> Statistics
    -> Files
    -> Purchase suggestions
    -> Discharges
    -> Housebound
    -> Set permissions
    -> Change password
    -> Print summary, slips, and overdues
    -> Update child to adult patron type

Patron toolbar and patron search bar operations should work correctly on
all pages.

This patch also updates the template for searching the Norwegian
national patron database, but it has NOT been tested.

Signed-off-by: Claire Gravely <claire.gravely@bsz-bw.de>
Signed-off-by: Zoe Bennett <zoebennett1308@gmail.com>
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 20214: (bug 18403 follow-up) Fix patron search: remove newline breaking JSON
Victor Grousset [Thu, 15 Feb 2018 15:06:03 +0000 (16:06 +0100)]
Bug 20214: (bug 18403 follow-up) Fix patron search: remove newline breaking JSON

== Test plan ==
1. go/cgi-bin/koha/members/members-home.pl
2. search "a"
3. result never display
4. apply patch
5. search "a"
3. result display

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 19996: (RM follow-up 2) Remove commented use warnings;
Jonathan Druart [Thu, 15 Feb 2018 14:23:48 +0000 (11:23 -0300)]
Bug 19996: (RM follow-up 2) Remove commented use warnings;

This one is easy to fix.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 19996: (RM follow-up) Remove commented use warnings;
Jonathan Druart [Thu, 15 Feb 2018 14:20:34 +0000 (11:20 -0300)]
Bug 19996: (RM follow-up) Remove commented use warnings;

These plugins are very noisy, badly written and I have no idea what they
do.
t/db_dependent/FrameworkPlugin.t outputs a log of warnings about "
uninitialized value".

Let fix them later.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 20204: Add TestBuilder to replace CPL branch
Marcel de Rooy [Thu, 15 Feb 2018 08:08:59 +0000 (09:08 +0100)]
Bug 20204: Add TestBuilder to replace CPL branch

Remove CPL; without this branch, the test crashes.
Rearrange modules at the start.
Add Koha::Database calls.
Move a few global my vars to our level.
Remove intermediate rollbacks.

Test plan:
[1] Run prove t/db_dependent/FrameworkPlugin.t
    Ignore noise from unimarc plugins :)

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 19243: Fix tests for patron categories
Jonathan Druart [Tue, 26 Dec 2017 19:23:00 +0000 (16:23 -0300)]
Bug 19243: Fix tests for patron categories

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 19243: Fix tests for AV
Jonathan Druart [Tue, 26 Dec 2017 19:09:41 +0000 (16:09 -0300)]
Bug 19243: Fix tests for AV

The tricky part here was to find an alternative for ends-with in Xpath
version 1
Indeed there are 2  button with
"/admin/authorised_values.pl?op=add_form", and the first one was picked
(/admin/authorised_values.pl?op=add_form&category=Asort1)

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 19243: The "delete library" is now a button with id
Jonathan Druart [Tue, 26 Dec 2017 17:38:55 +0000 (14:38 -0300)]
Bug 19243: The "delete library" is now a button with id

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 19243: Fix for bug 19860
Jonathan Druart [Tue, 26 Dec 2017 17:37:43 +0000 (14:37 -0300)]
Bug 19243: Fix for bug 19860

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 19243: fix urls - do not use /cgi-bin/koha
Jonathan Druart [Tue, 26 Dec 2017 17:11:05 +0000 (14:11 -0300)]
Bug 19243: fix urls - do not use /cgi-bin/koha

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 19243: Amended Selenium test to add the creation of patron category and authorise...
Alex Buckley [Thu, 14 Dec 2017 23:07:30 +0000 (23:07 +0000)]
Bug 19243: Amended Selenium test to add the creation of patron category and authorised values

Sponsored-By: Catalyst IT
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 19243: Add selenium tests for the administration module
Jonathan Druart [Tue, 12 Dec 2017 22:11:15 +0000 (19:11 -0300)]
Bug 19243: Add selenium tests for the administration module

This is just a start.

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