]> git.koha-community.org Git - koha.git/log
koha.git
7 years agoBug 18746: Text_CSV_Various parse failures
Mark Tompsett [Wed, 7 Jun 2017 22:07:13 +0000 (18:07 -0400)]
Bug 18746: Text_CSV_Various parse failures

While it might be an idea to just delete it,
this patch attempts to catch everything and make it
clear that Text::CSV::Unicode (binary) is the parser
that should be used.

Signed-off-by: Lee Jamison <ldjamison@marywood.edu>
Running 'prove xt/author/Text_CSV_Various.t' passes

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
7 years agoBug 18759: (follow-up) Try to fix random failure from Circulation.t
Jonathan Druart [Fri, 9 Jun 2017 13:08:37 +0000 (10:08 -0300)]
Bug 18759: (follow-up) Try to fix random failure from Circulation.t

If IndependentBranches, CanBookBeRenewed will set ITEMNOTSAMEBRANCH
or BORRNOTSAMEBRANCH flags, if the branches do not match.

7 years agoBug 18641 - Translatability: Get rid of template directives in translations for ...
Marc Véron [Sat, 20 May 2017 07:18:10 +0000 (09:18 +0200)]
Bug 18641 - Translatability: Get rid of template directives in translations for *reserves.tt files

Template directives should not be exposed in translation, but lines like the following pop up in the translation tool:
Cancel [% IF TransferWhenCancelAllWaitingHolds %]and Transfer [% END %] All

This patch fixes it.

To test:
- Apply patch
- Verify that code changes make sense
- Verify that submit buttons of pendingreserves.tt and waitingreserves.tt
  still work and display the same string as before

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Bug 18641: (RM-followup) for waitingreserves.tt

Code changed for waitingreserves.tt as asked for in comment #7

Bug 18641: Followup for pendingreserves.tt (less %s)

Change as of comment #13 to reduce %s

After creating a new translation for a "language" aa-AA, we have
the following in the file aa-AA-staff-prog.po

msgid ""
"(Inclusive, default is %s days ago to %s days ahead. Set other date ranges "
"as needed.)"
msgstr ""

msgid ""
"(Inclusive, default is %s days ago to today. Set other date ranges as "
"needed.)"
msgstr ""

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
7 years agoBug 18759: Try to fix random failure from Circulation.t
Jonathan Druart [Thu, 8 Jun 2017 14:54:18 +0000 (11:54 -0300)]
Bug 18759: Try to fix random failure from Circulation.t

Circulation.t is failing randomly on our CI
https://jenkins.koha-community.org/job/Koha_Master_D8/192/console

    #   Failed test at t/db_dependent/Circulation.t line 1147.
    #          got: '1'
    #     expected: '0'

    #   Failed test at t/db_dependent/Circulation.t line 1152.
    #          got: '1'
    #     expected: '0'

    #   Failed test at t/db_dependent/Circulation.t line 1156.
    #          got: '1'
    #     expected: '0'

    #   Failed test at t/db_dependent/Circulation.t line 1170.
    #          got: '1'
    #     expected: '0'

    #   Failed test at t/db_dependent/Circulation.t line 1184.
    #          got: '1'
    #     expected: '0'
    # Looks like you failed 5 tests of 23.

Sometimes one of the alert or impossible flags is set.
This patch guesses that it's because of the 'restricted' value of the item that is evaluated to 1.
If it is not fixed by this patch, we will have more info next time (at least know
if alert or impossible is set).

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
The fix is trivial. Using random data will lead to this situations. The good thing is that
it lets us spot places in which tests need more fine-grained data.

7 years agoBug 18296: Remove perlcritic error (request.pl)
Jonathan Druart [Thu, 8 Jun 2017 14:59:38 +0000 (11:59 -0300)]
Bug 18296: Remove perlcritic error (request.pl)

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

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
7 years agoBug 18296: C4::Items - Remove GetItemInfosOf
Jonathan Druart [Wed, 15 Mar 2017 22:50:18 +0000 (19:50 -0300)]
Bug 18296: C4::Items - Remove GetItemInfosOf

At this point this subroutine is only used once, from reserve/request.pl.
Since we already have the items, it's easy to populate the different
hashes as the rest of the code is expecting it.

Test plan:
You need to create analytical record relationships (
EasyAnalyticalRecords needs to be set). Link an item to a biblio using
the 'Edit > Link to host item' menu from the biblio detail page.
From the staff interface place a hold on the biblio. You should see the
items from the biblio and the one you just linked

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
7 years agoBug 18648: Fix syntax 'unexpected end of input'
Jonathan Druart [Tue, 6 Jun 2017 14:06:29 +0000 (11:06 -0300)]
Bug 18648: Fix syntax 'unexpected end of input'

7 years agoBug 18289 - Fix t/Prices.t having a Test::DBIx::Class cache issue
Olli-Antti Kivilahti [Thu, 16 Mar 2017 19:28:08 +0000 (21:28 +0200)]
Bug 18289 - Fix t/Prices.t having a Test::DBIx::Class cache issue

REPLICATE ISSUE:

perl t/Prices.t -> fails

AFTER THIS PATCH AND DEPENDENCIES:

perl t/Prices.t -> OK

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
7 years agoBug 18288 - Fix t/SocialData.t having a Test::DBIx::Class cache issue
Olli-Antti Kivilahti [Thu, 16 Mar 2017 19:26:36 +0000 (21:26 +0200)]
Bug 18288 - Fix t/SocialData.t having a Test::DBIx::Class cache issue

REPLICATE ISSUE:

perl t/SocialData.t -> fails

AFTER THIS PATCH AND DEPENDENCIES:

perl t/SocialData.t -> OK

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
7 years agoBug 18287 - Fix t/Koha.t having a Test::DBIx::Class cache issue
Olli-Antti Kivilahti [Thu, 16 Mar 2017 19:17:24 +0000 (21:17 +0200)]
Bug 18287 - Fix t/Koha.t having a Test::DBIx::Class cache issue

REPLICATE ISSUE:

perl t/Koha.t -> fails

AFTER THIS PATCH AND DEPENDENCIES:

perl t/Koha.t -> OK

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
7 years agoBug 18226: Perltidy + license
Jonathan Druart [Mon, 5 Jun 2017 20:32:43 +0000 (17:32 -0300)]
Bug 18226: Perltidy + license

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
7 years agoBug 18226: [QA Follow-up] Remove verbose
Marcel de Rooy [Wed, 24 May 2017 12:14:50 +0000 (14:14 +0200)]
Bug 18226: [QA Follow-up] Remove verbose

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
7 years agoBug 18226: [QA Follow-up] Remove further assumptions on branch count
Marcel de Rooy [Wed, 24 May 2017 12:10:29 +0000 (14:10 +0200)]
Bug 18226: [QA Follow-up] Remove further assumptions on branch count

See also follow-up on bug 18286.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
7 years agoBug 18226 - Remove "use Test::DBIx::Class" instantiations' dangerous code duplication
Olli-Antti Kivilahti [Tue, 7 Mar 2017 16:56:29 +0000 (18:56 +0200)]
Bug 18226 - Remove "use Test::DBIx::Class" instantiations' dangerous code duplication

Is 'instantiations' even a word?

Use a Test::DBIx::Class defaults instead.

Save your keyboard and prevent horrible bugs from emerging from rampant code duplication.

This change doesn't seem to have any impact on the speed of executing those tests.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
7 years agoBug 18226 - Remove "use Test::DBIx::Class" instantiations' dangerous code duplication...
Olli-Antti Kivilahti [Wed, 8 Mar 2017 15:34:28 +0000 (17:34 +0200)]
Bug 18226 - Remove "use Test::DBIx::Class" instantiations' dangerous code duplication. Replace mock_dbh 2

Couldn't make the tests pass using Test::DBIx::Class, so reverted to the "usual way" since these tests are
in db_dependent anyway.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
7 years agoBug 18226 - Remove "use Test::DBIx::Class" instantiations' dangerous code duplication...
Olli-Antti Kivilahti [Tue, 7 Mar 2017 17:19:52 +0000 (19:19 +0200)]
Bug 18226 - Remove "use Test::DBIx::Class" instantiations' dangerous code duplication. Replace mock_dbh 1

t/00-load.t already checks if all of the perl modules can be compiled.

The tests deleted in this commit do a duplicate test with t/00-load.t
Hence they have become unnecessary.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
7 years agoBug 18286: [Follow-up] Remove assumption on branch count
Marcel de Rooy [Tue, 2 May 2017 14:18:41 +0000 (16:18 +0200)]
Bug 18286: [Follow-up] Remove assumption on branch count

A test in db_dependent should not make assumptions on the number of
branches in the database. If you need one, create one. Removing the
assumption of a non-zero count.

Removing the library count statement outside the subtest.
Replacing C4::Context by Koha::Database.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
7 years agoBug 18286: [QA Follow-up] Fix some warnings from qa tools
Marcel de Rooy [Tue, 2 May 2017 13:46:08 +0000 (15:46 +0200)]
Bug 18286: [QA Follow-up] Fix some warnings from qa tools

[1] Resolve warning on variable assignment before use strict.
[2] Remove unused $schema variable.
[3] Remove eval expression construction.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
7 years agoBug 18286: [Follow-up] Add t/etc/schema.pl
Marcel de Rooy [Tue, 2 May 2017 13:44:47 +0000 (15:44 +0200)]
Bug 18286: [Follow-up] Add t/etc/schema.pl

We need this file here already.
Copied from bug 18226 and adjusted in order to keep qa tools quiet.

Test plan:
Run t/db_dependent/01-test_dbic.t again.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
7 years agoBug 18286: Test::DBIx::Class connection/schema is shadowed by a cached connection...
Olli-Antti Kivilahti [Thu, 16 Mar 2017 19:08:31 +0000 (21:08 +0200)]
Bug 18286: Test::DBIx::Class connection/schema is shadowed by a cached connection/schema

If Koha::Database->schema gets called before

    use Test::DBIx::Class

The DB connection from $KOHA_CONF is cached.

This happens most of the time because when C4::Context and friends are loaded
(in compile-time?), they already access the DB.

After Test::DBIx::Class is instantiated and hooks put in place to overload
Koha::Schema connection, those hooks are never called due to getting the old
connection from cache.

This feature introduces a test case to replicate the behaviour and shows how
flushing the connection cache solves the problem.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
7 years agoBug 18285: Koha::Database schema cache accessors
Olli-Antti Kivilahti [Thu, 16 Mar 2017 18:59:35 +0000 (20:59 +0200)]
Bug 18285: Koha::Database schema cache accessors

Safe way of getting and flushing the $database->{schema} -cache.

This is needed by Test::DBIx::Class to overcome pre-initialization connection
caching from C4::Context and others.

See Bug 18286.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
7 years agoBug 18675: Translatability: Get rid of [%% in translation for csv-profiles.tt
Marc Véron [Fri, 26 May 2017 09:06:56 +0000 (11:06 +0200)]
Bug 18675: Translatability: Get rid of [%% in translation for csv-profiles.tt

Translation tool for file csv-profiles.tt picks following line:
%s [%% IF csv_profile.encoding == encoding OR NOT csv_profile AND encoding == 'utf8' %%]
It is is due to a line break inside a template directive. This patch removes it.

To test:
- Verify that code change makes sense
- Apply patch
- Verify that csv exports behave as before

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
7 years agoBug 18690 - Typos in Koha database description (Table "borrowers")
Marc Véron [Mon, 29 May 2017 18:13:03 +0000 (20:13 +0200)]
Bug 18690 - Typos in Koha database description (Table "borrowers")

This string patch fixes typos in kohastructure.sql as described in initial
comment.

To test:
- Carefully verify that string changes make sense

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
7 years agoBug 18681 - (followup) Remove on more [%% in translation for about.tt
Marc Véron [Tue, 30 May 2017 07:37:02 +0000 (09:37 +0200)]
Bug 18681 - (followup) Remove on more [%% in translation for about.tt

Test plan same as in previous patch
Run QA tools in newest version (test for line breaks in tt directives)

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
7 years agoBug 18681: Translatability: Get rid of [%% in translation for about.tt
Marc Véron [Fri, 26 May 2017 17:11:59 +0000 (19:11 +0200)]
Bug 18681: Translatability: Get rid of [%% in translation for about.tt

Translation tool picks a line
%s [%% IF warnPrefBiblioAddsAuthorities || warnPrefEasyAnalyticalRecords ||
...due to a line break inside a template directive.
This patch fixes it.

To test:
- Update QA tools
  (see https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18675#c2)
- Verify that code change makes sense
- Apply patch
- Run QA tools

Followed test plan and everything was as intended
Signed-off-by: Alex Buckley <alexbuckley@catalyst.net.nz>
Signed-off-by: Alex Buckley <alexbuckley@catalyst.net.nz>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
7 years agoBug 18695: Translatability: Get rid of [%% INCLUDE in translation for circulation.tt
Marc Véron [Tue, 30 May 2017 08:47:48 +0000 (10:47 +0200)]
Bug 18695: Translatability: Get rid of [%% INCLUDE in translation for circulation.tt

The file circ/circulation.tt exposes the following line to translation:
%s %s [%% INCLUDE 'blocked-fines.inc' fines = chargesamount %%] %s %s
Translators should not be confronted with code internals.

This patch fixes it by removing a line break.

To test:
- Verify that code change makes sense
- Run QA tools in newest version (check for line breaks in tt directives)
- Bonus test: Create a "language" aa-AA (perl translate create aa-AA
  from folder misc/translator, verify that line mentioned above do
  no longer appear in aa-AA-staff-prog.po )

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
7 years agoBug 18693: Translatability: Get rid of exposing a [%% FOREACH loop in translation...
Marc Véron [Tue, 30 May 2017 05:13:31 +0000 (07:13 +0200)]
Bug 18693: Translatability: Get rid of exposing a [%% FOREACH loop in translation for branch-selector.inc

The file branch-selector.inc exposes the following line to translation
(due to newlines insied a tt directive):
%s %s [%% FOREACH branch IN branches; IF branch.selected; selectall = 0; END; END %%]

Additionally, export.tt exposes the following line to translation:
[%% INCLUDE 'branch-selector.inc' branches = libraries %%]

To test:
- Apply patch
- In Staff client, go to Home > Tools > Export data
- Verify that library selection behaves as before
- Bonus test: Create a "language" aa-AA (perl translate create aa-AA
  from folder misc/translator, verify that lines mentioned above do
  no longer appear in aa-AA-staff-prog.po
- Run QA tools (newest version with test for newlines in tt directives)

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
7 years agoBug 18644: Translatability: Get rid of pure template directives in translation for...
Marc Véron [Tue, 30 May 2017 09:23:20 +0000 (11:23 +0200)]
Bug 18644: Translatability: Get rid of pure template directives in translation for memberentrygen.tt

Translation for memberentrygen.tt exposes a lot of template directives
like the following:
[% UNLESS opduplicate %][% othernames | html %][% END %]
Translators should not be confronted with such code internals.

To test:
- Review code changes
- Verify that creating / editing patrons works as before
- Bonus test: Create a "language" aa-AA (perl translate create aa-AA
  from folder misc/translator, verify that lines like mentioned above
  do no longer appear in aa-AA-staff-prog.po

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
7 years agoBug 18682 - Translatability: Get rid of [%% in translation for 2 files av-build-dropb...
Marc Véron [Tue, 30 May 2017 12:27:56 +0000 (14:27 +0200)]
Bug 18682 - Translatability: Get rid of [%% in translation for 2 files av-build-dropbox.inc

Two files av-build-dropbox.inc has linebreaks inside template directives,
 exposing internals (comments and tt code) to translations as mentioned
in initial comment.
Translators should not be confronted with such interal code.

This patch fixes it.

To test
- Verify, that code changes make sense and have no more line breaks insied
  tt directives.
- Run QA tools in newest version (checking for line breaks inside tt
  directives)
- Bonus test: Create a "language" aa-AA (perl translate create aa-AA
  from folder misc/translator, verify that lines mentioned above do
  no longer appear in aa-AA-staff-prog.po and in aa-AA-opac-bootstrap.po

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
7 years agoBug 18701: Translatability: Get rid of exposed tt directives in matching-rules.tt
Marc Véron [Tue, 30 May 2017 15:50:57 +0000 (17:50 +0200)]
Bug 18701: Translatability: Get rid of exposed tt directives in matching-rules.tt

Translation for file matching-rules.tt exposes a lot of template directives.

Translators should not be confronted with internal code like the following:

[%% PROCESS norms_select selected_norm=\"none\" id=\"mc_1_src_c_1_n_1_norm\" "name=\"mc_1_src_c_1_n_1_norm\" %%]

To test:
- Apply patch
- Verify that code changes make sense (removes line breaks in directives)
- Run QA tools in newset version (tests for line breaks in tt)
- Bonus test: create a new translation e.g. fpr language 'aa-AA', verify
  that such lines no longer appear in po/aa-AA-staff-prog.po
  (for matching-rules.tt)

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
7 years agoBug 18702: Translatability: Get rid of exposed if statement in tt for translated...
Marc Véron [Tue, 30 May 2017 16:50:16 +0000 (18:50 +0200)]
Bug 18702: Translatability: Get rid of exposed if statement in tt for translated onboardingstep2.tt

The file onboardingstep2.tt exposes the following to translations:

"[%% IF (categories && categories.count > 1 ) # This if statement checks if "
"the categories variable handed to this template # by onboarding.pl has data "
"in it. If the categories variable does have data # in it this means that the "
"user has previously imported sample patron category # data and so we do not "
"need to show them the create patron category screen 1, #instead we can "
"display a screen with ubtton redirecting the user to step 3 %%] "

Translators should not be confronted with such internals. This patch removes it

To test:
- Verify that code change makes sense
- Run QA tools
- Bonus test: Create a new "language" aa-AA and verify that the lines above
  are no longer exposed.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
7 years agoBug 18648: Translatability: Get rid of tt directives in translation for macles.tt
Marc Véron [Tue, 30 May 2017 19:10:32 +0000 (21:10 +0200)]
Bug 18648: Translatability: Get rid of tt directives in translation for macles.tt

koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/macles.tt contains
template directives inside a div tag:
<span title="[% FOREACH lib IN cell.libs %][% lib.lib |html %] - [% END %]">
This is exposed in translation tool.

To test:
- Carefully examine code changes
- Apply patch, verify that the directive is no longer exposed (picked for
  po files), e.g. by creating a new "language" aa-AA and examing aa-AA-staff-prog.po
- If you know where / how this macles is used, verify that it behaves as before

(Note: New patch, needs new sign off)

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
7 years agoBug 13747: Fix problems with frequency descriptions containing quotes
Marc Véron [Sun, 4 Jun 2017 20:09:14 +0000 (22:09 +0200)]
Bug 13747: Fix problems with frequency descriptions containing quotes

If a serial frequency description contains quotes or is surrounded by
quotes, the description is empty ("TEST" > empty) or shown without the
quotes part (TEST "sth" > TEST) on editing the frequency.

To verify:
- Create a new frequency with description: "Test"
- Modify frequency
- Verify the description field is empty

To test:
- Apply patch
- Try to recreate, verify that the description field is
  correctly filled when editing
- Test also with a name like: 'A "souble quoted" name'

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
7 years agoBug 18653: Possible privacy breach with OPAC password recovery
Marc Véron [Tue, 23 May 2017 05:08:41 +0000 (07:08 +0200)]
Bug 18653: Possible privacy breach with OPAC password recovery

OPAC password recovery allows to find out which email address belongs to an account. An attacker could systematically guess login names. If they hit an existing one, OPAC displays a message like:
An email has been sent to "xxx@yyy.zz".

Having a combination of login name and email, attackers could use the information e.g. for phishing or other personalized actions.

To reproduce:
- Enable OPAC password recovery (syspref OpacResetPassword)
- 'Guess' a login name e.g. by using a common pattern like ptester for Peter Tester
- If such account exists, you get to know the related email address

This patch removes the email address from the success message. Additionaly, it changes
wording to address Bug 18570 ('will be sent' instead of 'has been sent')

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Simplified the wording. "Will be sent shortly" is used elsewhere too.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
7 years agoBug 8612: Update installer files for late_issues
Jonathan Druart [Mon, 5 Jun 2017 15:55:36 +0000 (12:55 -0300)]
Bug 8612: Update installer files for late_issues

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
7 years agoBug 8612: DBRev 17.06.00.001
Jonathan Druart [Mon, 5 Jun 2017 15:27:12 +0000 (12:27 -0300)]
Bug 8612: DBRev 17.06.00.001

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
7 years agoBug 8612: Remove warnings from tests
Jonathan Druart [Mon, 5 Jun 2017 15:35:10 +0000 (12:35 -0300)]
Bug 8612: Remove warnings from tests

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
7 years agoBug 8612: [QA Follow-up] Remove two newlines from template output
Marcel de Rooy [Fri, 2 Jun 2017 06:08:57 +0000 (08:08 +0200)]
Bug 8612: [QA Follow-up] Remove two newlines from template output

When using the Default profile from the basket form, the resulting csv
file has an additional newline after the headers and at the end.
This patch removes them.
Unit test adjusted accordingly.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
7 years agoBug 8612: [Follow-up] Fix unit test GetBasketAsCSV.t
Josef Moravec [Mon, 20 Mar 2017 09:05:13 +0000 (09:05 +0000)]
Bug 8612: [Follow-up] Fix unit test GetBasketAsCSV.t

Test plan:
Run t/db_dependent/Acquisition/GetBasketAsCSV.t

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
7 years agoBug 8612: [Follow-up] Fix regular expression
Josef Moravec [Thu, 4 May 2017 07:43:27 +0000 (07:43 +0000)]
Bug 8612: [Follow-up] Fix regular expression

Fix regular expression to do what is described in the comment
Make header in CSV profile definition optional
Strip white chars from csv profile definition

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
7 years agoBug 8612: [Followup] Update DBIx schema
Josef Moravec [Mon, 20 Mar 2017 11:13:47 +0000 (11:13 +0000)]
Bug 8612: [Followup] Update DBIx schema

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
7 years agoBug 8612: [Follow-up] Make usage and type different columns in table
Josef Moravec [Mon, 20 Mar 2017 11:12:54 +0000 (11:12 +0000)]
Bug 8612: [Follow-up] Make usage and type different columns in table

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
7 years agoBug 8612: Use CSV profile for exporting basket
Blou [Thu, 26 Mar 2015 20:07:44 +0000 (16:07 -0400)]
Bug 8612: Use CSV profile for exporting basket

This patch allows the user to use a CSV export profile to create the fields to export the basket as CSV in a basket page.

Test plan:
1) Apply the patch
2) Go to Tools › CSV export profiles and create a profile of type "SQL for basket export in acquisition"
  example:
  biblionumber=biblio.biblionumber|auteur=biblio.author|titre=biblio.title|date=biblioitems.copyrightdate|editeur=biblioitems.publishercode|isbn=biblioitems.isbn|quantite=aqorders.quantity|prix=aqorders.rrp|panier=aqorders.basketno
3) In acquisition module, create a new basket and add an order to the basket
4) On basket detail page, there should be the split button labelled "Export to CSV"
5) Try to use the button and export CSV with your CSV profile you defined in step 2
6) Validate the CSV file.
7) Repeat 4-6 with a closed basket.
    a) close the basket
    b) View the basket
    c) validate that there is an export button
    d) test it with an export
8) prove t/db_dependent/Acquisition/GetBasketAsCSV.t t/db_dependent/Koha/CsvProfiles.t

Initial work:

Sponsored by: CCSR

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: mehdi <mehdi.hamidi@inlibro.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
7 years agoBug 18430 - Plugins page should have a link to viewing other types
Nick Clemens [Thu, 13 Apr 2017 16:34:06 +0000 (12:34 -0400)]
Bug 18430 - Plugins page should have a link to viewing other types

To test:
Go to the plugins page from
Reports->Report plugins
Tools->Tool plugins
Admin->Manage plugins

Ensure that you have a 'View plugins by class button'

Ensure the button does what you would expect

Signed-off-by: Christopher Brannon <cbrannon@cdalibrary.org>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
7 years agoBug 17944: QA follow-up
Jonathan Druart [Tue, 9 May 2017 18:56:32 +0000 (15:56 -0300)]
Bug 17944: QA follow-up

- Remove an unused use statement
- Fix pod
- Use snake_case
- Fix test "An itemtype cannot be deleted if and only if there is
biblioitem linked with it"

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>
7 years agoBug 17944 - Add Koha::ItemType->can_be_deleted and use it from admin/itemtypes.pl
Alex Buckley [Sun, 22 Jan 2017 01:52:50 +0000 (01:52 +0000)]
Bug 17944 - Add Koha::ItemType->can_be_deleted and use it from admin/itemtypes.pl

Removed the sql code from Itemtypes.pm and replaced  it with DBIx
database query in the itemtypes.pl administrative script

Test plan:
1. In the staff interface, stage and manage MARC records for import

2. Try to delete an itemtype. If there are items of that itemtype in the
   database then a message telling you the number of items of that
   itemtype there are will be displayed.

3. Record that number

4. View the admin/itemtpes.pl script and confirm that there is sql code
   written in this file.

5. Apply this patch

6. View the admin/itemtypes.pl script and observe that there is no sql
   in this file. There is however DBIx code, for example
   $schema->resultset('Item')->search({ 'itype' => $itemtype_code} );
   which is searching for items with the itype value matching
   $itemtype_code value.

7. In the staff interface try to delete the same itemtype

8. Record the number of items there are with that itemtype in the
   resulting message

9. The numbers recorded in steps 3 and 8 should match showing that the
   DBIx code is working as intended

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>
7 years agoBug 13913 - Renewal error message in OPAC is confusing
Owen Leonard [Sat, 29 Apr 2017 17:14:10 +0000 (17:14 +0000)]
Bug 13913 - Renewal error message in OPAC is confusing

This patch adds some formatting to the error message a patron receives
when there are renewal failures in the OPAC.

This is pretty much the least which could be done to address this
problem. However, I don't think the issue can be fixed without
re-thinking how renewals are processed. Sending error messages back to
opac-user.pl via URL parameter isn't flexible enough.

To test, apply the patch and attempt to renew multiple items in the OPAC
which cannot be renewed for some reason, for instance because they have
been renewed too many times. The error messages should appear in a list
rather than strung together in one long block of text.

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
7 years agoBug 11122: Follow up - Fix some display issues and typos
Katrin Fischer [Mon, 1 May 2017 23:08:02 +0000 (01:08 +0200)]
Bug 11122: Follow up - Fix some display issues and typos

This patch fixes the display of copyrightdate for MARC21 installations.
As MARC21 already requires you to add punctuation in cataloguing, there
is usually no need for punctutation in the templates.

Also fixes a template variable name typo and the basket summary page.

To test (all 3 patches):
- Add several order lines to an order, one should be uncertain
- Verify that the publisher and publication year are displayed
- Check the uncertain price page
- Verify that the publisher code and publication year are displayed
- Fix uncertain price and close your order
- Basket summary: Verify... (you know what)
- Cancel one of your orders
- Verify... for cancelled orders
- Receive shipment
- Verify... for unreceived orders
- Receive order
- Verify ... for received orders
- Finish receiving
- Verify ... on the invoice summary page

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
7 years agoBug 11122: Address MARC21 vs. UNIMARC issue
Mark Tompsett [Mon, 20 Apr 2015 00:28:21 +0000 (20:28 -0400)]
Bug 11122: Address MARC21 vs. UNIMARC issue

In comment #6 and comment #17, Katrin pointed out the discrepancy
between UNIMARC (using publisheryear) vs. Other MARC installations
(using copyrightdate). This was dealt with in invoice.tt already.
This patch does similar logic for the other 3 template files.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
7 years agoBug 11122 - publisher code and publication year not fetched in acq orders
Fridolyn SOMERS [Wed, 23 Oct 2013 10:05:23 +0000 (12:05 +0200)]
Bug 11122 - publisher code and publication year not fetched in acq orders

In acquisition, several templates try to display publisher code and publication year : invoice.tt, parcel.tt, transferorder.tt.
Thoses pages use C4::Acquisition methods GetPendingOrders or GetInvoiceDetails.
The bug is that in the SQL query of those methods, biblioitems.publishercode and biblioitems.publicationyear.
In uncertainprice.pl those datas are fetch using GetBiblioData.
It whould be better to fetch them in GetPendingOrders and GetInvoiceDetails.

This patch changes SQL queries to fetch wanted datas : aqorders.*,biblio.title,biblio.author,biblioitems.isbn,biblioitems.publishercode,biblioitems.publicationyear. GetInvoiceDetails also needs : biblio.seriestitle,biblioitems.volume.
This patch also unifies the way biblio datas are displayed :
  <a href="link to catalog using biblionumber">[title]</a> <em>by</em> [author] &ndash; [isbn]
  <em>Publisher:</em> [publishercode], [publicationyear]

Test plan :
- Choose a biblio record containing a data in :
    biblio.title,
    biblio.author,
    biblioitems.isbn,
    biblioitems.publishercode,
    biblioitems.publicationyear,
    biblio.seriestitle,
    biblioitems.volume.
- Create an order using this biblio.
- Look at this order in pages : parcel.pl, transferorder.pl, uncertainprice.pl
=> You see publisher code and publication year
- Look at this order in page : invoice.pl
=> You see publisher code, publication year, series title and volume

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
7 years agoBug 18700 Fix grammar (data cannot be pluralized)
Colin Campbell [Tue, 30 May 2017 14:17:58 +0000 (15:17 +0100)]
Bug 18700 Fix grammar (data cannot be pluralized)

data is a mass noun or plural of datum - datas is ungrammatical
and jarring for a native speaker.
Split the awkward sounding sentence into two for more clarity,
thanks to Marc Véron for the suggestion.

Signed-off-by: Marc Véron <veron@veron.ch>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
7 years agoBug 18673: News author does not display on staff client home page
Marc Véron [Thu, 25 May 2017 21:04:14 +0000 (23:04 +0200)]
Bug 18673: News author does not display on staff client home page

News authors do not display on staff client homepage, independently of
syspref 'NewsAuthorDisplay'. This patch fixes the issue.

To verify:
- Create news with display location 'All'
- Set syspref NewsAuthorDisplay to 'Staff client only' or 'Both OPAC and staff client'
- Go to staff client
- Verify that news author does not appear (but it should)

To test:
- Applly patch
- Verify that news author is displayed as expected

Followed test plan works as intended
Signed-off-by: Alex Buckley <alexbuckley@catalyst.net.nz>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
7 years agoBug 18643: Remove dead code in reports/statistics 'Till reconciliation'
Marc Véron [Sat, 20 May 2017 09:46:00 +0000 (11:46 +0200)]
Bug 18643: Remove dead code in reports/statistics 'Till reconciliation'

File koha-tmpl/intranet-tmpl/prog/en/modules/reports/reports-home.tt contains a link to /cgi-bin/koha/reports/stats.screen.pl with label 'Till reconciliation' that is commented out since years.
Remove this link and the related files:
cgi-bin/koha/reports/stats.screen.pl
koha-tmpl/intranet-tmpl/prog/en/modules/reports/stats_screen.tt

To test:
- Apply patch
- Verify that Koha > Reports still display the same
- Verify that two files stats.screen.pl and stats_screen.tt are gone and thet they are not used
  anywhere in the Koha codebase

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
7 years agoBug 18279: [QA Follow-up] Correct @EXPORT
Marcel de Rooy [Fri, 2 Jun 2017 08:27:26 +0000 (10:27 +0200)]
Bug 18279: [QA Follow-up] Correct @EXPORT

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
7 years agoBug 18279: Remove C4::Items::GetLostItems
Jonathan Druart [Wed, 15 Mar 2017 20:47:13 +0000 (17:47 -0300)]
Bug 18279: Remove C4::Items::GetLostItems

The JOIN done by this subroutine are not always useful (depending on
item-level_itypes). They also search with LIKE when it is not needed.

Since we have now Koha::Items, we can replace this subroutine with a
call to Koha::Items->search with the correct parameters.

A change in previous behaviours can happen: If a items.itemlost contains
a value that is not defined as a LOST authorised value, the item will
not be displayed. I think it's the expected behaviour, even if it should
not happen in correctly configured installations.

Test plan:
To test with item-level_itypes set to item and biblio:
List the lost items you have on your system, using the different
filters available.
The result table should contain the correct item's info.

Followed test plan, works as expected.
Signed-off-by: Marc Véron <veron@veron.ch>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
7 years agoBug 18295: C4::Items - Remove get_itemnumbers_of
Jonathan Druart [Wed, 15 Mar 2017 22:02:21 +0000 (19:02 -0300)]
Bug 18295: C4::Items - Remove get_itemnumbers_of

The code from scripts and subroutines using this subroutine was not very
elegant. Most of the time the code was unnecessarily complex.
This patch removes this subroutine and adapt the code to use
Koha::Items instead.

1. C4::Items::get_hostitemnumbers_of
I did not understand why the code was so complicated, it seems that we
only want to know if a given item has a given biblionumber
2. cataloguing/merge.pl
We want to retrieve the itemnumber for a given biblio.
We could also have done that with:
  Koha::Biblios->find( $biblionumber )->items;
3. labels/label-item-search.pl
We want to loop over the items for a given biblio, no need to use
get_itemnumbers_of and GetItemInfosOf.
We just need to use:
  Koha::Items->search({ biblionumber => $biblionumber })
4. reserve/request.pl
We want to retrieve the itemnumbers of the biblio's items
We could also have done that with:
  Koha::Biblios->find( $biblionumber )->items->get_column('itemnumber');

Test plan:
1.You need to create analytical record relationships (
EasyAnalyticalRecords needs to be set). Link an item to a biblio using
the 'Edit > Link to host item' menu from the biblio detail page.
From the staff interface place a hold on the biblio. You should see the
items from the biblio and the one you just linked
2. Merge two bibliographic records (with items), the resulting record
should contain items from both original records
3. Create a new label batch, edit it.
Add items to this batch ('Add items' button).
Fill the input with a barcode.
You should see all the items of a biblio.

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
7 years agoBug 18278: C4::Items - Remove GetItemLocation
Jonathan Druart [Wed, 15 Mar 2017 20:14:56 +0000 (17:14 -0300)]
Bug 18278: C4::Items - Remove GetItemLocation

This subroutine is no longer in used.
It was previously call from serials/serials-recieve.pl, which was not used and has been removed by
    commit 65b7ad030cd5cd0e3148fbbd1496d31b5cf149f7
    Bug 13423: Remove unused serials-recieve

Test plan:
  git grep GetItemLocation

Signed-off-by: Marc Véron <veron@veron.ch>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
7 years agoBug 18704 - File types limit in tools/export.pl is causing issues with csv files...
Nick Clemens [Tue, 30 May 2017 20:55:19 +0000 (16:55 -0400)]
Bug 18704 - File types limit in tools/export.pl is causing issues with csv files generated by MS/Excel

To test:
1 - Save a csv of biblionumber from MS/Excel
2 - Attempt to export records using this file
3 - It fails (mimetype is appliction/vnd.ms-excel)
4 - Apply patch
5 - Try again
6 - It succeeds!

Signed-off-by: Jason Palmer <jpalmer@switchinc.org>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
7 years agoBug 18179: Update 1 occurrence in booksellers.pl
Nick Clemens [Fri, 28 Apr 2017 16:11:28 +0000 (12:11 -0400)]
Bug 18179: Update 1 occurrence in booksellers.pl

To test:
1 - Load http://localhost:8081/cgi-bin/koha/acqui/booksellers.pl?booksellerid=1
2 - Should get internal server erro
3 - Apply patch
4 - Reload
5 - Should not get error

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
7 years agoBug 18179: Update existing calls
Jonathan Druart [Tue, 18 Apr 2017 16:50:36 +0000 (13:50 -0300)]
Bug 18179: Update existing calls

This patch updates the existing occurrences of ->find called in a list
context.
There are certainly others that are not easy to catch with git grep.
Test plan:
Confirm that the 4 modified scripts still works as expected.

We need this one ASAP in master to make sure we will not get other
side-effects of this kind and to catch possible uncaught occurrences
before the release.

Tested scripts changed by this patch, they work as expected.
Signed-off-by: Marc Véron <veron@veron.ch>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
7 years agoKoha 17.06 - unstable (start of a new dev cycle)
Jonathan Druart [Wed, 31 May 2017 18:35:15 +0000 (15:35 -0300)]
Koha 17.06 - unstable (start of a new dev cycle)

7 years agoDBRev 17.05.00.000 v17.05.00
Kyle M Hall [Tue, 30 May 2017 03:09:24 +0000 (03:09 +0000)]
DBRev 17.05.00.000

7 years agoAdd release notes for Koha 17.05
Kyle M Hall [Tue, 30 May 2017 03:08:18 +0000 (03:08 +0000)]
Add release notes for Koha 17.05

7 years agoTranslation updates for Koha 17.05
Bernardo Gonzalez Kriegel [Fri, 19 May 2017 17:26:48 +0000 (14:26 -0300)]
Translation updates for Koha 17.05

7 years agoBug 5395: Update C4::Acquisition::SearchOrders POD
Mark Tompsett [Wed, 24 May 2017 05:54:02 +0000 (01:54 -0400)]
Bug 5395: Update C4::Acquisition::SearchOrders POD

Comparing the perldoc to the function:
- basketname
- basketgroupname
- budget_id
Were missing. This adds them.

Also, a description of ordernumber and search were
added, as they are not self-evident by their name
alone.

There are no code changes, so all tests should pass
or fail identically before and after patch.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Fixed typo basetgroupname

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
7 years agoBug 18669 - RewriteCond affecting wrong rule in koha-httpd.conf
David Cook [Thu, 25 May 2017 04:37:21 +0000 (14:37 +1000)]
Bug 18669 - RewriteCond affecting wrong rule in koha-httpd.conf

One of the RewriteCond directives in koha-httpd.conf was affecting
the wrong RewriteRule after its original RewriteRule was commented out
years ago.

_TEST PLAN_
0) Before applying patch, build Koha from source
    *) make
    *) make install (or make upgrade)
    *) Copy or symlink etc/koha-httpd.conf to your Apache vhost directory
        (and enable if you're on a Debian based system)
    *) Restart Apache
1) Make sure that you have at least 1 bibliographic record in Koha
(URL like this http://server:port/cgi-bin/koha/opac-detail.pl?biblionumber=1)
2) Go to http://server:port/bib/1
3) Note that you get a 404 error
4) Apply the patch
5) Rebuild Koha from source as per step 0
6) Go to http://server:port/bib/1
7) Note that you now see the same page as you would if you went to
http://server:port/cgi-bin/koha/opac-detail.pl?biblionumber=1

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
7 years agoBug 18664: Make IssueSlip returns if params are not valid
Jonathan Druart [Tue, 23 May 2017 19:33:17 +0000 (16:33 -0300)]
Bug 18664: Make IssueSlip returns if params are not valid

Problem raised by bug 17762: IssueSlip should return if the params are
not valid.
The tests contain 2 FIXME to highlight this problem already, it's time
to fix them.

Note that, theoretically, this change may produce software error. Indeed
the caller expecting a hashref (letter) will access the "content" key.
But that should not happen.

Test plan:
Tests must return green

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
7 years agoBug 18632: Remove 'CGI::param called in list context' warnings
Jonathan Druart [Thu, 18 May 2017 20:42:02 +0000 (17:42 -0300)]
Bug 18632: Remove 'CGI::param called in list context' warnings

Once again, after bug 16154 and bug 16259 we need to remove more
occurrence of CGi->param called in list context.
Refer to bug 15809 for more information.

Test plan:
Make sure you do not see the error on the modified scripts.

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
7 years agoBug 18611: [QA Follow-up] Add unit test for GetItemNumbersFromImportBatch
Marcel de Rooy [Fri, 26 May 2017 08:25:10 +0000 (10:25 +0200)]
Bug 18611: [QA Follow-up] Add unit test for GetItemNumbersFromImportBatch

Test plan:
Run t/db_dependent/ImportBatch.t

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
7 years agoBug 18611: [QA Follow-up] Make SQL query more readable
Marcel de Rooy [Fri, 26 May 2017 08:20:00 +0000 (10:20 +0200)]
Bug 18611: [QA Follow-up] Make SQL query more readable

Make it more explicit by adding join statements.

Test plan:
See next patch for adding a unit test.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
7 years agoBug 18611 - Followup, remove tabs to make qa tools happy
Josef Moravec [Tue, 23 May 2017 11:03:04 +0000 (11:03 +0000)]
Bug 18611 - Followup, remove tabs to make qa tools happy

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
7 years agoBug 18611 - Create labels action fails in manage-marc-import.pl if an item has been...
Nick Clemens [Tue, 16 May 2017 09:40:28 +0000 (05:40 -0400)]
Bug 18611 - Create labels action fails in manage-marc-import.pl if an item has been deleted from the import batch.

To test:
1 - Import a batch with some items
2 - Delete one of the imported items
3 - Browse to Tools->Staged MARC record management
4 - Click (Create label batch) for the batch you imported
5 - Recieve an error
6 - Apply patch
7 - Click (Create label batch)
8 - Batch is created with remaning items from the import

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
7 years agoBug 18600 - DBRev 16.12.00.039
Kyle M Hall [Mon, 29 May 2017 02:21:16 +0000 (22:21 -0400)]
Bug 18600 - DBRev 16.12.00.039

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
7 years agoBug 18600: Add pref TalkingTechItivaPhoneNotification if missing
Jonathan Druart [Tue, 23 May 2017 19:16:39 +0000 (16:16 -0300)]
Bug 18600: Add pref TalkingTechItivaPhoneNotification if missing

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
7 years agoBug 18620: [QA Follow-up] Move the final rollback to the very end
Marcel de Rooy [Fri, 26 May 2017 09:20:42 +0000 (11:20 +0200)]
Bug 18620: [QA Follow-up] Move the final rollback to the very end

The new subtest in Reserves.t does not need its own transaction.
Move the original rollback to the very end of the test.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
https://bugs.koha-community.org/show_bug.cgi?id=18478

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
7 years agoBug 18478 - QA Followup
Nick Clemens [Tue, 23 May 2017 20:11:06 +0000 (16:11 -0400)]
Bug 18478 - QA Followup

Make sure to build necessary letters
Fix awkward construction

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
7 years agoBug 18478 - Additional unit tests
Nick Clemens [Tue, 16 May 2017 15:01:02 +0000 (11:01 -0400)]
Bug 18478 - Additional unit tests

This method was not previously covered, we don't change it , but
no reason to throw away these tests to ensure messages are created
as expected

To test:
1 - Apply this patch first
2 - Prove t/db_dependent/Reserves.t
3 - Last tests fail
4 - Apply other patch
5 - All tests should pass

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
7 years agoBug 18478 - Unit tests
Nick Clemens [Wed, 17 May 2017 16:58:09 +0000 (12:58 -0400)]
Bug 18478 - Unit tests

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
7 years agoBug 18478 - Some notices sent via SMS gateway fail
Nick Clemens [Wed, 17 May 2017 16:54:44 +0000 (12:54 -0400)]
Bug 18478 - Some notices sent via SMS gateway fail

It seems that for HOLD and DUE (and maybe more) notices we rely on
C4::Letters::SendQueuedMessages
to populate the correct address.

This patch adjust that subroutine to correctly populate the field and/or
fail messages if no SMS provider available

To test:
 1 - Define a messaging prefs for a patron to recieve hold notices via
 SMS
 2 - Ensure you have defined an SMS message for 'HOLD' letter
 3 - Set an SMS alert number for patron
 4 - Set the SMS::Send driver to 'Email'
 5 - Fill a hold for the patron
 6 - Check the db and note the address is null
 7 - run process_message_queue.pl
 8 - Check db - address is null and message pending
 9 - Apply patch
10 - run process_message_queue
11 - Message to_address should be populated and message sent

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
7 years agoBug 18620 - t/db_dependent/Letters.t failing on master
Nick Clemens [Wed, 17 May 2017 15:34:58 +0000 (11:34 -0400)]
Bug 18620 - t/db_dependent/Letters.t failing on master

To test:
1 - Set SMSSenDriver to 'Email'
2 - prove t/db_dependent/Letters.t
3 - Tests fail
4 - Apply patch
5 - prove t/db_dependent/Letters.t
6 - Less tests fail (should be 2 sms test failures)
7 - Set SMSSendDriver to another value or blank
8 - prove t/db_dependent/Letters.t
9 - Tests pass

Signed-off-by: Marc Véron <veron@veron.ch>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
7 years agoBug 18204 - Authority searches are not saved in Search history
LeireDiez [Thu, 11 May 2017 15:09:22 +0000 (17:09 +0200)]
Bug 18204 - Authority searches are not saved in Search history

When you search an authority in Authority search, this search is not saved in Search history.

EnableOpacSearchHistory is enabled

Steps to test:
 1- Login your account (opac)
 2- Search an authority in Authority search
 3- Go to Search history -> Authority
 4- It says "Your authority search history is empty"

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
7 years agoBug 16295: Fix access to MMT admin page
Jonathan Druart [Tue, 23 May 2017 17:10:20 +0000 (14:10 -0300)]
Bug 16295: Fix access to MMT admin page

There was a typo in the permission code

Test plan:
Try to access the marc modification templates admin page with the
marc_modification_templates permission (and not all tools permissions)

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
7 years agoBug 18663 - DBRev 16.12.00.038
Kyle M Hall [Mon, 29 May 2017 02:05:48 +0000 (22:05 -0400)]
Bug 18663 - DBRev 16.12.00.038

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
7 years agoBug 18663: Add pref ExportRemoveFields if missing
Jonathan Druart [Tue, 23 May 2017 19:16:17 +0000 (16:16 -0300)]
Bug 18663: Add pref ExportRemoveFields if missing

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
7 years agoBug 18662: Fix currency deletion
Jonathan Druart [Tue, 23 May 2017 16:02:30 +0000 (13:02 -0300)]
Bug 18662: Fix currency deletion

Sounds like it is caused by bug 13726.
It is not possible to delete a currency, even if not used by any vendors

Test plan:
Try and delete currencies used or not by vendors.

Signed-off-by: Marc Véron <veron@veron.ch>
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
7 years agoBug 15465: Fix typo in bugs.k-c.org
Jonathan Druart [Fri, 26 May 2017 14:45:31 +0000 (11:45 -0300)]
Bug 15465: Fix typo in bugs.k-c.org

7 years agoBug 16344: Fix test in GetHardDueDate.t
Jonathan Druart [Wed, 24 May 2017 15:27:47 +0000 (12:27 -0300)]
Bug 16344: Fix test in GetHardDueDate.t

7 years agoBug 18548: Print usage when missing instance name in koha-create script
Josef Moravec [Fri, 5 May 2017 10:23:23 +0000 (10:23 +0000)]
Bug 18548: Print usage when missing instance name in koha-create script

Test plan:
1. Run: debian/scripts/koha-create --request-db
-> Without patch you see the getent error message
-> With patch you see usage and "Missing instance name" message

Signed-off-by: Dilan Johnpulle <dilan@calyx.net.au>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
7 years agoBug 18569 - Quick add patron will not copy over details from cities and towns pull...
Nick Clemens [Fri, 12 May 2017 13:38:37 +0000 (09:38 -0400)]
Bug 18569 - Quick add patron will not copy over details from cities and towns pull down into patron details

Followed test plan and the city value updates in the quick add form correctly.
Signed-off-by: Dilan Johnpulle <dilan@calyx.net.au>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
7 years agoBug 18598 - Quick add form doesn't clear values when switching
Nick Clemens [Fri, 19 May 2017 02:00:44 +0000 (22:00 -0400)]
Bug 18598 - Quick add form doesn't clear values when switching

To test:
1 - Fill out some fields in quick add
2 - Switch to full form and clear fields
3 - Switch back and fields are still populated
4 - Fill a field in long form
5 - Switch to quick add and clear it
6 - Save
7 - Value set in 4 is saved
8 - Apply patch
9 - Repeat 1-6 - values should be cleared and not saved

Signed-off-by: Marc Véron <veron@veron.ch>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
7 years agoBug 18596 - Quick add form duplicating password confirm
Nick Clemens [Fri, 12 May 2017 13:18:45 +0000 (09:18 -0400)]
Bug 18596 - Quick add form duplicating password confirm

To test:
1 - Add password to BorrowerMandatoryField
2 - View quick add form
3 - See confirm password twice
4 - Apply patch
5 - See confirm password once
6 - Add password to QuickAddFields
7 - Confirm one confirm field
8 - Remove password form BorrowerMandatory field
9 - Confirm there is one confirm field and password fields are not
required

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
7 years agoBug 18642: Remove debug messages
Josef Moravec [Mon, 22 May 2017 10:38:02 +0000 (10:38 +0000)]
Bug 18642: Remove debug messages

Test plan:
0) Apply the patch
1) git grep Data::Printer
    -> should return no results
2) Go to Reports -> Use saved - should work fine

Signed-off-by: Marc Véron <veron@veron.ch>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
7 years agoBug 18647: Resolve internal server error on category_type
Marcel de Rooy [Tue, 23 May 2017 12:31:01 +0000 (14:31 +0200)]
Bug 18647: Resolve internal server error on category_type

See bug 18552. When we resolved the housebound_role bug, the hash got
filled correctly again. And this revealed that the (second) call to
Koha::Patrons->find was not appropriate. It can be removed, as Jonathan
explained on the report.

Note: Commit 95429af6855e8ed37945b681dc466bf360deffb added this call, but
it was hidden until the template variable hash got fixed.

Test plan:
Restart Plack and go to patron details again.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
7 years agoBug 17898: Followup - udpate templates for bootstrap 3
Josef Moravec [Fri, 13 Jan 2017 16:01:13 +0000 (16:01 +0000)]
Bug 17898: Followup - udpate templates for bootstrap 3

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
7 years agoBug 17898: Automagically convert SQL reports
Jonathan Druart [Fri, 13 Jan 2017 14:48:57 +0000 (15:48 +0100)]
Bug 17898: Automagically convert SQL reports

Bug 17196 move the marcxml out of the biblioitems table.
That will break SQL reports using it.
It would be handy to propose an automagically way to convert the SQL
reports.

We do not want to update the reports automatically without user inputs,
it will be too hasardous.
However we can lead the user to convert them.

In this patchset I suggest to warn the user if a report is subject to be
updated.

TODO: Add a way to mark this job done (using a pref?) to remove the
check and not to display false positives.

Test plan:
- Create some SQL reports (see https://wiki.koha-community.org/wiki/SQL_Reports_Library)
- Go on the report list page (/reports/guided_reports.pl?phase=Use saved)
- For the reports using biblioitems.marcxml you will see a new column
warning you that it is obsolete
- Click on update link
=> that will open a modal with the converted SQL query
- Click on the update button
=> you will be informed that the query has been updated

If all the reports are updated, the new column "Update" will no longer
be displayed.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
7 years agoBug 18551: followup - hide advanced filters in header, move hidding to css file
Josef Moravec [Tue, 9 May 2017 13:33:52 +0000 (13:33 +0000)]
Bug 18551: followup - hide advanced filters in header, move hidding to css file

Test plan:
The same as first patch, but also with advanced search form in header hidden
on page load - see comment 4

Issue with advanced search form is gone.
Signed-off-by: Marc Véron <veron@veron.ch>
Signed-off-by: Philippe <philippe.audet-fortin@inlibro.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
7 years agoBug 18551 - Hide with CSS dynamic elements in member search
Fridolin Somers [Fri, 5 May 2017 13:00:05 +0000 (15:00 +0200)]
Bug 18551 - Hide with CSS dynamic elements in member search

In member search page, the result table is in Ajax so fully managed by Javascript. There is also a yellow dialog message prepared in HTML.

Thoses elements are hidden by JS code : ie $("#patron_list_dialog").hide().

The problem is that the static page is first loaded an displayed then the JS code runs an hides the elements.
On a low performance computer, this action is visible and looks like there is a blinking yellow message.

I propose to hide with CSS so that thoses elements are not displayed in static page and are there shown in dynamic JS code.

Test plan :
Check display is unchanged :
- Go to home page /cgi-bin/koha/members/members-home.pl
- Perform patron search from header search box
- Perform patron search by clicking on a letter
- Perform patron search from filters (left of results table)
- Select a patron and add it to a list => you see the yellow message

Yellow message does no longer appear with this patch.
Signed-off-by: Marc Véron <veron@veron.ch>
Signed-off-by: Philippe <philippe.audet-fortin@inlibro.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
7 years agoBug 18578: Use subdirectory in /tmp for session storage during installation
Marcel de Rooy [Thu, 11 May 2017 07:10:50 +0000 (09:10 +0200)]
Bug 18578: Use subdirectory in /tmp for session storage during installation

Apply the change from bug 15553 to InstallAuth.pm too.

Test plan:
[1] Remove all cgisess_* files from your /tmp directory.
[2] Remove directory /tmp/cgisess_koha_[your instance], if there.
[3] Run the webinstaller
    /cgi-bin/koha/installer/install.pl?step=1&op=updatestructure
[4] Check if you have cgisess_ files in /tmp/cgisess_koha_[your instance].

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
7 years agoBug 18536: [QA Follow-up] Tiny regex simplification
Marcel de Rooy [Fri, 19 May 2017 09:39:24 +0000 (11:39 +0200)]
Bug 18536: [QA Follow-up] Tiny regex simplification

Simplify regex for removing table name.
No need to escape a dot between the square brackets. No need to specify a
number of 1 between parentheses.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
7 years agoBug 18536: Generating CSV using profile in serials late issues doesn't work as described
Josef Moravec [Thu, 4 May 2017 08:54:30 +0000 (08:54 +0000)]
Bug 18536: Generating CSV using profile in serials late issues doesn't work as described

Description on editing csv profiles says:

"You can also use your own headers (instead of the ones from Koha) by
prefixing the field name with an header, followed by the equal sign."

So the header should be optional, but in fact it's mandatory. Also the
regular expression to cut table name from beginning of db column is not
right.

Test plan:

0. Don't apply the patch
1. Make two CSV profiles for exporting late issues
    a) SUPPLIER=aqbooksellers.name|TITLE=subscription.title|ISSUENUMBER=serial.serialseq|LATE SINCE=serial.planneddate
    b) aqbooksellers.name|TITLE=subscription.title|ISSUE NUMBER=serial.serialseq|LATE SINCE=serial.planneddate
2. Export late issues, profile a) works as expected, profile b) doesn't
3. Apply the patch
4. Both profiles should work

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>