koha.git
6 years agoBug 19935: Replace GetPendingIssues - deletemem.pl
Jonathan Druart [Mon, 8 Jan 2018 14:16:09 +0000 (11:16 -0300)]
Bug 19935: Replace GetPendingIssues - deletemem.pl

Same as previously, we just want Koha::Patron->checkouts->count to know
if a patron has checkouts.

Test plan:
Confirm that you cannot delete a patron's card if they have pending checkouts

Signed-off-by: Benjamin Rokseth <benjamin.rokseth@deichman.no>
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 19935: Replace GetPendingIssues - Discharges
Jonathan Druart [Mon, 8 Jan 2018 14:15:02 +0000 (11:15 -0300)]
Bug 19935: Replace GetPendingIssues - Discharges

We should actually use Koha::Patron->checkouts here to avoid the
prefetch.

Test plan:
A patron with checkouts cannot get a discharge

Signed-off-by: Benjamin Rokseth <benjamin.rokseth@deichman.no>
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 19935: Replace GetPendingIssues - ILSDI
Jonathan Druart [Mon, 8 Jan 2018 14:10:50 +0000 (11:10 -0300)]
Bug 19935: Replace GetPendingIssues - ILSDI

Here we should only access to what we want in the template, but let do
it as it for now.

Test plan:
Hit
/cgi-bin/koha/ilsdi.pl?service=GetPatronInfo&patron_id=542&show_contact=0&show_loans=1

With 42 a borrowernumber with checkouts

Before and after these patches the XML must be the same

Signed-off-by: Benjamin Rokseth <benjamin.rokseth@deichman.no>
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 19935: Replace GetPendingIssues - IssueSlip
Jonathan Druart [Mon, 8 Jan 2018 18:49:18 +0000 (15:49 -0300)]
Bug 19935: Replace GetPendingIssues - IssueSlip

Luckily we have a good test coverage here!

Test plan:
Print issue slips before and after these patches (with overdues, etc.)
They should be the same.

Signed-off-by: Benjamin Rokseth <benjamin.rokseth@deichman.no>
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 19935: Add Koha::Patron->pending_checkouts
Jonathan Druart [Mon, 8 Jan 2018 18:49:03 +0000 (15:49 -0300)]
Bug 19935: Add Koha::Patron->pending_checkouts

To move this subroutine out of the C4 namespace we face the same
problematic as bug 17553 (with GetOverduesForPatron).
We need to provide an equivalent method and so return all the related
value for a given checkout.
We can acchieve the easily using Koha::Object->unblessed_all_relateds,
but we need to keep in mind that it is a temporary move.
Indeed we will want to use our API to only access/retrive values we really need.
The whole trick could be removed when the current syntax for notices
will be deprecated and removed.

Note: this method returns the same number of elements than ->checkouts
They indeed returns the same things, but it sounds better to me to have a
different method to highlight (from the callers) where does it come
from (C4::Members::GetPendingIssues).

Signed-off-by: Benjamin Rokseth <benjamin.rokseth@deichman.no>
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 17553: (follow-up) Adjust number of tests
Josef Moravec [Tue, 3 Apr 2018 12:28:21 +0000 (12:28 +0000)]
Bug 17553: (follow-up) Adjust number of tests

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 17553: Move GetOverduesForPatron to Koha::Patron->get_overdues
Jonathan Druart [Mon, 8 Jan 2018 16:19:51 +0000 (13:19 -0300)]
Bug 17553: Move GetOverduesForPatron to Koha::Patron->get_overdues

With the help of Koha::Object->unblessed_all_relateds we are going to
replace GetOverduesForPatron without introducing regressions (hopefully)
on both template notice syntaxes.

Test plan:
0/ Do not apply any patches
1/ Check some items in to a given patron, with and without overdues.
2/ Print the overdues slip (Circulation module > Print > Print overdues)
3/ Apply these patches
4/ Print again and compare the result
=> The 2 generated slips must be exactly the same

Signed-off-by: Benjamin Rokseth <benjamin.rokseth@deichman.no>
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 17553: Move existing tests
Jonathan Druart [Fri, 4 Nov 2016 10:23:56 +0000 (10:23 +0000)]
Bug 17553: Move existing tests

Signed-off-by: Benjamin Rokseth <benjamin.rokseth@deichman.no>
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 19926: Add tests for Koha::Object->unblessed_all_relateds
Jonathan Druart [Mon, 8 Jan 2018 16:48:28 +0000 (13:48 -0300)]
Bug 19926: Add tests for Koha::Object->unblessed_all_relateds

Signed-off-by: Benjamin Rokseth <benjamin.rokseth@deichman.no>
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 19926: Add the Koha::Object->unblessed_all_relateds method
Jonathan Druart [Mon, 8 Jan 2018 16:19:16 +0000 (13:19 -0300)]
Bug 19926: Add the Koha::Object->unblessed_all_relateds method

In order to refactor our legacy code step-by-step, we will need to
provide code with the exact same behaviors and then improve it.

The same idea appears for the TT syntax for notices: we will want to
deprecate the existing syntax in order to support only one syntax.
Currently we fetch all the values from the related tables, without
knowing which are actually used.

I am suggestion to introduce a Koha::Object->unblessed_all_relateds
method which will return a hash containing all the fields from the
related tables (with the problems we know: collision in column names).
It is the existing behavior of GetOverduesForPatron and GetPendingIssues
for instance, they are used to send notices and so we have to provide
all the data needed.

See dependent bugs to understand the context and test this patch.

Signed-off-by: Benjamin Rokseth <benjamin.rokseth@deichman.no>
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 7143: Update about page for new dev - Roch D'Amour
Jonathan Druart [Tue, 3 Apr 2018 14:21:28 +0000 (11:21 -0300)]
Bug 7143: Update about page for new dev - Roch D'Amour

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 7143: Update about page for new dev - Philippe Audet-Fortin
Jonathan Druart [Tue, 3 Apr 2018 14:18:08 +0000 (11:18 -0300)]
Bug 7143: Update about page for new dev - Philippe Audet-Fortin

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 7143: Update about page for new releases
Jonathan Druart [Tue, 3 Apr 2018 14:16:53 +0000 (11:16 -0300)]
Bug 7143: Update about page for new releases

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 18820: Main block size now adjust to OpacNavRight like it would for opacuserlogin
Roch D'Amour [Thu, 22 Feb 2018 21:08:59 +0000 (16:08 -0500)]
Bug 18820: Main block size now adjust to OpacNavRight like it would for opacuserlogin

Test plans  :
- "beforepatch.png" shows the result you get when OpacNavRight and opacnav are set to false.
- "opacuserlogin=f_opacnav=f.png" shows the result with the patch and OpacNavRight and opacnav set to false
- "opacuserlogin=t_opacnav=f.png" shows the result with the patch and OpacNavRight set to true and opacnav set to false

Applied patch, can confirm it functions as expected.
Signed-off-by: Dilan Johnpullé <dilan@calyx.net.au>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 18820: Adding lines that check if opacuserlogin is enable and if OpacNav has...
Paudet [Mon, 19 Jun 2017 13:27:15 +0000 (09:27 -0400)]
Bug 18820: Adding lines that check if opacuserlogin is enable and if OpacNav has content.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Dominic Pichette <dominic@inlibro.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.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 20497: Access LibraryThing assets using HTTPS
Tomas Cohen Arazi [Thu, 29 Mar 2018 19:12:28 +0000 (16:12 -0300)]
Bug 20497: Access LibraryThing assets using HTTPS

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.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 19892: (follow-up) Replace one more instance
Owen Leonard [Tue, 27 Mar 2018 16:46:16 +0000 (16:46 +0000)]
Bug 19892: (follow-up) Replace one more instance

This patch replaces one more instance of [% IF ( numbersphr ) %].

To test, apply the patch and view the source of the OPAC home page.

With the OPACNumbersPreferPhrase system preference set to 'use,' you
should find this in the HTML source:

<option value="callnum,phr">Call number</option>

With the preference set to 'don't use,' you should find this:

<option value="callnum">Call number</option>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 19892: Replace numbersphr variable with Koha.Preference('OPACNumbersPreferPhrase...
Charlotte Cordwell [Thu, 18 Jan 2018 01:29:05 +0000 (01:29 +0000)]
Bug 19892: Replace numbersphr variable with Koha.Preference('OPACNumbersPreferPhrase') in OPAC

Test Case
1) Check that the following files have been changed properly.
opac/opac-search.pl
 opac/opac-main.pl
 koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-advsearch.tt

2)Apply bug
3) Check that there are no differences in behaviour as a result of the patch.

Signed-off-by: Roch D'Amour <roch.damour@inlibro.com>
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 20291: DBRev 17.12.00.025
Jonathan Druart [Mon, 2 Apr 2018 21:05:39 +0000 (18:05 -0300)]
Bug 20291: DBRev 17.12.00.025

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 20291: (follow-up) Rename NoLoginInstructions to OpacLoginInstructions
Nick Clemens [Thu, 29 Mar 2018 10:14:59 +0000 (10:14 +0000)]
Bug 20291: (follow-up) Rename NoLoginInstructions to OpacLoginInstructions

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 20291: (follow-up) Add sysprefs.sql changes
Nick Clemens [Tue, 27 Feb 2018 10:45:46 +0000 (10:45 +0000)]
Bug 20291: (follow-up) Add sysprefs.sql changes

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 20291: Add a StaffLoginInstructions preference for adding text to staff client...
Nick Clemens [Wed, 21 Feb 2018 04:56:23 +0000 (04:56 +0000)]
Bug 20291: Add a StaffLoginInstructions preference for adding text to staff client login

To test:
1 - Apply patches
2 - Upgrade database
3 - Check the staff client login page, should be no change
4 - Add something to the preferene
5 - It should appear on the login page

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 20052: (follow-up) Fix QA tool complaints and bad copy
Nick Clemens [Thu, 29 Mar 2018 13:00:36 +0000 (13:00 +0000)]
Bug 20052: (follow-up) Fix QA tool complaints and bad copy

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 20052: Add Koha Reports object class
Nick Clemens [Mon, 15 Jan 2018 14:38:13 +0000 (14:38 +0000)]
Bug 20052: Add Koha Reports object class

To test:
prove -v t/db_dependent/Koha/Reports.t

Signed-off-by: Claire Gravely <claire.gravely@bsz-bw.de>
Signed-off-by: Maksim Sen <maksim.sen@inlibro.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 18382: (QA follow-up) Make new unit test pass
Kyle M Hall [Wed, 28 Mar 2018 19:58:37 +0000 (19:58 +0000)]
Bug 18382: (QA follow-up) Make new unit test pass

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 18382: Add a test
Jonathan Druart [Tue, 27 Mar 2018 17:09:54 +0000 (14:09 -0300)]
Bug 18382: Add a test

This is what I am expecting but I may be wrong.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 18382: (QA follow-up) Don't set suspend_until if dt if undefined
Kyle M Hall [Tue, 27 Mar 2018 14:45:09 +0000 (10:45 -0400)]
Bug 18382: (QA follow-up) Don't set suspend_until if dt if undefined

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 18382: (QA follow-up) Replace ->ymd by ->datetime
Marcel de Rooy [Thu, 22 Mar 2018 08:17:46 +0000 (09:17 +0100)]
Bug 18382: (QA follow-up) Replace ->ymd by ->datetime

The first patch makes Hold.t fail on:
not ok 8 - Hold is suspended with a date, truncation takes place automatically
   Failed test 'Hold is suspended with a date, truncation takes place automatically'
   at Hold.t line 94.
          got: '2018-03-22'
     expected: '2018-03-22T00:00:00'

We could remove the midnight time there, but we also could replace ymd by
datetime. The cpan doc tells us:
    Same as $dt->ymd('-') . 'T' . $dt->hms(':')

Test plan:
With this patch, run Hold.t again. It should pass now.

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 18382: action_logs entry for module HOLDS, action SUSPEND is spammy
Kyle M Hall [Mon, 5 Jun 2017 14:46:45 +0000 (10:46 -0400)]
Bug 18382: action_logs entry for module HOLDS, action SUSPEND is spammy

When a hold is suspended, 'suspend_until' is represented as a DateTime object, complete with locale. All told, this is about 800 lines of text.

Test Plan:
1) Enable the HoldsLog syspref
2) Add a hold on a record/item
3) Suspend the hold with a date to resume
4) Note the massive amount of date in the suspend_until field
5) Apply this patch
6) Suspend another hold with a date to resume
7) Note the log has an acutal date in the suspend_until field

Check the logs using module 'Holds' and Action 'Suspend'

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 20494: Remove unused code in neworderempty.pl and addbiblio.pl
Nick Clemens [Thu, 29 Mar 2018 12:33:56 +0000 (12:33 +0000)]
Bug 20494: Remove unused code in neworderempty.pl and addbiblio.pl

Should be sufficient to read code and see all lines were commented and
that this patch removes useless lines

To be thorough, ensure that your can add an order to a basket and add a
biblio.

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 18979: Speed up 'valid-templates.t' tests
Jonathan Druart [Wed, 19 Jul 2017 23:29:26 +0000 (20:29 -0300)]
Bug 18979: Speed up 'valid-templates.t' tests

Test plan:
Confirm than prove xt/author/valid-templates.t is quicker with this
patch.

Before I got:
Files=1, Tests=840, 21 wallclock secs ( 0.18 usr  0.02 sys + 20.28 cusr
0.32 csys = 20.80 CPU)

After:
Files=1, Tests=840, 17 wallclock secs ( 0.06 usr  0.01 sys + 21.56 cusr
0.48 csys = 22.11 CPU)

Signed-off-by: David Bourgault <david.bourgault@inlibro.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 20282: Match course reserve on holdingbranch
Nick Clemens [Fri, 23 Feb 2018 10:58:27 +0000 (10:58 +0000)]
Bug 20282: Match course reserve on holdingbranch

To test:
1 - Add a course (Course Reserves)
2 - Add an item to the course
3 - Ensure to change the holding branch for the course reserve
4 - Modify the course item
5 - Note the dropdwn for holding branch is unset
6 - Apply patch
7 - Modify the course item
8 - Dropdown should be correctly populated

Signed-off-by: Maksim Sen <maksim.sen@inlibro.com>
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 20369: Analytics search is broken with QueryAutoTruncate set to 'only if * is...
Kyle M Hall [Mon, 12 Mar 2018 11:15:12 +0000 (07:15 -0400)]
Bug 20369: Analytics search is broken with QueryAutoTruncate set to 'only if * is added'

Test Plan:
1) Enable EasyAnalytics
2) Disable QueryAutoTruncate
3) Create an analytic record, add some host items to it
4) Browser to the analytics tab for the record
5) Click the link in the 'used in' column of the table
6) No search results
7) Apply this patch
8) Reload the page, now you get the analytic record!

Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 19907: Fix email validation in patron edit form
Josef Moravec [Wed, 3 Jan 2018 11:20:46 +0000 (11:20 +0000)]
Bug 19907: Fix email validation in patron edit form

Test plan:
0) Confirm that email validation is not working in add/edit patron form
1) Apply the patch
2) Edit/add patron, the e-mail validation should be working now
3) Ensure the password validation is still working (use test plan from
    bug 19908)

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 20462: Ensure batch item deletion will not delete the same item twice
Jonathan Druart [Mon, 26 Mar 2018 15:22:15 +0000 (12:22 -0300)]
Bug 20462: Ensure batch item deletion will not delete the same item twice

This has been done on bug 9509 when barcodes are scaned, but not when using a text file.

Test plan (stolen from Barton on the bug report):
1) Create a text file containing duplicate barcodes

Here's a quick way to do that, substitute INSTANCE for the instance name of your test server:

sudo koha-mysql INSTANCE <<< "select barcode from items where barcode is not null limit 3" | sed '1d;p' > /tmp/dup_barcodes.txt

2) Go to Home › Tools › Batch item deletion
3) Click 'Choose File', select the file you created in step 1.
4) Click 'Continue'
5) Note that duplicate items appear in the list of items to batch delete
6) Check 'Delete records if no items remain'
7) This will trigger a software error

Note that entering the barcodes via the 'scan items one by one' text box removes duplicates in the list, so this only causes problems when uploading a file.

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 20318: Add class 'required' to the label
Jonathan Druart [Mon, 2 Apr 2018 17:30:23 +0000 (14:30 -0300)]
Bug 20318: Add class 'required' to the label

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 20318: Merge invoices can lead to an merged invoice without Invoice number
Christophe Croullebois [Wed, 14 Mar 2018 14:28:28 +0000 (14:28 +0000)]
Bug 20318: Merge invoices can lead to an merged invoice without Invoice number

When you want to merge invoices you have a page with a non editable
field 'Invoice number:' it shows the content of the first invoice to be
merged.
But if you validate by clicking the 'merge' button you arrive on the
next page which says that 'Invoice has been modified' and if you quit
this page without saving you have now a merged invoice without Invoice
number.
This tiny patch just prevents this issue to occur.

Test plan :

1° go to the acqui/invoices.pl page and search invoices to merge.
You must have at least 2 invoices on the same vendor
2° check boxes to select invoices to merge and click on 'merge selected
invoices' button
3° next page you see the non editable field 'Invoice number:'
4° click on the 'merge' button
5° next page you see 'Invoice has been modified'
6° leave this page i.e click on the left link 'Invoices'
7° search invoices you'll see the merged invoice without invoice number.

Apply the patch, replay the steps 1 to 3
4° on this page you can enter your invoice number and click on the
'merge' button.
If you leave this field empty and click merge, a message informs you
that it is required and you can not merge.

Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 18474: (QA follow-up) Remove useless else in template
Kyle M Hall [Fri, 30 Mar 2018 11:08:30 +0000 (07:08 -0400)]
Bug 18474: (QA follow-up) Remove useless else in template

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 18474: Restore multiple holds when patron is searched for
Jonathan Druart [Thu, 21 Dec 2017 18:59:24 +0000 (15:59 -0300)]
Bug 18474: Restore multiple holds when patron is searched for

We lost the ability to place multiple holds when we are searching for
patrons. The multi_holds parameter is lost and not handled correctly in
the template.

Test plan:
- Make sure you can place multiple holds for a patron you will search for
- Same for simple hold

TODO the multiple holds view should not be displayed if only 1 record
has been selected from the search result.

Signed-off-by: claude brayer <claude.brayer@cea.fr>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 20385: (follow-up) Assign blank instead of inappropraite value
Nick Clemens [Fri, 23 Mar 2018 17:12:13 +0000 (17:12 +0000)]
Bug 20385: (follow-up) Assign blank instead of inappropraite value

Signed-off-by: Alex Arnaud <alex.arnaud@biblibre.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 20385: Don't try to get info for bad authtypecodes
Nick Clemens [Tue, 13 Mar 2018 14:57:47 +0000 (14:57 +0000)]
Bug 20385: Don't try to get info for bad authtypecodes

TO test:
0 - Have a koha with ES enabled and some auth records
1 - backup your db
2 - sudo koha-mysql <<instance>>
3 - UPDATE auth_types SET authtypecode="PERSO_NAMB" WHERE
authtypecode="PERSO_NAME" (or adjust as necessary)
4 - Search for some authorities where a PERSO_NAME record will be
returned
5 - KA_BOOM!
6 - Apply patch
7 - Results are returned, they do not display a code, viewing record you
won't see code

Signed-off-by: Nicolas Legrand <nicolas.legrand@bulac.fr>
Signed-off-by: Alex Arnaud <alex.arnaud@biblibre.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 20503: Prevent Borrower_PrevCheckout.t to fail randomly
Jonathan Druart [Fri, 30 Mar 2018 16:14:46 +0000 (13:14 -0300)]
Bug 20503: Prevent Borrower_PrevCheckout.t to fail randomly

category_type must be != "X"

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 20498: (bug 19641 follow-up) Patron advanced search form missing from patron...
Owen Leonard [Thu, 29 Mar 2018 17:57:01 +0000 (17:57 +0000)]
Bug 20498: (bug 19641 follow-up) Patron advanced search form missing from patron entry page

My patch moving patron-related templates' javascript to the footer left
out a script from the patron entry template which is required if the
patron header search menu is going to work.

To test, apply the patch and go to Patrons -> New patron.

Clicking the [+] link in the "Search patrons" header search form should
expand the advanced search options.

Test that the page's toolbar still "floats" correctly when you scroll
the page.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 16330: Remove unecessary Koha::Patron->store method
Jonathan Druart [Thu, 29 Mar 2018 15:45:39 +0000 (12:45 -0300)]
Bug 16330: Remove unecessary Koha::Patron->store method

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 20490: Correct bug number typo in comment in Circulation.t
Lari Taskula [Wed, 28 Mar 2018 21:19:52 +0000 (21:19 +0000)]
Bug 20490: Correct bug number typo in comment in Circulation.t

NOTE: Confirmed that the typo of 17641 was part of bug 17941.

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 19784: Adapt /v1/patrons to new naming guidelines
Tomas Cohen Arazi [Fri, 8 Dec 2017 12:35:45 +0000 (09:35 -0300)]
Bug 19784: Adapt /v1/patrons to new naming guidelines

This patch introduces two functions to the patrons endpoint:
- _to_api
- _to_model

This are in charge of field mappings in order to comply with the
guidelines.

Koha::REST::V1:Auth is adjusted to handle 'patron_id' as well. 'borrowernumber'
handling is kept until the existing endpoints get updated.

To test:
- Apply the patches
- Run:
  $ kshell
 k$ prove t/db_dependent/api/v1/*.t
=> SUCCESS: Tests pass!
- Sign off :-D

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 19784: Remove reference to 'borrowernumber' param from other endpoints
Tomas Cohen Arazi [Fri, 8 Dec 2017 12:25:35 +0000 (09:25 -0300)]
Bug 19784: Remove reference to 'borrowernumber' param from other endpoints

This patch removes the $ref occurences for borrowernumber in not
patron-specific endpoints. 'borrowernumber' is still used on them, but as a
hardcoded parameter. The param rename will happen on a separate bug for
each endpoint.

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 19784: Unit tests for /api/v1/patrons
Tomas Cohen Arazi [Fri, 8 Dec 2017 12:17:28 +0000 (09:17 -0300)]
Bug 19784: Unit tests for /api/v1/patrons

This patch adapts the existing endpoint's tests so they expect:
- 'patron_id' for 'borrowernumber'
- 'library_id' for 'branchcode'
- 'category_id' for 'categorycode'

In the process, I tried to make the tests more robust, by creating random
data that gets deleted to make sure our tests cases can't have false
positives.

Independent subtests are wrapped inside transactions to avoid
eventual interference.

To test:
- Apply the patch
- Run:
  $ kshell
 k$ prove t/db_dependent/api/v1/patrons.t
=> FAIL: The api doesn't implement the expected behaviour and attributes
for endpoint responses

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 16330: (QA follow-up) Update usage of search plugin because of bug 19686
Josef Moravec [Mon, 19 Feb 2018 07:15:22 +0000 (07:15 +0000)]
Bug 16330: (QA follow-up) Update usage of search plugin because of bug 19686

Test plan:
prove t/db_dependent/api/v1/patrons.t
--> without  patch the list subtest fail
--> with patch test pass

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 16330: Remove validation code from Koha::Patron
Tomas Cohen Arazi [Tue, 19 Dec 2017 17:46:45 +0000 (14:46 -0300)]
Bug 16330: Remove validation code from Koha::Patron

This patch removes previously added validation code from Koha::Patron
as we will rely on the DB structure and relationships to catch the same
problems. This is implemented on bug 19828.

This patch also adapts the API controller class to expect this behaviour
change from Koha::Patron. The expected exceptions are adjusted, and some
minor changes take place. The API tests are adjusted as well.

To test:
- Run:
  $ kshell
 k$ prove t/db_dependent/Koha/Patrons.t
 k$ prove t/db_dependent/api/v1/patrons.t
=> SUCCESS: Tests should still pass

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 16330: (QA follow-up) ModMember requires borrowernumber
Tomas Cohen Arazi [Tue, 12 Dec 2017 21:53:45 +0000 (18:53 -0300)]
Bug 16330: (QA follow-up) ModMember requires borrowernumber

Works perfectly. Well done everyone!

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Benjamin Rokseth <benjamin.rokseth@kul.oslo.kommune.no>
Signed-off-by: Dilan Johnpullé <dilan@calyx.net.au>
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 16330: (QA follow-up) Repect guidelines on plurals Patron > Patrons
Tomas Cohen Arazi [Tue, 5 Dec 2017 19:43:00 +0000 (16:43 -0300)]
Bug 16330: (QA follow-up) Repect guidelines on plurals Patron > Patrons

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Benjamin Rokseth <benjamin.rokseth@kul.oslo.kommune.no>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 16330: Move patches to OpenAPI
Tomas Cohen Arazi [Mon, 4 Dec 2017 19:18:47 +0000 (16:18 -0300)]
Bug 16330: Move patches to OpenAPI

This patch refactors the original work so it implements the controllers
and the spec using Mojolicious::Plugin::OpenAPI, and OpenAPI for the specification.

It removes the ability for patrons without permissions to edit their own data or their
guarantee's. This will be moved to a patron modification requests endpoint for simplicity.

It makes use of bugs 19410 and 19686 and their dependencies to deal with parameters handling,
query building and pagination.

Tests are adapted.

To test:
- Apply this patches and the dependencies
- Run:
  $ kshell
 k$ prove t/db_dependent/api/v1/patrons.t
=> SUCCESS: Tests pass!
- Sign off :-D

Sponsored-by: ByWater Solutions
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Benjamin Rokseth <benjamin.rokseth@kul.oslo.kommune.no>
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 16330: Add routes to add, update and delete patrons
Benjamin Rokseth [Wed, 27 Apr 2016 13:47:04 +0000 (13:47 +0000)]
Bug 16330: Add routes to add, update and delete patrons

This patch adds support for add, edit and delete patrons via REST API.

GET  /api/v1/patrons                   Get patron list from params
GET  /api/v1/patrons/<borrowernumber>  Get single patron
POST /api/v1/patrons                   Create a new patron
PUT  /api/v1/patrons/<borrowernumber>  Update data about patron
DEL  /api/v1/patrons/<borrowernumber>  Delete a patron

Revised Test plan:
1) Apply this patch
2) Run tests perl t/db_dependent/api/v1/patrons.t
3) Add a user with proper rights to use the REST API
4) play with your favourite REST client (curl/httpie, etc.):
   Authenticate with the user created above and get a CGISESSION id.
   Use the CGISESSION to add, edit and delete patrons via the API.
5) Use PUT /patrons/<borrowernumber> for a patron without borrowers
   flag. This should go into pending patron modification status and
   needs to be accepted by a librarian.

Please note there is no validation of body input in PUT/POST other
than branchcode,category,userid,cardnumber.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Benjamin Rokseth <benjamin.rokseth@kul.oslo.kommune.no>
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 19488: (QA follow-up) Fix spelling, remove ()
Katrin Fischer [Sun, 25 Mar 2018 20:10:22 +0000 (22:10 +0200)]
Bug 19488: (QA follow-up) Fix spelling, remove ()

Fixes spelling to match the details page and removes ().

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 19488: Add borrowernumber to brief info on patron details pages in staff client
Jesse Maseto [Fri, 2 Mar 2018 14:48:06 +0000 (14:48 +0000)]
Bug 19488: Add borrowernumber to brief info on patron details pages in staff client

To test:
- View different tabs of a borrower's patron account in staff
- Verify the borrowernumber is shown in the brief info section
  on the left

Signed-off-by: JM Broust <jean-manuel.broust@univ-lyon2.fr>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 19564: (QA follow-up) Make commented out tests pass
Nick Clemens [Wed, 28 Mar 2018 12:42:19 +0000 (12:42 +0000)]
Bug 19564: (QA follow-up) Make commented out tests pass

We likely shoudln't pass through an uncoverted sort order for now, but
it does allow us to look ahead to implementing the orders directly so
seems a good option to have.

Either this patch should be used, or the commented out tests should be
removed

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 19564: Add tests for _convert_sort_fields
Jonathan Druart [Fri, 22 Dec 2017 18:21:51 +0000 (15:21 -0300)]
Bug 19564: Add tests for _convert_sort_fields

Signed-off-by: Nicolas Legrand <nicolas.legrand@bulac.fr>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 19564: Fix extraction of sort order from sort condition name
David Gustafsson [Thu, 2 Nov 2017 14:02:23 +0000 (15:02 +0100)]
Bug 19564: Fix extraction of sort order from sort condition name

Currently sort order is extracted from sort condition by splitting the
field, instead use regular expression to extract the last part preceded
by underscore.

Signed-off-by: Nicolas Legrand <nicolas.legrand@bulac.fr>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 19673: Allow to set patron attributes to 0 with batch patron modification
Jonathan Druart [Thu, 21 Dec 2017 00:35:47 +0000 (21:35 -0300)]
Bug 19673: Allow to set patron attributes to 0 with batch patron modification

This patch will have to be tested deeply to make sure it will not
introduce regression!

The idea is to display an empty option in the patron attributes select
and ignore it. That way we can deal with false values 0 and "" which
were skipped before.

Test plan:
Add several patron attributes
Use the batch patron modification tool to add/update/remove them
Play with empty "" and 0 values, as well as other values
Modify several attributes in a row

Signed-off-by: Charles Farmer <charles.farmer@inLibro.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 19916: Add keyword and standard ID fields to acq external search
Nick Clemens [Thu, 4 Jan 2018 15:31:52 +0000 (15:31 +0000)]
Bug 19916: Add keyword and standard ID fields to acq external search

To test:
1 - Add an order from external source
2 - Note you don't have keyword or standard ID fields
3 - Add a catalog record from Z3950, note those fields are there
4 - Apply patch
5 - Check acq and note you do have those fields
6 - Do some searches to verify they work as expected

Signed-off-by: Maksim Sen <maksim.sen@inlibro.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 20330: Allow translating more of quote upload
Pasi Kallinen [Mon, 5 Mar 2018 07:09:28 +0000 (09:09 +0200)]
Bug 20330: Allow translating more of quote upload

Translate the error messages, and the table headers.

Test plan:

1) Go to Home -> Tools -> Quote editor -> Import quotes
2) Upload quotes from a file. Try to trigger the error messages
3) On successful import, check the table header texts
4) Apply patch, update & install a language
5) The error messages and the table header texts should
   show up in the xx-YY-staff-prog.po
6) Repeat 1,2,3

Signed-off-by: Pasi Kallinen <pasi.kallinen@joensuu.fi>
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 18055: The 2 new deps are used for testing purpose
Jonathan Druart [Wed, 28 Mar 2018 18:54:56 +0000 (15:54 -0300)]
Bug 18055: The 2 new deps are used for testing purpose

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 18055: (QA followup) Only print output if DEBUG
Tomas Cohen Arazi [Fri, 1 Sep 2017 15:25:27 +0000 (12:25 -0300)]
Bug 18055: (QA followup) Only print output if DEBUG

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 18055: Speed up '00-strict.t' test, with Parallel::ForkManager
Mason James [Thu, 15 Jun 2017 13:20:05 +0000 (01:20 +1200)]
Bug 18055: Speed up '00-strict.t' test, with Parallel::ForkManager

add KOHA_PROVE_CPUS envar to manually set number of cpus

to test..

1/ set number of cpus to 1
 $ export KOHA_PROVE_CPUS=1

2/ observe 1 cpus are used
 $ time prove -v  t/db_dependent/00-strict.t
 t/db_dependent/00-strict.t ..
 Using 1 CPUs...

3/ unset number of cpus
 $ export KOHA_PROVE_CPUS=

4/ observe all available cpus are used
 $ time prove -v  t/db_dependent/00-strict.t
 t/db_dependent/00-strict.t ..
 Using 32 CPUs...

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 18055: Speed up '00-strict.t' test, with Parallel::ForkManager
Mason James [Sun, 5 Feb 2017 01:40:06 +0000 (14:40 +1300)]
Bug 18055: Speed up '00-strict.t' test, with Parallel::ForkManager

to test...

1/ run 00-strict.t test, (16.5 mins on a 4xcpu system)

$ time prove t/db_dependent/00-strict.t
...
Files=1, Tests=654, 994 wallclock secs ( 0.19 usr  0.04 sys + 873.40 cusr 116.20 csys = 989.83 CPU)
Result: PASS
real    16m34.104s

2/ apply patch

3/ install Parallel::ForkManager package
$ sudo apt-get install libparallel-forkmanager-perl libsys-cpu-perl

4/ run 00-strict.t test again, (now 6 mins.. much faster)

$ time prove t/db_dependent/00-strict.t
...
Files=1, Tests=654, 364 wallclock secs ( 0.07 usr  0.01 sys + 1159.20 cusr 153.41 csys = 1312.69 CPU)
Result: PASS
real    6m4.355s

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Edit: removed debian/control changes as the file is generated

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 20455: Fix sort patrons by date expired
Jonathan Druart [Mon, 26 Mar 2018 16:13:58 +0000 (13:13 -0300)]
Bug 20455: Fix sort patrons by date expired

We may need to apply this change for all other occurrences in our
codebase.

Test plan:
- Make sure sample patron data is loaded and you have a patron without a
date expired defined
- Make an empty search for all patrons or another search that gives you
a good amount of results
- Try to sort on the date expired column

=> Without this patch you get
Odd number of elements in anonymous hash
at /home/vagrant/kohaclone/C4/Utils/DataTables/Members.pm line 189.
output_pref is called with 'dateonly' (ref SCALAR), not a DateTime
object

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 19233: Restore styling of the button
Jonathan Druart [Tue, 27 Mar 2018 20:53:13 +0000 (17:53 -0300)]
Bug 19233: Restore styling of the button

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 19583: Remove use of C4::AuthoritiesMarc
Alex Arnaud [Tue, 13 Mar 2018 15:09:22 +0000 (15:09 +0000)]
Bug 19583: Remove use of C4::AuthoritiesMarc

Signed-off-by: Alex Arnaud <alex.arnaud@biblibre.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 19582: (follow-up) get params in correct order
Nick Clemens [Mon, 12 Mar 2018 15:56:45 +0000 (15:56 +0000)]
Bug 19582: (follow-up) get params in correct order

We were ordering the values out of sync with the order of the mathclist
param and so causing 'entire record' and 'all headings' to be reversed

Signed-off-by: Nicolas Legrand <nicolas.legrand@bulac.fr>
Signed-off-by: Alex Arnaud <alex.arnaud@biblibre.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 19582: Unit tests
Nick Clemens [Tue, 7 Nov 2017 01:24:56 +0000 (01:24 +0000)]
Bug 19582: Unit tests

Signed-off-by: David Bourgault <david.bourgault@inlibro.com>
Signed-off-by: Nicolas Legrand <nicolas.legrand@bulac.fr>
Signed-off-by: Alex Arnaud <alex.arnaud@biblibre.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 19582: Use compat routines for searching authorities in auth_finder.pl
Nick Clemens [Mon, 6 Nov 2017 17:14:34 +0000 (17:14 +0000)]
Bug 19582: Use compat routines for searching authorities in auth_finder.pl

To test:
1 - Enable Zebra
2 - Perform an auth search
3 - note results
4 - Enable ES
5 - Repeat search, note (likely) diff results
6 - Open a record in cataloging and use the button to launch auth search
7 - Perform same search as above, note results match for eiher engine
selected
8 - NOTE: Disbale sorting for ES search - this will be dealt with in
another report

Signed-off-by: David Bourgault <david.bourgault@inlibro.com>
Signed-off-by: Nicolas Legrand <nicolas.legrand@bulac.fr>
Signed-off-by: Alex Arnaud <alex.arnaud@biblibre.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 20386: Improve warning and error messages for Search Engine Configuration
Claire Gravely [Tue, 13 Mar 2018 11:18:33 +0000 (11:18 +0000)]
Bug 20386: Improve warning and error messages for Search Engine Configuration

This patch updates a warning message and error message in the Search
engine configuration for Elasticsearch.

Note: elasticsearch does not need to be active in order to test.

To test warning message:
 1. go to: cgi-bin/koha/admin/searchengine/elasticsearch/mappings.pl
 2. note the warning message
 3. Apply patch
 4. Note the change in warning message. Confirm it makes sense.

To test error message:
  Apply patch and check the changed message in the template file mappings.tt and confirm it makes sense.

Signed-off-by: Nicolas Legrand <nicolas.legrand@bulac.fr>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 19739: Add default ES configuration to koha-conf.xml
Fridolin Somers [Mon, 4 Dec 2017 09:04:48 +0000 (10:04 +0100)]
Bug 19739: Add default ES configuration to koha-conf.xml

Bug 18571 added default ES configuration for packaging config.

This patch adds it to dev install in koha-conf.xml.
Database name is used in index_name to allow multiple installs.

Test plan :
- Run dev install
- Install ElasticSearch server and Koha deps
- Enable ElasticSearch in Koha
- Check indexing and searching works directly

Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 19233: (follow-up) Use a button to submit form
Nick Clemens [Tue, 27 Mar 2018 17:30:42 +0000 (17:30 +0000)]
Bug 19233: (follow-up) Use a button to submit form

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 19233: (follow-up) Send itemnumbers in report results to batch modification
Owen Leonard [Mon, 18 Sep 2017 15:23:38 +0000 (15:23 +0000)]
Bug 19233: (follow-up) Send itemnumbers in report results to batch modification

This patch changes the obscure "^" symbol to a styled link with the text
"Batch modify." I think the only disadvantage of this is that it takes
up more space, but it is outweighed by the improved clarity.

This patch also makes minor indentation corrections to new lines of
HTML.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 19233: Add ability to send itemnumbers in report results to batch modification
Nick Clemens [Fri, 1 Sep 2017 00:54:44 +0000 (00:54 +0000)]
Bug 19233: Add ability to send itemnumbers in report results to batch modification

To test:
1 - Apply patch
2 - Run a report with an itemnumber column
3 - Note there is a linked '^' after column title
4 - Hover over the '^'
5 - You should see a tooltip 'Send visible items to batch modification'
6 - Click the '^'
7 - You should be sent to batch item modification with itemnumbers that
were visible in report

Signed-off-by: George <george@nekls.org>
Signed-off-by: BWS Sandboxes <ByWaterSandboxes@gmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 20479: Ease readability - do not enter the block if not logged in
Jonathan Druart [Tue, 27 Mar 2018 16:37:35 +0000 (13:37 -0300)]
Bug 20479: Ease readability - do not enter the block if not logged in

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 20479: Use $flag instead of fetching patron
Jonathan Druart [Tue, 27 Mar 2018 15:47:54 +0000 (12:47 -0300)]
Bug 20479: Use $flag instead of fetching patron

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 20479: (follow-up) Don't try to get flags for database user
Nick Clemens [Tue, 27 Mar 2018 15:05:57 +0000 (15:05 +0000)]
Bug 20479: (follow-up) Don't try to get flags for database user

Login will still break in opac-user.pl, but that seems a bigger problem
not from SCI module

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 20479: Don't kick superlibrarians out of the opac
Nick Clemens [Tue, 27 Mar 2018 12:47:57 +0000 (12:47 +0000)]
Bug 20479: Don't kick superlibrarians out of the opac

To test:
1 - Try to log in to opac with a superlibrarian
2 - Everythign goes wrong
3 - Apply patch
4 - Try to log in with superlibrarian
5 - You can sign in

Signed-off-by: Claire Gravely <claire.gravely@bsz-bw.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 20480: send KOHA_VERSION even if only one language is enabled
Jonathan Druart [Tue, 27 Mar 2018 16:27:27 +0000 (13:27 -0300)]
Bug 20480: send KOHA_VERSION even if only one language is enabled

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 20480: Make KOHA_VERSION available to all templates in all circumstances
Tomas Cohen Arazi [Tue, 27 Mar 2018 14:54:51 +0000 (11:54 -0300)]
Bug 20480: Make KOHA_VERSION available to all templates in all circumstances

This patch makes C4::Templates::gettemplate set the KOHA_VERSION param
for the template. This way this template parameter, which is required by
(probably) all pages that include CSS/JS content is available in all
circumstances.

A noticeable problem with the current approach is when using the SCO and
SCI modules with wrong/forbidden users: C4::Auth short-circuits and
redirects to the login page, without setting the KOHA_VERSION param.
This patch solves it for good.

To test:
- Enable the SCI module
- Open the browser at
  http://localhost:8080/cgi-bin/koha/sci/sci-main.pl
- Login with the db user (koha_kohadev / password)
=> FAIL: Login failure, but styling is broken
- Apply this patch
- Retry
=> SUCCESS: Everything looks as it should!
- 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 20474: Mimick Letters.t
Jonathan Druart [Tue, 27 Mar 2018 15:21:41 +0000 (12:21 -0300)]
Bug 20474: Mimick Letters.t

Please improve if needed the 2 occurrences on a separate bug reports.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 20474: Mock sendmail instead of actually emailing
Mark Tompsett [Mon, 26 Mar 2018 15:39:28 +0000 (15:39 +0000)]
Bug 20474: Mock sendmail instead of actually emailing

Copy mocking sendmail code from t/db_dependent/Letters.t
into the Passwordrecovery.t test file.

prove t/db_dependent/Passwordrecovery.t

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 20474: Explicitly call sendmail to make mocking work
Mark Tompsett [Mon, 26 Mar 2018 16:46:19 +0000 (16:46 +0000)]
Bug 20474: Explicitly call sendmail to make mocking work

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 20045: Fix Selenium tests
Jonathan Druart [Tue, 27 Mar 2018 15:03:51 +0000 (12:03 -0300)]
Bug 20045: Fix Selenium tests

Element id=doc does not longer exist on the admin home page
The "main block" need to be localized using the new class 'main
container-fluid'
We will certainly need to improve this later.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 20267: .gitignore do not need to be mapped in Makefile
Jonathan Druart [Mon, 26 Mar 2018 22:35:07 +0000 (19:35 -0300)]
Bug 20267: .gitignore do not need to be mapped in Makefile

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 17468: Remove koha-*-zebra scripts and its traces
Tomas Cohen Arazi [Sat, 17 Feb 2018 15:20:09 +0000 (12:20 -0300)]
Bug 17468: Remove koha-*-zebra scripts and its traces

This patch removes traces from the (deprecated) koha-*-zebra scripts.

To test:
- Apply the patch
- Verify no traces of koha-*-zebra remain on the codebase (besides
  Release Notes and the koha-zebra script):
  $ cd kohaclone
  $ git grep koha-start-zebra
  $ git grep koha-stop-zebra
  $ git grep koha-restart-zebra
=> SUCCESS: No traces!
- Create the following symlinks:
  $ sudo ln -s /usr/sbin/koha-zebra  /usr/sbin/koha-start-zebra
  $ sudo ln -s /usr/sbin/koha-zebra  /usr/sbin/koha-stop-zebra
  $ sudo ln -s /usr/sbin/koha-zebra  /usr/sbin/koha-restart-zebra
- Try the koha-*-zebra commands:
  $ sudo koha-stop-zebra kohadev
  $ sudo koha-start-zebra kohadev
  $ sudo koha-restart-zebra kohadev
=> SUCCESS: They all work as expected!

- Sign off :-D!

Sponsored-by: Orex Digital
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 20345: Put saved report keyword search form on reports home
Owen Leonard [Tue, 6 Mar 2018 18:48:08 +0000 (18:48 +0000)]
Bug 20345: Put saved report keyword search form on reports home

This patch makes cosmetic changes to the reports home page in the staff
client following the pattern set on the Administration home page with
the system preferences search box. A reports keyword search form is
added, and reports actions have font-awesome icons.

To test, apply the patch and view the reports home page. Confirm that
all affected links work correctly and that the search form works
correctly.

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 20045: Switch single-column templates to Bootstrap grid: Various
Owen Leonard [Fri, 19 Jan 2018 16:02:46 +0000 (16:02 +0000)]
Bug 20045: Switch single-column templates to Bootstrap grid: Various

This patch updates various unrelated templates to use the Bootstrap
grid.

- about.tt - The about page
- auth.tt - The login page

  These pages should look correct.

- reports/reports-home.tt - The reports home page
- admin/admin-home.tt - The administration home page

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

- serials/subscription-add.tt - Serials -> Add subscription. The entry
  form should look correct during each step of the add/edit process.

- suggestion/suggestion.tt - Acquisitions -> Suggestions -> New
  suggestion. The page with the new suggestion form should look correct.

Signed-off-by: Roch D'Amour <roch.damour@inlibro.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 19983: Switch single-column templates to Bootstrap grid: Authorities
Owen Leonard [Tue, 16 Jan 2018 16:55:36 +0000 (16:55 +0000)]
Bug 19983: Switch single-column templates to Bootstrap grid: Authorities

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

- authorities-home - The home page of the Authorities module.
- authorities.tt - The authority add/edit page.
- blinddetail-biblio-search.tt - Not really testable -- It's the small
  popup window which appears during the process of linking an authority
  to a MARC record.
- detail.tt - The authority detail page. Search for an authority record
  and click on the "details" link in the search results.
- merge.tt - From a list of authority search results, select "Merge"
  from the Actions menu of two authority records. Test both the initial
  selection screen and the source/destination merging view.
- searchresultlist.tt - The authority search results page.

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 19961: Move template JavaScript to the footer: Patron card creator
Owen Leonard [Wed, 21 Feb 2018 19:40:06 +0000 (19:40 +0000)]
Bug 19961: Move template JavaScript to the footer: Patron card creator

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

Also changed: Removed "type" attribute from script tags.

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

- Creating and managing layouts
- Creating and managing card batches
- Creating and managing card templates
- Creating and managing printer profiles
- Creating and managing images

Signed-off-by: Jesse Maseto <jesse@bywatersolutions.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 19946: (follow-up) Add fixed footer to authorities Z39.50 popup
Owen Leonard [Fri, 9 Feb 2018 13:16:40 +0000 (13:16 +0000)]
Bug 19946: (follow-up) Add fixed footer to authorities 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.

This patch also adds some whitespace to the "Author
(meeting/conference)" label to enable better word wrapping.

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

Patch applies, form resizes, displays and functions as expected.
Signed-off-by: Dilan Johnpullé <dilan@calyx.net.au>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 19946: Update popup window templates to use Bootstrap grid: Authority Z39.50...
Owen Leonard [Wed, 10 Jan 2018 16:10:44 +0000 (16:10 +0000)]
Bug 19946: Update popup window templates to use Bootstrap grid: Authority Z39.50 search

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

Also fixed: Some capitalization corrections, better <title>
handling. This patch does not fix Bug 17119.

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

Signed-off-by: Te Rauhina Jackson <terauhina.jackson@gmail.com>
Signed-off-by: Te Rauhina Jackson <terauhina.jackson@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 19949: Update popup window templates to use Bootstrap grid: Cataloging authority...
Owen Leonard [Wed, 10 Jan 2018 17:42:59 +0000 (17:42 +0000)]
Bug 19949: Update popup window templates to use Bootstrap grid: Cataloging authority search

This patch updates the cataloging authority search templates to use the
Bootstrap grid instead of the YUI grid.

To test you must have a MARC subfield configured with "Thesaurus"
linked to an authority type.

Apply the patch and go to Cataloging -> New record. Click the plugin
link for the field which is linked to authorities. In the popup window,
the search form and search results 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 19878: Move template JavaScript to the footer: UNIMARC editor plugins, part 7
Owen Leonard [Tue, 2 Jan 2018 16:29:44 +0000 (16:29 +0000)]
Bug 19878: Move template JavaScript to the footer: UNIMARC editor plugins, part 7

This patch updates the last of the UNIMARC plugin templates so that
JavaScript is included in the footer following the same pattern as
other templates which have been modified to fix Bug 17858.

To test you do not need a UNIMARC system.

Apply the patch and for each plugin, configure a MARC subfield (e.g.
100$a) to use that plugin.

From the MARC edit page, trigger the plugin and confirm that changes
made in the popup window are saved to the corresponding field in the
editor.

- unimarc_field_210c.tt
- unimarc_field_210c_bis.tt
- unimarc_field_225a.tt
- unimarc_field_225a_bis.tt
- unimarc_field_4XX.tt
- unimarc_field_700-4.tt
- unimarc_leader.tt

Signed-off-by: Anne-Claire Bernaudin <anne-claire.bernaudin@univ-rennes1.fr>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 19877: Move template JavaScript to the footer: UNIMARC editor plugins, part 6
Owen Leonard [Fri, 22 Dec 2017 16:32:57 +0000 (16:32 +0000)]
Bug 19877: Move template JavaScript to the footer: UNIMARC editor plugins, part 6

This patch updates more UNIMARC plugin templates than ever before, so
that JavaScript is included in the footer following the same pattern as
other templates which have been modified to fix Bug 17858.

To test you do not need a UNIMARC system.

Apply the patch and for each plugin, configure a MARC subfield (e.g.
100$a) to use that plugin.

From the MARC edit page, trigger the plugin and confirm that changes
made in the popup window are saved to the corresponding field in the
editor.

- unimarc_field_128a.tt
- unimarc_field_128b.tt
- unimarc_field_128c.tt
- unimarc_field_130.tt
- unimarc_field_135a.tt
- unimarc_field_140.tt
- unimarc_field_141.tt

Signed-off-by: delaye <stephane.delaye@biblibre.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 19874: Move template JavaScript to the footer: UNIMARC editor plugins, part 5
Owen Leonard [Fri, 22 Dec 2017 14:51:20 +0000 (14:51 +0000)]
Bug 19874: Move template JavaScript to the footer: UNIMARC editor plugins, part 5

This patch updates yet more UNIMARC plugin templates so that
JavaScript is included in the footer following the same pattern as other
templates which have been modified to fix Bug 17858.

To test you do not need a UNIMARC system.

Apply the patch and for each plugin, configure a MARC subfield (e.g.
100$a) to use that plugin.

From the MARC edit page, trigger the plugin and confirm that changes
made in the popup window are saved to the corresponding field in the
editor.

- unimarc_field_125a.tt
- unimarc_field_125b.tt
- unimarc_field_126a.tt
- unimarc_field_126b.tt
- unimarc_field_127.tt

Signed-off-by: delaye <stephane.delaye@biblibre.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 19872: Move template JavaScript to the footer: UNIMARC editor plugins, part 4
Owen Leonard [Fri, 22 Dec 2017 14:12:09 +0000 (14:12 +0000)]
Bug 19872: Move template JavaScript to the footer: UNIMARC editor plugins, part 4

This patch updates more and more UNIMARC plugin templates so that
JavaScript is included in the footer following the same pattern as other
templates which have been modified to fix Bug 17858.

To test you do not need a UNIMARC system.

Apply the patch and for each plugin, configure a MARC subfield (e.g.
100$a) to use that plugin.

From the MARC edit page, trigger the plugin and confirm that changes
made in the popup window are saved to the corresponding field in the
editor.

- unimarc_field_124a.tt
- unimarc_field_124b.tt
- unimarc_field_124c.tt
- unimarc_field_124d.tt
- unimarc_field_124e.tt
- unimarc_field_124f.tt
- unimarc_field_124g.tt

Signed-off-by: delaye <stephane.delaye@biblibre.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>