]> git.koha-community.org Git - koha.git/log
koha.git
6 years agoBug 17698: (follow-up) Rebase
Nick Clemens [Mon, 23 Jul 2018 13:50:33 +0000 (13:50 +0000)]
Bug 17698: (follow-up) Rebase

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
6 years agoBug 17698: (QA follow-up) Changes to use Asset TT plugin (bug 20538)
Katrin Fischer [Sun, 15 Apr 2018 11:51:55 +0000 (13:51 +0200)]
Bug 17698: (QA follow-up) Changes to use Asset TT plugin (bug 20538)

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
6 years agoBug 17698: (follow-up) Fixing some small issues
Aleisha Amohia [Thu, 12 Apr 2018 04:04:48 +0000 (04:04 +0000)]
Bug 17698: (follow-up) Fixing some small issues

Fixing the comments in Comment 42

Ready to test

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
6 years agoBug 17698: (follow-up) Koha Objects, access borrower through patron sub
Aleisha Amohia [Thu, 6 Jul 2017 01:28:06 +0000 (01:28 +0000)]
Bug 17698: (follow-up) Koha Objects, access borrower through patron sub

See Comment 27
This is ready to be tested.

Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
6 years agoBug 17698: (follow-up) Changing to Koha Objects style, adding circ sidebar
Aleisha Amohia [Mon, 26 Jun 2017 23:31:17 +0000 (23:31 +0000)]
Bug 17698: (follow-up) Changing to Koha Objects style, adding circ sidebar

Marcel, can you please have a look at this patch. I tried to implement
the change
my @notes = $schema->resultset('Issue')->search({ 'me.note' => { '!=', undef } }, { prefetch => [ 'borrower', { item => 'biblionumber' } ] });
to
my @notes = Koha::Checkouts->search({ 'me.note' => { '!=', undef } }, { prefetch => [ 'borrower', { item => 'biblionumber' } ] });
but am having problems on the template side. I can access the item and
biblio information about the issue, but not the borrower information,
even though the query is definitely pulling it correctly. Any
suggestions or ideas as to why this breaks?

This patch also adds the implementation of the circSidebar.

Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
6 years agoBug 17698: Make patron notes show up on staff dashboard
Aleisha Amohia [Thu, 1 Dec 2016 00:54:07 +0000 (00:54 +0000)]
Bug 17698: Make patron notes show up on staff dashboard

This patch adds a user permission for managing issue notes, and a 'noteseen'
column to the issues table.

To test:
1) Apply Bug 14224 first
2) Apply this patch, update database, rebuild schema.
3) Restart koha-common and memcached
4) Turn on AllowCheckoutNotes syspref if haven't already
5) Issue two items to two different users (one item each)
6) Log into the OPAC as one of the users and add an issue note to their
issue
7) Log out and log back into the OPAC as the other user
8) Disable Javascript
9) Refresh opac-user.pl
10) Leave a checkout note on their issue
11) Enable javascript and log into the Staff Client as a superlibrarian
user
12) Go to your user's account and edit their permissions to have
everything ticked EXCEPT circulate->manage checkout notes.
13) Go to main intranet page. There should be no message saying
'checkout notes pending'.
14) Go to circulation home page. There should be no link to Checkout notes.
15) Go back to user's permissions and tick circulate->manage checkout notes.
16) Go back to main intranet page. There should now be a message at the
bottom saying 'Checkout notes pending: 2'
17) Go to circulation home page. There should be a link to Checkout notes
with a 2 next to it. Click this link
18) Attempt to mark an checkout note as seen. This should update the status
of the checkout note to 'seen' and disable to 'mark as seen' button while
enabling the 'mark as not seen' button.
19) Test both buttons with both issues.
20) Test select all and clear all buttons
21) Confirm that buttons at the bottom are only enabled if a checkbox is
checked
22) Try selecting both issues and using the buttons at the bottom to
mark multiple issue notes at once.
23) Confirm the barcode link to the item works as expected.
24) Confirm the cardnumber link to the user works as expected.
25) Confirm all table details show correctly.

Sponsored-by: Catalyst IT
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Followed test plan, works as expected
Signed-off-by: Marc Véron <veron@veron.ch>
Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Amended patch: Remove self-checkout permissions

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
6 years agoBug 20757: Add pod for ->capture
Jonathan Druart [Mon, 23 Jul 2018 14:02:02 +0000 (11:02 -0300)]
Bug 20757: Add pod for ->capture

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
6 years agoBug 20757: Capture and upload screenshot on selenium errors
Jonathan Druart [Fri, 11 May 2018 19:58:07 +0000 (16:58 -0300)]
Bug 20757: Capture and upload screenshot on selenium errors

It is a real pain to debug selenium errors, especially when it is
not reproducible locally.

This patch capture a screenshot when an error occurred and upload it
using the excellent lut.im service provided by framasoft
(We could host our own later).

Test plan:
Modify a selenium script to make it fails (search for find_element)
You will see a stack trace followed by a link to framapic.org

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
6 years agoBug 19191: DBRev 18.06.00.010
Nick Clemens [Mon, 23 Jul 2018 13:28:13 +0000 (13:28 +0000)]
Bug 19191: DBRev 18.06.00.010

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
6 years agoBug 19191: (QA follow-up) Remove double fetches from database
Kyle M Hall [Fri, 4 May 2018 19:17:51 +0000 (15:17 -0400)]
Bug 19191: (QA follow-up) Remove double fetches from database

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
6 years agoBug 19191: Add syspref to control use of email receipts, defaulting to disabled
Kyle M Hall [Fri, 20 Apr 2018 12:42:15 +0000 (12:42 +0000)]
Bug 19191: Add syspref to control use of email receipts, defaulting to disabled

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
6 years agoBug 19191: Add non-english notices
Kyle M Hall [Wed, 18 Apr 2018 11:23:05 +0000 (07:23 -0400)]
Bug 19191: Add non-english notices

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
6 years agoBug 19191: Fix capitalization of notice titles
Kyle M Hall [Wed, 18 Apr 2018 11:14:09 +0000 (07:14 -0400)]
Bug 19191: Fix capitalization of notice titles

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
6 years agoBug 19191: Add correct unit tests
Kyle M Hall [Thu, 12 Apr 2018 14:12:29 +0000 (14:12 +0000)]
Bug 19191: Add correct unit tests

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
6 years agoBug 19191: Remove need for bug 19966
Kyle M Hall [Fri, 2 Mar 2018 15:04:10 +0000 (15:04 +0000)]
Bug 19191: Remove need for bug 19966

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
6 years agoBug 19191: Add ability to email receipts for account payments and write-offs
Kyle M Hall [Fri, 12 Jan 2018 15:46:24 +0000 (10:46 -0500)]
Bug 19191: Add ability to email receipts for account payments and write-offs

Some libraries are paperless and require all payment receipts to be emailed. Koha should give libraries the option to send email receipts if a patron has an email address. If a notice for the type of "credit" exists ( payment or writeoff ), then an email receipt will be sent.

These notices only support Template Toolkit syntax.

Test Plan:
1) Apply this patch and dependencies
2) Add the two new notices, you can find them in installer/data/mysql/en/mandatory/sample_notices.sql
3) Note two new notices exist in the notices editor, ACCOUNT_PAYMENT and ACCOUNT_WRITEOFF
4) Find or create a patron with an email address that owes some amount of money
5) Make a payment for one or more fees
6) Note a new email is queued for the patron
7) Make a writeoff for one or more fees
8) Note a new new email is queued for the patron

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
6 years agoBug 8604: Patron cards made for patrons which don't have patron images use preceding...
Chris Nighswonger [Wed, 4 Jul 2018 15:23:11 +0000 (11:23 -0400)]
Bug 8604: Patron cards made for patrons which don't have patron images use preceding card's image

This patch corrects referential problems which caused the script to
"re-use" images as well as other sorts of bad image behaviour.

To test:

1. Ensure that you can reproduce the original bug or some variation thereof
using the steps described in either of these two comments:

    https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=8604#c0

    https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=8604#c6

    NOTE: This is not an easy bug to reproduce.

2. Once you can reproduce the bug, apply this patch and follow the same steps
used to reproduce the bug.

3. Observe that the symptoms are corrected.

Signed-off-by: Chris Nighswonger <cnighswonger@foundations.edu>
Signed-off-by: Christian Stelzenmüller <christian.stelzenmueller@bsz-bw.de>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Reproduced the bug and resolved it with this patch.
Code is hard to read; exact cause of the problem was not fully uncovered.

Fixed spelling 'Destory' => 'Destroy'

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
6 years agoBug 21095: Add ccode facets info to tests
Nick Clemens [Fri, 20 Jul 2018 02:06:24 +0000 (02:06 +0000)]
Bug 21095: Add ccode facets info to tests

To test:
1 - prove -v t/db_dependent/Search.t
2 - Koha asks "Why am I getting these crazy facets!?!"
3 - Apply patch
4 - prove -v t/db_dependent/Search.t
5 - Koha purrs (tests pass)

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
6 years agoBug 21097: Missing optgroup closing tag in orderreceive.tt
David Cook [Fri, 20 Jul 2018 08:13:49 +0000 (18:13 +1000)]
Bug 21097: Missing optgroup closing tag in orderreceive.tt

There is a missing optgroup closing tag in orderreceive.tt. It doesn't
actually cause any display issues (at least in modern browsers), but
it's invalid markup, so this patch fixes it.

_TEST PLAN_
0. Add a budget and add a fund
1. Add a vendor
2. Add a basket
3. Add an order to a basket
4. Close the basket
5. Receive the order
6. Make sure the budget and fund both display when selecting the fund

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
6 years agoBug 20811: (RM follow-up) fix check for matching
Nick Clemens [Mon, 23 Jul 2018 12:23:07 +0000 (12:23 +0000)]
Bug 20811: (RM follow-up) fix check for matching

Notice should only be triggered if both settings are false

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
6 years agoBug 20811: (QA follow-up) Prevent calling AddItemBatchFromMarc and ModBiblioMarc...
Marcel de Rooy [Fri, 20 Jul 2018 09:46:58 +0000 (11:46 +0200)]
Bug 20811: (QA follow-up) Prevent calling AddItemBatchFromMarc and ModBiblioMarc without biblionumber

If you use -update but do not find matches (or did not want to match), you
should not call those routines. We should warn and skip this record.

Adding a warn at the start that the choice of options may not be smart.
Note that this needs further attention somewhere else. You could mix
-update with -insert for instance and still see some problems. (May depend
on items with unique barcode etc.)

Test plan:
Run -update without match or isbn.
Or run -update -isbn with a non-matching ISBN.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
6 years agoBug 20811: (QA follow-up) Make the isbn check work
Marcel de Rooy [Fri, 20 Jul 2018 09:21:11 +0000 (11:21 +0200)]
Bug 20811: (QA follow-up) Make the isbn check work

The following code was never reached, since $isbn was not filled.
    if (!$biblionumber && $isbn_check && $isbn) {
        $sth_isbn->execute($isbn);
        ($biblionumber,$biblioitemnumber) = $sth_isbn->fetchrow;
    }
Solution: Fix the code with two $isbn declarations. Move the checkisbn
condition a level deeper.

Test plan:
Run misc/migration_tools/bulkmarcimport.pl -file bib726.utf8 --update -isbn
Since you do not match on biblionumber, the ISBN should match.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
6 years agoBug 20811: Fix wrong usage of ModBiblio
Jonathan Druart [Mon, 28 May 2018 18:19:09 +0000 (15:19 -0300)]
Bug 20811: Fix wrong usage of ModBiblio

Since
  commit cefa7c21e28b88351ee8ae0dfefb80a515323df9
  Bug 5635: bulkmarcimport new parameters & features

AddBiblio call has been replaced with ModBiblio, but the return values
are different. We should not replace the value of $biblionumber with
what returns this subroutine.

Test plan:
If you are familiar with bulkmarcimport.pl you should know what to test,
I am not.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
6 years agoBug 19166: DBRev 18.06.00.009
Nick Clemens [Thu, 19 Jul 2018 17:33:55 +0000 (17:33 +0000)]
Bug 19166: DBRev 18.06.00.009

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
6 years agoBug 19166: (follow-up) Adjust table and files and QA issues
Nick Clemens [Mon, 16 Jul 2018 14:08:17 +0000 (14:08 +0000)]
Bug 19166: (follow-up) Adjust table and files and QA issues

Move to aqinvoice_adjustment
Move to Koha::Acquisition::Invoice::Adjustments
Test if variable exists before count

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
6 years agoBug 19166: (follow-up) Reformat the new adjustments markup
Nick Clemens [Mon, 16 Jul 2018 13:06:27 +0000 (13:06 +0000)]
Bug 19166: (follow-up) Reformat the new adjustments markup

This follow-up makes some changes to the way invoice adjustments are
displayed and added:

 - Move this section into a <fieldset> to set it off visually from the
   other sections of the page.
 - Take the "add adjustment" fields out of the table and display them in
   a standard way.
 - Hide the "add adjustment" fields by default, shown via "add an
   adjustment" link.
 - Add deletion confirmation to adjustment deletions.

To test, add, delete, and change invoice adjustments as instructed in
the original test plan.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
6 years agoBug 19166: Correct charset collate
Jonathan Druart [Wed, 25 Apr 2018 12:55:48 +0000 (09:55 -0300)]
Bug 19166: Correct charset collate

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
6 years agoBug 19166: (follow-up) Add ADJ_REASON auhtorised value category and minor fixes
Nick Clemens [Fri, 30 Mar 2018 13:35:12 +0000 (13:35 +0000)]
Bug 19166: (follow-up) Add ADJ_REASON auhtorised value category and minor fixes

This patch adds the ADJ_REASON authorised value category tot he atomic
update, and fixes code to display a hint of no reasons are defined

other minor updates to remove warns in logs

To test:
Apply patches
Run updates
Check authorised value categories to see ADJ_REASON exists
Add an adjustment, not you have no reaosn drop down
Note there is a hint if you hover
Add a value to ADJ_REASON
add another adjustment, note you can now add reasons (or not)

Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>
Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
6 years agoBug 19166: (follow-up) Shipment cost is always added to 'spent'
Nick Clemens [Thu, 15 Mar 2018 16:21:42 +0000 (16:21 +0000)]
Bug 19166: (follow-up) Shipment cost is always added to 'spent'

Two koha professionals agreed, also it is current behvaiour so this
patch removes a change

Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
6 years agoBug 19166: Get correct value for encumbering when open for new lines
Nick Clemens [Tue, 13 Mar 2018 09:17:24 +0000 (09:17 +0000)]
Bug 19166: Get correct value for encumbering when open for new lines

https://bugs.koha-community.org/show_bug.cgi?id=19166

Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
6 years agoBug 19166: Unit tests for GetBudgetSpent and GetBudget ordered
Nick Clemens [Wed, 4 Oct 2017 13:22:21 +0000 (13:22 +0000)]
Bug 19166: Unit tests for GetBudgetSpent and GetBudget ordered

To test:
1. prove -v t/db_dependent/Budgets.t
2. Should return green

Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
6 years agoBug 19166: Add the ability to add adjustments to an invoice
Nick Clemens [Wed, 23 Aug 2017 16:13:39 +0000 (16:13 +0000)]
Bug 19166: Add the ability to add adjustments to an invoice

This patchset adds the ability to add adjustments to an invoice, one can
provide a reason, an adjustment amount, select a budget, and choose
whether to encumber the funds before the invoice is closed or not

To test:

1 - Create a new invoice with or without a shipping cost
2 - Note there are no existing adjustments
3 - Add an adjustment
4 - Submit the form withno changes, nothing happens
5 - Update the adjustment you created, ensure changes are saved but no
extra adjustment created
6 - Add another invoice prodiving only reason or amount (you can have 0
        value adjustments)
7 - Verify the adjustment total at bottom is correct
8 - Recieve some orders
9 - Verify totals are correct

Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
6 years agoBug 19166: Database changes
Nick Clemens [Wed, 23 Aug 2017 16:12:25 +0000 (16:12 +0000)]
Bug 19166: Database changes

Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
6 years agoBug 20273: (follow-up) Autocomplete use start instead of contains
Alex Arnaud [Thu, 3 May 2018 09:38:19 +0000 (09:38 +0000)]
Bug 20273: (follow-up) Autocomplete use start instead of contains

Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
6 years agoBug 20273: Use compat routines for autocomplete in auth_finder.pl
Alex Arnaud [Thu, 22 Feb 2018 15:35:11 +0000 (15:35 +0000)]
Bug 20273: Use compat routines for autocomplete in auth_finder.pl

Test plan:
  - Context: Koha working with elasticsearch,
  - Apply BZ 19582 (that make auth_finder.pl works again),
  - apply this patch,
  - go to cgi-bin/koha/authorities/auth_finder.pl,
  - type at least 3 chararcters in a search field and
    check that the autocomplete returns results

Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
6 years agoBug 19604: Unit tests
Nick Clemens [Fri, 17 Nov 2017 14:07:41 +0000 (14:07 +0000)]
Bug 19604: Unit tests

1 - Apply previous patches
2 - prove t/db_dependent/Koha/SearchEngine/Elasticsearch/QueryBuilder.t
3 - Should be green
4 - high fives!

Signed-off-by: Nicolas Legrand <nicolas.legrand@bulac.fr>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
6 years agoBug 19604: Elasticsearch Fixes for build_authorities_query for auth searching
Nick Clemens [Thu, 9 Nov 2017 16:23:57 +0000 (16:23 +0000)]
Bug 19604: Elasticsearch Fixes for build_authorities_query for auth searching

To test:
1 - Do some authority searches in Zebra
2 - Switch to ES and repeat, results will vary and some may fail
3 - Apply patch and dependencies
4 - Reindex ES
5 - Repeat searches, they should suceed and results should be similar to
Zebra
6 - Slight differences are okay, but results should (mostly) meet
expectations

A few notes:
We add a 'normalizer' to ensure we get a single token from the heading
indexes, this makes 'starts with' work as expcted
We switch to 'AND' for fields searched from cataloging editor - this
matches Zebra results
We force the '__sort' fields for sorting - if sorting looks wrong try
reducing the heading field to a single subfield - this will need to be
addressed on a future bug (multiple subfields create an array, ES sorts
        those randomly)

Signed-off-by: Nicolas Legrand <nicolas.legrand@bulac.fr>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
6 years agoBug 13560: DBRev 18.06.00.008
Nick Clemens [Thu, 19 Jul 2018 17:19:38 +0000 (17:19 +0000)]
Bug 13560: DBRev 18.06.00.008

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
6 years agoBug 13560: Add an 'Add' option for marc modification templates
Nick Clemens [Tue, 16 Jan 2018 16:16:40 +0000 (16:16 +0000)]
Bug 13560: Add an 'Add' option for marc modification templates

Add/Update would update a field or create new if it existed, but didn't
allow for creating new if the field existed.

This patchset splits the options to 'Add & Update' so that 'Add' will always
add a field and 'Update' will operate as it always has

To test:
1 - Have a record with a known existing field (make a copy)
2 - Define a marc modification template that 'Add/update' on that field
3 - Define an 'Add/Update' on a field that doesn't exist
4 - Batch modify the copy of record using the above template
5 - Verify the existing field was updated
6 - Verify the non-existing field was updated
7 - Apply patch and update database
8 - Make another copy
9 - Modify the copy with the same template as above
10 - Should match initial modification
11 - Add a new rule to add a new field
12 - Modify using the updated template
13 - Ensure your new field is created
14 - Test various options in the modification tool
15 - prove t/db_dependent/MarcModificationTemplates.t

Signed-off-by: Victor Grousset <victor.grousset@biblibre.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
6 years agoBug 13560: Unit tests
Nick Clemens [Tue, 16 Jan 2018 16:15:26 +0000 (16:15 +0000)]
Bug 13560: Unit tests

To test:
1 - apply all patches
2 - update database
3 - prove t/db_dependent/MarcModificationTemplates.t

Signed-off-by: Victor Grousset <victor.grousset@biblibre.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
6 years agoBug 13560: Database changes
Nick Clemens [Tue, 16 Jan 2018 16:14:49 +0000 (16:14 +0000)]
Bug 13560: Database changes

Signed-off-by: Victor Grousset <victor.grousset@biblibre.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
6 years agoBug 20974: Remove files left behind after removing Solr
Owen Leonard [Thu, 21 Jun 2018 13:37:35 +0000 (13:37 +0000)]
Bug 20974: Remove files left behind after removing Solr

Some files were left behind when Bug 12538 removed support for Solr.
This patch removes them.

To test, apply the patch and fail to observe the existence of these
files:

koha-tmpl/opac-tmpl/bootstrap/en/includes/search/facets.inc
koha-tmpl/opac-tmpl/bootstrap/en/includes/search/page-numbers.inc
koha-tmpl/opac-tmpl/bootstrap/en/includes/search/resort_form.inc

Perform a search in the OPAC to confirm that nothing broke.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
6 years agoBug 21086: Fix wrong mock of DateTime->now
Jonathan Druart [Wed, 18 Jul 2018 21:12:17 +0000 (18:12 -0300)]
Bug 21086: Fix wrong mock of DateTime->now

prove t/db_dependent/DecreaseLoanHighHolds.t
t/db_dependent/DecreaseLoanHighHolds.t .. 1/17 Can't locate object method
 "truncate" via package "80" (perhaps you forgot to load "80"?) at /home/vagrant/kohaclone/C4/Circulation.pm line 3497.

What is happening:
We mock DateTime->now in the script to avoid the date comparaisons to fail on
slow servers (see bug 19705).

  my $now_value       = DateTime->now();
  my $mocked_datetime = Test::MockModule->new('DateTime');
  $mocked_datetime->mock( 'now', sub { return $now_value; } );

Since bug 20287, we have the following calls:
Koha::Patron->store => Koha::Patron::Category->get_expiry_date

which does:
221         return $date->add( months => $self->enrolmentperiod, end_of_month => 'limit' );

as enrolmentperiod is generated by t::lib::TestBuilder, it can be quite big, and so
the date change from one call to the others.

The failure is actually coming from the date becoming > 9999, which is not handled correctly,
on purpose, by Koha::DateUtils (infinite)

On the way this patch fixes the other occurrence, in Sitemapper.t (just in case)

Test plan:
Make sure the tests pass now.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
6 years agoBug 21064: Use undefined instead of undef
Nick Clemens [Thu, 12 Jul 2018 10:18:10 +0000 (10:18 +0000)]
Bug 21064: Use undefined instead of undef

To test:
1 - Load the advanced cataloging editor
2 - Refresh the page several times
3 - Check the JS console, you shoudl see an error:
    'undef is not defined'
4 - Apply patch
5 - Try again, should be no error

Signed-off-by: Pierre-Luc Lapointe <pierreluc.lapointe@inLibro.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
6 years agoBug 21053: Encode URI characters in plugin 008
Jonathan Druart [Wed, 11 Jul 2018 21:55:06 +0000 (18:55 -0300)]
Bug 21053: Encode URI characters in plugin 008

A # (or &) at any position in 008 field of a bib record causes
all subsequent data in field to be overwritten with default values when
record is saved.

These characters need to be correctly encoded before being passed as
parameters of the url

To reproduce:
1. Find and edit a bib record which has an 008 which differs from the
default values for the MARC framework
2. Choose 008 helper
3. Add # in any position before the end of the field noting the current
values of the data
4. Save record
5. Edit record and select 008 helper
6. Review characters after #

Signed-off-by: Maryse Simard <maryse.simard@inlibro.com>
Followed the test plan and it works.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
6 years agoBug 21076: Don't call autocomplete code after patron found
Nick Clemens [Fri, 13 Jul 2018 17:49:14 +0000 (17:49 +0000)]
Bug 21076: Don't call autocomplete code after patron found

To test:
1 - Enable article requests
2 - Search on staff client
3 - Click 'Request article'
4 - Find a patron
5 - View error in console
6 - Apply patch
7 - Reload
8 - Not error is gone

Signed-off-by: Maryse Simard <maryse.simard@inlibro.com>
Followed the test plan and it works.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
6 years agoBug 16575: (follow-up) Compiled CSS
Katrin Fischer [Sun, 15 Jul 2018 18:00:44 +0000 (20:00 +0200)]
Bug 16575: (follow-up) Compiled CSS

This patch contains the compiled CSS for the OPAC print stylesheet.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
6 years agoBug 16575: Irregular behaviour using window.print() followed by window.location.href
Owen Leonard [Wed, 30 May 2018 14:15:19 +0000 (14:15 +0000)]
Bug 16575: Irregular behaviour using window.print() followed by window.location.href

This patch updates the OPAC and staff client carts to use CSS to
control print output, removing a print parameter which was passed to the
script.

Currently, when you click "Print" on the OPAC basket, it navigates to
a new page and initiates window.print() followed by a
window.location.href change again. Unfortunately, due to differences in
IE, Chrome, and FF, it will either show the print options, navigate away
without showing them, or refuse to navigate away after printing. By
changing to using print CSS, we don't navigate away from the basket in
the first place, so we prevent this irregular behavior.

TEST PLAN

1) Apply the patch
2) Create an OPAC basket by clicking "Add to cart" on multiple items
3) Using Chrome, IE, and Firefox (of any version), click the "Print"
   button
4) You should see the relevant print menu without the OPAC basket
   re-loading in any way.
5) After printing is complete, you should still be on the OPAC basket
   pop-up
6) Perform the same tests in the staff client

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
6 years agoBug 21085: Fix add/edit of patrons when HouseboundModule is set
Jonathan Druart [Wed, 18 Jul 2018 21:24:50 +0000 (18:24 -0300)]
Bug 21085: Fix add/edit of patrons when HouseboundModule is set

This script takes all the parameters then set it to create/edit the
patron. We must list housebound_chooser and housebound_deliverer as not
part of patron's attributes

Test plan:
- Enable HouseboundModule
- Create a patron
=> When you save, if the patch is not applied, you will get:
No property housebound_deliverer for Koha::Patron

- Edit a patron
=> When you save, if the patch is not applied, you will get:
Patron creation failed! - DBIx::Class::Row::store_column(): No such column 'housebound_chooser' on Koha::Schema::Result::Borrower at /home/vagrant/kohaclone/Koha/Object.pm line 75

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
6 years agoBug 20807: Lost items report: Improve the display of CSV profile errors
Owen Leonard [Wed, 23 May 2018 17:59:28 +0000 (17:59 +0000)]
Bug 20807: Lost items report: Improve the display of CSV profile errors

This patch modifies the template for the lost items report to change the
way it handles a missing CSV profile. Now, if there is a missing CSV
profile, a message is displayed with details about the profile
requirements. If the logged-in user has the right permission there is a
link to the CSV profiles page.

Since item selection is used only in conjunction with exporting results,
item selection controls are all hidden when there is no valid CSV
profile.

To test, apply the patch go to Reports -> Lost items.

 - Run the report with parameters which will return results.
 - If your system has no CSV profile for exporting lost items:
   - If you are logged in as a user with manage_csv_profiles permission:
     - You should see a message dialog instructing you to create a CSV
       profile with a link to the CSV profiles page.
   - If you are not logged in as a user with manage_csv_profiles
     permission:
     - You should see a similar message but without a link to the CSV
       profiles page.
   - In both cases, with no CSV profile defined there should be no
     checkboxes in the table of results and no "select all/clear all"
     controls.
 - If your system has a valid CSV profile for exporting lost items:
   - Checking the checkbox for one or more items in the table should
     trigger the display of an "Export selected items" link.

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
6 years agoBug 7651: DBRev 18.06.00.007
Nick Clemens [Wed, 18 Jul 2018 18:07:00 +0000 (18:07 +0000)]
Bug 7651: DBRev 18.06.00.007

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
6 years agoBug 7651: put TT directive on a single line to help translation
Jonathan Druart [Tue, 5 Jun 2018 17:53:47 +0000 (14:53 -0300)]
Bug 7651: put TT directive on a single line to help translation

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
6 years agoBug 7651: (QA follow-up) Fix warning about undefined active currency
Katrin Fischer [Mon, 4 Jun 2018 19:19:42 +0000 (21:19 +0200)]
Bug 7651: (QA follow-up) Fix warning about undefined active currency

If no active currency is defined we show a warning. This fixes
the link shown below to check the correct permission.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
6 years agoBug 7651: (follow-up) Correct visibility on admin sidebar
Katrin Fischer [Thu, 24 May 2018 06:17:09 +0000 (08:17 +0200)]
Bug 7651: (follow-up) Correct visibility on admin sidebar

This patch corrects visibility of links to the different
acquisition pages from the admin sidebar.

It also makes a correction to the links on the acq start
page:
- Budgets = period_manage
- Funds = budget_manage

To test:
- Follow the test plan of the first patch

Signed-off-by: Charles Farmer <charles.farmer@inLibro.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
6 years agoBug 7651: Add a new permission for managing currencies and exchange rates
Katrin Fischer [Sun, 20 May 2018 21:47:53 +0000 (23:47 +0200)]
Bug 7651: Add a new permission for managing currencies and exchange rates

At the moment staff users need parameters or parameters_remaining_permissions
in order to be able to change exchange rates for acquisition orders.

This patch adds a new separate permission currencies_manage and
updates staff users currently having those permissions to get the
new permission as well.

To test:
- Create some staff users with different permission sets
  1) superlibrarian
  2) parameters
  3) parameters_remaining_permissions
  4) manage_circ_rules, but not parmeters_remaining_permissions
  5) all acquisition permissions
- Apply patch and run database update
- Verify new permission has been added and staff users updated
  1) remains the same
  2) + 3) will have currencies_manage
  4) remains unchanged, doesn't have new permission
  5) remains the same, will have access now because of having
     the top level acquisition permission
- Verify the changed pages work correctly:
  - navigation on admin home page
    NOTE: the acquisition parameters section will now honor all
    different related permissions (edi_manage, budget_manage,...)
  - navigation on acquisition home page
  - try to access currencies page directly

Signed-off-by: Charles Farmer <charles.farmer@inLibro.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
6 years agoBug 20393: (QA follow-up) Remove only occurence of misc/plack/koha.psgi
Julian Maurice [Fri, 8 Jun 2018 06:53:51 +0000 (08:53 +0200)]
Bug 20393: (QA follow-up) Remove only occurence of misc/plack/koha.psgi

Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
6 years agoBug 20393: Remove redundant 'koha.psgi' and 'plackup.sh' files
Mason James [Wed, 14 Mar 2018 01:12:12 +0000 (14:12 +1300)]
Bug 20393: Remove redundant 'koha.psgi' and 'plackup.sh' files

Signed-off-by: David Bourgault <david.bourgault@inlibro.com>
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
6 years agoBug 18322: (follow-up) Use authorized value labels
Martin Renvoize [Wed, 13 Jun 2018 09:29:54 +0000 (10:29 +0100)]
Bug 18322: (follow-up) Use authorized value labels

Rather than using the raw ccode's use the labels as defined in the
authorized values.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
6 years agoBug 18322: Update xslt for NORMARC and UNIMARC
Tomas Cohen Arazi [Tue, 12 Jun 2018 17:47:30 +0000 (14:47 -0300)]
Bug 18322: Update xslt for NORMARC and UNIMARC

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
6 years agoBug 18322: (follow-up) Add generated xsl
Martin Renvoize [Tue, 12 Jun 2018 14:37:33 +0000 (15:37 +0100)]
Bug 18322: (follow-up) Add generated xsl

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
6 years agoBug 18322: Add a facet for ccode fields to Zebra
Martin Renvoize [Thu, 23 Mar 2017 10:49:09 +0000 (10:49 +0000)]
Bug 18322: Add a facet for ccode fields to Zebra

This patch adds the index definitions for zebra faceting of ccode in
koha for marc21, normarc and unimarc.

We also add lines to the templates to expose the new facet and enable
non-zebra faceting for ccode too.

Signed-off-by: David Cook <dcook@prosentient.com.au>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
6 years agoBug 18072: Only accept Koha::Library in parameters
Jonathan Druart [Tue, 19 Sep 2017 13:29:25 +0000 (10:29 -0300)]
Bug 18072: Only accept Koha::Library in parameters

I do not think we should allowed branchode and Koha::Library objects, it
adds confusion in callers (we never know if we have a branchcode of a
library object).

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
6 years agoBug 18072: (QA follow-up) Remove warning from tests
Tomas Cohen Arazi [Mon, 11 Sep 2017 18:22:49 +0000 (15:22 -0300)]
Bug 18072: (QA follow-up) Remove warning from tests

This patch removes a warning from Items.t due to bad parameters. It also
makes the tests use Test::Exception.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
6 years agoBug 18072: Add Koha::Biblio->can_be_transferred
Lari Taskula [Fri, 10 Feb 2017 13:11:17 +0000 (15:11 +0200)]
Bug 18072: Add Koha::Biblio->can_be_transferred

This patch adds a new method Koha::Biblio->can_be_transferred. The method checks
if at least one of the item of that biblio can be transferred to desired location.

This method will be useful for building a smarter pickup location list for holds,
because we will be able to hide those libraries to which none of the items of
this biblio can be transferred to due to branch transfer limits (see Bug 7614).

To test:
1. prove t/db_dependent/Koha/Biblios.t

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
6 years agoBug 18072: (QA follow-up) let Koha::Item->can_be_transferred take HASHref as param
Lari Taskula [Fri, 10 Feb 2017 13:08:47 +0000 (15:08 +0200)]
Bug 18072: (QA follow-up) let Koha::Item->can_be_transferred take HASHref as param

This patch changes Koha::Item->can_be_transferred to accept a HASHref as follows:
$item->can_be_transferred({ to => $library, from => $library2 })

To test:
1. prove t/db_dependent/Koha/Items.t

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
6 years agoBug 18072: Add Koha::Item->can_be_transferred
Lari Taskula [Tue, 7 Feb 2017 11:52:29 +0000 (13:52 +0200)]
Bug 18072: Add Koha::Item->can_be_transferred

This patch adds a new method Koha::Item->can_be_transferred.

Includes unit test.

To test:
1. prove t/db_dependent/Koha/Items.t

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
6 years agoBug 18072: Add deprecation warning to C4::Circulation Branch Transfer Limit functions
Lari Taskula [Tue, 7 Feb 2017 14:33:40 +0000 (16:33 +0200)]
Bug 18072: Add deprecation warning to C4::Circulation Branch Transfer Limit functions

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
6 years agoBug 18072: Add Koha objects for Branch Transfer Limit
Lari Taskula [Tue, 7 Feb 2017 11:16:30 +0000 (13:16 +0200)]
Bug 18072: Add Koha objects for Branch Transfer Limit

This patch also fixes documentation in Koha/Item/Transfer.pm and
Koha/Item/Transfers.pm.

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
6 years agoBug 19902: (follow-up) Deal with patron column regarding on intranetreadinghistory...
Josef Moravec [Mon, 25 Jun 2018 11:27:03 +0000 (11:27 +0000)]
Bug 19902: (follow-up) Deal with patron column regarding on intranetreadinghistory setting

Test plan:
Try it with intranetreadinghistory allowed and not allowed and it should
still work in both cases

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
6 years agoBug 19902: Add column settings to bibliographic record checkouts history table
Josef Moravec [Tue, 2 Jan 2018 06:35:47 +0000 (06:35 +0000)]
Bug 19902: Add column settings to bibliographic record checkouts history table

Test plan:
0) Apply the patch
1) Go to administration -> Configure columns, note there is new
checkoutshistory-table in Catalogue section
2) Make some configuration in this table settings
3) Go to detail of any record -> Checkout history
4) The columns should be visible according to your configuration from
step 2
5) Play with Column visibility, to ensure it does work as it should

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Fixed a minor typo during signoff.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
6 years agoBug 20806: Surround string by span tag to help translation
Jonathan Druart [Fri, 29 Jun 2018 20:36:51 +0000 (17:36 -0300)]
Bug 20806: Surround string by span tag to help translation

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
6 years agoBug 20806: Do not rely on column position
Jonathan Druart [Fri, 29 Jun 2018 20:30:39 +0000 (17:30 -0300)]
Bug 20806: Do not rely on column position

It is not the first time we have this splice call, it seems safer to
rely on the column's name instead of the column's position

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
6 years agoBug 20806: Add item type description holds history page
Josef Moravec [Tue, 29 May 2018 09:15:09 +0000 (09:15 +0000)]
Bug 20806: Add item type description holds history page

Test plan:

0) Do not apply the patch
1) Set AllowHoldItemTypeSelection to Allow
2) Place some hold for a patron, some with specific item type and some
without item type
3) On holds history page you should see blank or item type code in item
type column
4) Apply the patch
5) Now you should see description in item type column
6) Set AllowHoldItemTypeSelection to Don't Allow
7) You shold not see the item type column, but column visibility
settings should continue working ;)

Signed-off-by: Maryse Simard <maryse.simard@inlibro.com>
Followed the test plan and it works.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
6 years agoBug 20079: Display stack trace for development installations
Jonathan Druart [Tue, 23 Jan 2018 18:54:41 +0000 (15:54 -0300)]
Bug 20079: Display stack trace for development installations

"""The default value is development, which causes plackup to
load the middleware components: AccessLog, StackTrace, and Lint unless
--no-default-middleware is set."""

Test plan:
Confirm that the stack trace is displayed when something is wrong (die somewhere to test)
for dev installations (inside a devbox)
The -E flag must remain deployment for non-dev installs

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
6 years agoBug 19524: DBRev 18.06.006
Nick Clemens [Wed, 18 Jul 2018 16:55:56 +0000 (16:55 +0000)]
Bug 19524: DBRev 18.06.006

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
6 years agoBug 19524: Use existing logged_in_user variable
Kyle M Hall [Mon, 16 Jul 2018 11:54:49 +0000 (07:54 -0400)]
Bug 19524: Use existing logged_in_user variable

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
6 years agoBug 19524: Share patron lists between staff
Kyle M Hall [Thu, 7 Jun 2018 12:16:18 +0000 (12:16 +0000)]
Bug 19524: Share patron lists between staff

Some libraries would like to allow arbitrary lists to be used by all
librarians with the 'manage_patron_lists' permission.

Test Plan:
1) Apply this patch
2) Run updatedatabase.pl
3) Create or find two patrons with the manage_patron_lists permission
4) Using the first patron, create two new lists, mark one of them as
   shared
5) Log in as the second patron, browse to the patron lists page
6) Note the second patron can view, add and remove patrons from
   the shared list owned by the first patron

Signed-off-by: George Williams <george@nekls.org>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
6 years agoBug 19524: Update database
Kyle M Hall [Thu, 7 Jun 2018 10:48:30 +0000 (10:48 +0000)]
Bug 19524: Update database

Signed-off-by: George Williams <george@nekls.org>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
6 years agoBug 21038: Reserves should be holds
Owen Leonard [Mon, 16 Jul 2018 18:41:13 +0000 (18:41 +0000)]
Bug 21038: Reserves should be holds

This patch corrects the text of the warning about discharges cancelling
holds.

To test, apply the patch and view the discharge for a patron who has
holds:

 - "Borrower" is changed to "patron"
 - "reserves" is changed to "holds"
 - "canceled" (18 instances in the templates) is changed to "cancelled"
   (51 instances).

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
6 years agoBug 20942: (QA follow-up) Use $lines->total_outstanding
Tomas Cohen Arazi [Mon, 2 Jul 2018 19:18:33 +0000 (16:18 -0300)]
Bug 20942: (QA follow-up) Use $lines->total_outstanding

This patch makes the controller code use $lines->total_outstanding
instead of expecting ->outstanding_debits and ->outstanding_credits
return the total.

Tests should pass as before. No behaviour change is expected.

To test:
- Run:
  $ kshell
 k$ prove t/db_dependent/api/v1/patrons_accounts.t
=> SUCCESS: Tests still pass, no behaviour change.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
6 years agoBug 20942: Split debit and credit lines
Tomas Cohen Arazi [Mon, 25 Jun 2018 17:55:30 +0000 (14:55 -0300)]
Bug 20942: Split debit and credit lines

This patch splits the balance to match this object schema:

{
    balance             => #,
    outstanding_credits => {
        total => #,
        lines => [ credit_line_1, ..., credit_line_n ]
    },
    outstanding_debits  => {
        total => #,
        lines => [ debit_line_1, ..., debit_line_m ]
    }
}

This change is made to ease usage from the UI. Also because the
outstanding credits need to be applied to outstanding debits in order to
the balance value to make sense. So we still need to have each total.

Tests are added for this change, and the schema files are adjusted as
well.

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

staff_id is changed into user_id as voted on the dev meeting the RFC got
approved.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
6 years agoBug 20942: Add route to get patron's account balance
Tomas Cohen Arazi [Wed, 13 Jun 2018 17:02:44 +0000 (14:02 -0300)]
Bug 20942: Add route to get patron's account balance

This patch implements the /patrons/{patron_id}/account endpoint. It can
be used to get the patron's balance information, including outstanding
lines.

To test:
- Apply this patchset
- Run:
  $ kshell
 k$ prove t/db_dependent/api/v1/patrons_accounts.t
=> SUCCESS: tests pass!
- Make your favourite REST testing tool (RESTer on Firefox?) do:
  GET /api/v1/patrons/{patron_id}/account
to a valid patron_id. Play with Koha's UI to add credits/payments and
notice the endpoint returns the right info following the voted RFC. [1]
- Sign off :-D

[1] https://wiki.koha-community.org/wiki/Patrons_account_lines_endpoint_RFC

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
6 years agoBug 20942: Unit tests for /patrons/{patron_id}/account
Tomas Cohen Arazi [Wed, 13 Jun 2018 17:02:30 +0000 (14:02 -0300)]
Bug 20942: Unit tests for /patrons/{patron_id}/account

This patch adds tests for the /patrons/{patron_id}/account endpoint.
To test:

- Run:
  $ kshell
 k$ prove t/db_dependent/api/v1/patrons_accounts.t
=> FAIL: Tests should fail because the endpoint is not implemented.

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
6 years agoBug 20942: OpenAPI spec for /patrons/{patron_id}/account
Tomas Cohen Arazi [Fri, 1 Jun 2018 19:04:35 +0000 (16:04 -0300)]
Bug 20942: OpenAPI spec for /patrons/{patron_id}/account

This patch adds the OpenAPI spec for the following paths:
- /patrons/{patron_id}/account

It also adds object definitions for:
- balance
- account line

Account line is to be used on both /account/lines (when implemented)
and for embeding the outstanding lines in the balance endpoint
(/patrons/{patron_id}/account).

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
6 years agoBug 20287: (RM follow-up) Add POD
Nick Clemens [Wed, 18 Jul 2018 16:34:50 +0000 (16:34 +0000)]
Bug 20287: (RM follow-up) Add POD

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
6 years agoBug 20287: (follow-up) Test exception DuplicateID for Koha::Patron->store
Jonathan Druart [Thu, 12 Jul 2018 19:34:06 +0000 (16:34 -0300)]
Bug 20287: (follow-up) Test exception DuplicateID for Koha::Patron->store

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
6 years agoBug 20287: (QA follow-up) Fix warning on undefined
Tomas Cohen Arazi [Fri, 29 Jun 2018 13:54:52 +0000 (10:54 -0300)]
Bug 20287: (QA follow-up) Fix warning on undefined

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
6 years agoBug 20287: Test exception DuplicateID for Koha::Patron->store
Jonathan Druart [Mon, 25 Jun 2018 16:14:05 +0000 (13:14 -0300)]
Bug 20287: Test exception DuplicateID for Koha::Patron->store

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
6 years agoBug 20287: Use more simple object for Object.t
Jonathan Druart [Mon, 25 Jun 2018 15:53:19 +0000 (12:53 -0300)]
Bug 20287: Use more simple object for Object.t

We initially use Koha::Patron to test Object.t, but now it overwrites
->store and so it is better to use a more simple object.
ApiKey has foreign keys and unique key.
We lost one test: there is only one unique key whereas we had 2 on
borrowers (I did not find a better option)

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
6 years agoBug 20287: Fix tests expecting a warning
Tomas Cohen Arazi [Thu, 29 Mar 2018 16:34:25 +0000 (13:34 -0300)]
Bug 20287: Fix tests expecting a warning

The new Koha::Patron-based implementation encapsulates some error
conditions that raised warnings and the tests expected that warning.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
6 years agoBug 20287: Replace occurrences of ModMember in REST API
Jonathan Druart [Thu, 29 Mar 2018 15:59:18 +0000 (12:59 -0300)]
Bug 20287: Replace occurrences of ModMember in REST API

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
6 years agoBug 20287: Replace occurrences of AddMember in REST API
Jonathan Druart [Thu, 29 Mar 2018 15:53:01 +0000 (12:53 -0300)]
Bug 20287: Replace occurrences of AddMember in REST API

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
6 years agoBug 20287: generate_userid now set the userid
Jonathan Druart [Fri, 23 Feb 2018 18:03:57 +0000 (15:03 -0300)]
Bug 20287: generate_userid now set the userid

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
6 years agoBug 20287: Fix update of patrons, clean the data before ->store
Jonathan Druart [Fri, 23 Feb 2018 16:12:36 +0000 (13:12 -0300)]
Bug 20287: Fix update of patrons, clean the data before ->store

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
6 years agoBug 20287: Replace ModMember in patrons import
Jonathan Druart [Fri, 23 Feb 2018 16:02:29 +0000 (13:02 -0300)]
Bug 20287: Replace ModMember in patrons import

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
6 years agoBug 20287: There is a warning, we just want to unset the value here
Jonathan Druart [Fri, 23 Feb 2018 15:55:48 +0000 (12:55 -0300)]
Bug 20287: There is a warning, we just want to unset the value here

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
6 years agoBug 20287: Fix test t/db_dependent/Members.t and prevent regressions
Jonathan Druart [Fri, 23 Feb 2018 15:55:33 +0000 (12:55 -0300)]
Bug 20287: Fix test t/db_dependent/Members.t and prevent regressions

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
6 years agoBug 20287: ->store new deal with enrolment fee
Jonathan Druart [Fri, 23 Feb 2018 15:42:46 +0000 (12:42 -0300)]
Bug 20287: ->store new deal with enrolment fee

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
6 years agoBug 20287: Move ModMember to Koha::Patron
Jonathan Druart [Fri, 23 Feb 2018 15:42:15 +0000 (12:42 -0300)]
Bug 20287: Move ModMember to Koha::Patron

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
6 years agoBug 20287: Add plain_text_password (& Remove AddMember_Opac)
Jonathan Druart [Thu, 22 Feb 2018 20:13:22 +0000 (17:13 -0300)]
Bug 20287: Add plain_text_password (& Remove AddMember_Opac)

But actually we could remove it if it does not make sense for other use.
Callers could deal with it since the password is not generated here

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>