]> git.koha-community.org Git - koha.git/log
koha.git
7 years agoBug 9031: Unit tests for DST crossing in (days|hours)_between
Nick Clemens [Fri, 7 Jul 2017 13:03:39 +0000 (13:03 +0000)]
Bug 9031: Unit tests for DST crossing in (days|hours)_between

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Without the patch for Calendar.pm, this crashes on:
Invalid local time for date in time zone: America/New_York

But even with the original change to Calendar.pm, I would see:
Invalid local time for date in time zone: Europe/Amsterdam
Adding a follow-up for that.

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
7 years agoBug 19493: Force scalar context to prevent future error
Jonathan Druart [Fri, 27 Oct 2017 15:34:32 +0000 (12:34 -0300)]
Bug 19493: Force scalar context to prevent future error

If someone decide the reuse the template->param statement to pass values
to the template, we will get the same issue.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
7 years agoBug 19493: Remove few warnings from circulation.pl
Marcel de Rooy [Wed, 18 Oct 2017 14:03:57 +0000 (16:03 +0200)]
Bug 19493: Remove few warnings from circulation.pl

If you click Submit on the staff home page without entering a cardnumber, you will find these warnings in the log:
Problem = a value of override_high_holds has been passed to param without key at /usr/share/koha/masterclone/C4/Templates.pm line 137.
Problem = a value of nopermission has been passed to param without key at /usr/share/koha/masterclone/C4/Templates.pm line 137.
Use of uninitialized value $val in concatenation (.) or string at /usr/share/koha/masterclone/C4/Templates.pm line 137.
Problem = a value of  has been passed to param without key at /usr/share/koha/masterclone/C4/Templates.pm line 137.

Cause is this call to $template->param:
$template->param(
     CircAutocompl             => C4::Context->preference("CircAutocompl"),
     debarments                => GetDebarments({ borrowernumber => $borrowernumber }),
     todaysdate                => output_pref( { dt => dt_from_string()->set(hour => 23)->set(minute => 59), dateformat => 'sql' } ),
    has_modifications         => $has_modifications,
     override_high_holds       => $override_high_holds,
     nopermission              => scalar $query->param('nopermission'),

In this specific case GetDebarments returns undef in list context (empty list),
so all items in the list shift one place.
Either we should force GetDebarments to return []; or we force scalar context in a construction like this. This patch does the last thing.

Note: The calls in memberentry.pl and moremember.pl are not affected.

Test plan:
[1] Do not apply. Click Submit without cardnumber. Check the log.
[2] Apply. Click Submit again without cardnumber. Check log.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
7 years agoBug 16660: (followup) Unit tests
Tomas Cohen Arazi [Fri, 20 Oct 2017 13:26:04 +0000 (10:26 -0300)]
Bug 16660: (followup) Unit tests

This patch adds unit tests for the introduced changes in
build_query_compat.

It removes a warning too.

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>
7 years agoBug 16660: Add support for OpacSuppression to Elasticsearch
Nick Clemens [Wed, 18 Oct 2017 21:00:44 +0000 (21:00 +0000)]
Bug 16660: Add support for OpacSuppression to Elasticsearch

To test:
1 - Enable suppression
2 - Suppress some records
3 - Apply all the patches
4 - Reindex ES
5 - Search and don't get suppressed records
6 - Disable suppression
7 - Search and get all the records

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>
7 years agoBug 16660: Moved Opac Supression filtering from opac-search.pl to Zebra::QueryBuilder
Srdjan [Tue, 28 Feb 2017 02:17:49 +0000 (15:17 +1300)]
Bug 16660: Moved Opac Supression filtering from opac-search.pl to Zebra::QueryBuilder

To test:
OPAC: Both SearchEngine "Elasticsearch" and "Zebra" should work with
OpacSuppression set to "yes"

NB: OPAC suppression is not implemented for Elasticsearch

Signed-off-by: David Bourgault <david.bourgault@inlibro.com>
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>
7 years agoBug 18118: Unexpected behaviour with 'GoogleOpenIDConnect' and 'OpacPublic' syspref...
Mason James [Thu, 1 Dec 2016 00:38:51 +0000 (13:38 +1300)]
Bug 18118: Unexpected behaviour with 'GoogleOpenIDConnect' and 'OpacPublic' syspref combination.

TEST PLAN
----------
1/ configure a working 'GoogleOpenIDConnect' account

See comment #5 which also links back to
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16892#c3

2/ set 'OpacPublic' (under OPAC) to 'Disabled' and
   'GoogleOpenIDConnect' (under Administration) to 'Yes'.

3/ log in user successfully via google-auth, observe redirect to
   opac-user.pl (bad)

4/ apply patch
   -- on kohadevbox remember to restart all! Plack is unforgiving. :)

5/ log in user successfully via google-auth, observe expected
   redirect to opac-main.pl (good)

While I would normally suggest running koha qa test tools, because
this file doesn't end in .pl, it doesn't get picked up by them.

6/ perlcritic -4 opac/svc/auth/googleopenidconnect
   -- notice this is a level better than required. :)

This also eyeballs easily well.

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
7 years agoBug 19484: Add test before using object itemtype
Marcel de Rooy [Wed, 18 Oct 2017 14:00:34 +0000 (16:00 +0200)]
Bug 19484: Add test before using object itemtype

Patch applies and functions as described. I agree with you that importing NULL itemtypes is possible Marcel. A higher importance level makes sense.

Signed-off-by: Dilan Johnpullé <dilan@calyx.net.au>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
7 years agoBug 19531: When saving patron record do not redirect to circ if not authorised
Jonathan Druart [Wed, 25 Oct 2017 20:29:16 +0000 (17:29 -0300)]
Bug 19531: When saving patron record do not redirect to circ if not authorised

If the logged in patron does not have the necessary permission we should
not redirect to circulation.pl but moremember.pl instead

Test plan:
With the borrowers permission, you should be able to edit a patron and
be redirect to the moremember page

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>
7 years agoBug 19389: Hide library groups pull down if empty
Jonathan Druart [Mon, 2 Oct 2017 17:30:14 +0000 (14:30 -0300)]
Bug 19389: Hide library groups pull down if empty

Regression introduced by bug
  commit 141200794da9f27e0231e1c2dad4bcb994d650f3
    Bug 15295: Koha::Libraries - Remove GetBranchCategories

The intranet advanced search page offers to search for groups of
libraries, even if the pull down is empty as no library groups have
been defined.

Test plan:
- Go to the adv search page at the intranet
- Without library group you must not see the "Groups of libraries"
dropdown list
- With at least a library group you must see it

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
7 years agoBug 19069: Fix 'does not match' behaviour in MARC modification template
Jonathan Druart [Mon, 2 Oct 2017 19:42:46 +0000 (16:42 -0300)]
Bug 19069: Fix 'does not match' behaviour in MARC modification template

The "does not match" condition does not behave as expected.
We want it to process the action if the subfield exists and that the
value does not match a given pattern.

Test plan:
Be creative and write different template actions using the "does not
match" condition.
Using the "Batch record modification" and the "Show MARC" popup, confirm
that the processed record is the one you are expecting.

Signed-off-by: Jon Knight <J.P.Knight@lboro.ac.uk>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
7 years agoBug 19029: (follow-up) Make security question appear on clone operations from one...
Alex Buckley [Wed, 11 Oct 2017 13:41:27 +0000 (13:41 +0000)]
Bug 19029: (follow-up) Make security question appear on clone operations from one library to another

Message pops up for all instances of cloning now.
Works as expected.

Signed-off-by: Dilan Johnpullé <dilan@calyx.net.au>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
7 years agoBug 19029: (follow-up) Implemented .format() to ease translation
Alex Buckley [Mon, 2 Oct 2017 19:33:37 +0000 (08:33 +1300)]
Bug 19029: (follow-up) Implemented .format() to ease translation

Sponosred by: Catalyst IT

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
7 years agoBug 19029: Add JavaScript security question for cloning circ rules
Alex Buckley [Thu, 24 Aug 2017 21:25:40 +0000 (21:25 +0000)]
Bug 19029: Add JavaScript security question for cloning circ rules

This patch introduces a Javascript security question which is displayed
to the user when they try to clone a circulation rule to a specific
branch when the rule is a 'Standard rule for all libraries"

The rationale for this patch is when the cloning takes place it
overwrites the existing rules of the destination branch and there is no
notification of this to the user. Therefore by implementing this patch
the user is asked if they want to clone the rule (if the rule is
standard accross all libraries) and are told that it
will overwrite the rules in the destination branch.

Test plan:
1. Create a circulation rule for all libraries

2. Make sure the 'select a library' option is set to 'Standard rules for all
libraries"

3. Click the 'Clone' button and notice that the cloning takes place
without any warning that it will overwrite the rules of the destination
branch

4. Apply patch

5. Return to the circulation and fine rules page

6. Repeat step 2

7. Click the clone button and notice a alert box appears asking if you
are sure you want to clone the standard rule to the destination branch.

Note: The name of the destination branch is included in the alert.
Also note that the user is informed of the consequences of performing
the action, i.e. that it will overwrite the existing rules in the
destination branch

8. Click 'Cancel' and notice that no cloning occurs

9. Click the clone button again and this time click 'OK' and notice
that the cloning takes place

10. Return to the Circulation and fine rules page and set the 'Select a
library' option to the name of an individual branch

11. Click the clone button and notice that the clone action takes place

Sponsored-By: Catalyst IT
Signed-off-by: David Bourgault <david.bourgault@inlibro.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
7 years agoBug 19443: Remove duplicate message when editing existing patron
Alex Arnaud [Thu, 12 Oct 2017 07:24:33 +0000 (07:24 +0000)]
Bug 19443: Remove duplicate message when editing existing patron

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
7 years agoBug 19443: Wrong HTML in patron creation page (members/memberentry.pl)
Alex Arnaud [Tue, 10 Oct 2017 15:21:35 +0000 (15:21 +0000)]
Bug 19443: Wrong HTML in patron creation page (members/memberentry.pl)

The form provided on top of the page if Koha find a duplicate
patron is not closed. This cause some trouble.

Test plan:

 - Edit the syspref IntranetUserJS and type the following code:
   "$(document).ready(function() {
    $("#memberentry_library_management").insertBefore("#memberentry_identity");
    });"
 - create a patron so that Koha will warn you about a duplicate one,
 - click on "Not a duplicate. Save as new record",
 - you should get error(s) about empty field(s).
   Note that now, the library management part's fields are empty or
   reset to default

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
7 years agoBug 12363: DBRev 17.06.000.023
Jonathan Druart [Fri, 27 Oct 2017 17:02:53 +0000 (14:02 -0300)]
Bug 12363: DBRev 17.06.000.023

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
7 years agoBug 12363: Add a switch to mark|do not mark items as returned when lost
Jonathan Druart [Tue, 17 Oct 2017 13:55:09 +0000 (10:55 -0300)]
Bug 12363: Add a switch to mark|do not mark items as returned when lost

There are several ways to mark an item an lost:
- item list view (catalogue/moredetail.pl, "Items" tab)
- cataloguing (cataloguing/additem.pl)
- Batch item modification tools (tools/batchMod.pl)
- The long overdue cronjob (misc/cronjobs/longoverdue.pl)

So far only the cronjob is configurable, the others mark the item as
returned (does the checkin).

This behaviour should be controlable using a syspref, to let libraries
choose what fit best for them.

Test plan:
Use the 2 options of the pref, mark checked out items as lost using the
different possibilities, and confirm that the behaviours make sense to
you

Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>
Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
7 years agoBug 12363: Add new pref MarkLostItemsAsReturned
Jonathan Druart [Tue, 17 Oct 2017 13:54:33 +0000 (10:54 -0300)]
Bug 12363: Add new pref MarkLostItemsAsReturned

Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
7 years agoBug 18884: Advanced search on staff client, Availability limit not properly limiting
David Cook [Tue, 10 Oct 2017 01:05:16 +0000 (12:05 +1100)]
Bug 18884: Advanced search on staff client, Availability limit not properly limiting

Patch applies and functions as described.

Signed-off-by: Dilan Johnpullé <dilan@calyx.net.au>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
7 years agoBug 19503: Duplicating a dropdown menu subfield yields an empty subfield tag
Andreas Roussos [Fri, 20 Oct 2017 19:58:27 +0000 (22:58 +0300)]
Bug 19503: Duplicating a dropdown menu subfield yields an empty subfield tag

While editing a record in the staff client, if you clone a repeatable
dropdown subfield the cloned subfield's tag is empty. This can result
in data loss if the record is saved, re-opened, and saved yet again.
This patch (originally written by Sophie MEYNIEUX for bug 17818) fixes that.

Test plan:
0) [PREREQUISITE] In your MARC framework (Home > Administration > MARC
   bibliographic framework) ensure that you have at least one subfield
   of a particular tag linked to an authorised value (e.g. in UNIMARC,
   tag 700 subfield 4 is 'Relator Code' and can be linked to CCODE for
   testing purposes). This is so that the relevant subfield will be a
   dropdown menu and not a textbox.
1) In the Staff Client, edit an existing record or create a new one.
   Then, try to clone any subfield that is a dropdown menu. Observe
   that the cloned subfield's tag is empty.
2) Apply the patch.
3) Hit CTRL-F5 in your browser (to ensure cataloging.js is re-loaded)
   and try to clone a dropdown menu subfield again. This time the tag
   is cloned as well.

Working as intended.

Signed-off-by: Simon Pouchol <simon.pouchol@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
https://bugs.koha-community.org/show_bug.cgi?id=16503

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
7 years agoBug 19117: Add CSRF protection to paycollect.pl
Jonathan Druart [Wed, 4 Oct 2017 20:49:51 +0000 (17:49 -0300)]
Bug 19117: Add CSRF protection to paycollect.pl

Security bug, trivial changes, no need to provide procedure for script
kiddies.

Test plan:
Pay fines using the different options from the "Pay fines" tab.

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>
7 years agoBug 18956: Fix empty to in message queue
Mark Tompsett [Wed, 13 Sep 2017 03:44:19 +0000 (03:44 +0000)]
Bug 18956: Fix empty to in message queue

Follow the test plan in comment #20.
Also tweaked string, because it was really 'or' before too.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Amended text in added comment.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
7 years agoBug 18956: (QA follow-up) Resolve a CGI::Param in list context warn
Marcel de Rooy [Fri, 8 Sep 2017 06:53:37 +0000 (08:53 +0200)]
Bug 18956: (QA follow-up) Resolve a CGI::Param in list context warn

From the plack-error.log:
CGI::param called in list context from package CGI::Compile::ROOT::usr_share_koha_masterclone_opac_opac_2dpassword_2drecovery_2epl line 129, this can lead to vulnerabilities. See the warning in "Fetching the value or values of a single named parameter" at /usr/share/perl5/CGI.pm line 436.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
7 years agoBug 18956: Prevent leaking during password recovery
Mark Tompsett [Fri, 25 Aug 2017 19:09:38 +0000 (15:09 -0400)]
Bug 18956: Prevent leaking during password recovery

TEST PLAN
---------

It is assumed you have set the OpacResetPassword to 'allowed',
and likely in combination with OpacPasswordChange to 'Allowed'.

You will have two patrons: one with and another without
any email address entered. You will want to test this test plan
with both patrons.

$ git checkout -b bug_18956 origin/master

Prepend the following as understood between step sections:
opac -> forgot password and then enter...

correct login/cardnumber, it will email
delete from borrower_password_recovery;

correct email, it will email
delete from borrower_password_recovery;

correct login/cardnumber && correct email, it will email
delete from borrower_password_recovery;

wrong login/cardnumber && correct email, error page as expected
delete from borrower_password_recovery;

correct login/cardnumber && wrong email, error page as expected
delete from borrower_password_recovery;

wrong login/cardnumber && wrong email, error page as expected
delete from borrower_password_recovery;

submit empty -- INTERNAL SERVER ERROR?!
delete from borrower_password_recovery;

-- None of the above step sections displayed email.

correct login/cardnumber, it will email

correct login/cardnumber again, but it leaks email address!
delete from borrower_password_recovery;

correct email, it will email

correct email again, but it leaks login/cardnumber!
delete from borrower_password_recovery;

$ git bz apply 18956
-- choose interactive, and choose this counter patch.

repeat the same test set again
-- no leaks will occur, error message pages returned should
   be reasonable, code should read reasonably.

run koha qa test tools.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
7 years agoBug 19333: Fix XSS in opac-shelves
Jonathan Druart [Mon, 18 Sep 2017 17:53:41 +0000 (14:53 -0300)]
Bug 19333: Fix XSS in opac-shelves

category is send back to the template, it must be escaped

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
7 years agoBug 17829: (follow-up) Move GetMember to Koha::Patron
Jonathan Druart [Thu, 26 Oct 2017 18:40:24 +0000 (15:40 -0300)]
Bug 17829: (follow-up) Move GetMember to Koha::Patron

Do not call method on $patron if there is no other reserves

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
7 years agoBug 12768: (follow-up) DBRev 17.06.00.019
Jonathan Druart [Wed, 25 Oct 2017 19:51:28 +0000 (16:51 -0300)]
Bug 12768: (follow-up) DBRev 17.06.00.019

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
7 years agoBug 19038: DBRev 17.06.00.022
Jonathan Druart [Wed, 25 Oct 2017 19:50:34 +0000 (16:50 -0300)]
Bug 19038: DBRev 17.06.00.022

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
7 years agoBug 19461: Add floating toolbar to staff client catalog search results
Owen Leonard [Thu, 1 Jun 2017 12:19:46 +0000 (12:19 +0000)]
Bug 19461: Add floating toolbar to staff client catalog search results

This patch adds a floating toolbar to the staff client search results
page, making all the various controls visible as the user scrolls down.

To test, apply the patch and perform a catalog search in the staff
client.

- The toolbar should "stick" to the top of the page as you scroll down.
- Controls in the toolbar should all work correctly:

  - Select all / Clear all
  - Highlight / Unhighlight
  - Add to Cart
    - Cart notifications should be positioned correctly
  - Add to list (and all list menu controls)
  - Place hold (including controls which are visible when
    a "Search to hold" has been initiated
  - Z39.50/SRU search
  - Sort

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
7 years agoBug 19038: QA Followup - Hide barcode column by default (as syspref default is hide)
Nick Clemens [Tue, 24 Oct 2017 15:19:47 +0000 (15:19 +0000)]
Bug 19038: QA Followup - Hide barcode column by default (as syspref default is hide)

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
7 years agoBug 19038: Remove the OPACShowBarcode syspref
Tomas Cohen Arazi [Fri, 4 Aug 2017 21:38:58 +0000 (18:38 -0300)]
Bug 19038: Remove the OPACShowBarcode syspref

This patch removes the OPACShowBarcode syspref in favour of the new
columns settings option introduced by bug 16759.

On the upgrade step, it picks the value for OPACShowBarcode and uses it
to populate the columns_settings table.

To test:
- Verify the upgrade process maintains the current behaviour

Regards

Sponsored-by: Dover
Followed test plan and works as expected. Functionality of patch from bug 16759
appears intact too.
Signed-off-by: Dilan Johnpullé <dilan@calyx.net.au>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
7 years agoBug 19529: Prevent NoIssuesChargeGuarantees.t to fail randomly
Jonathan Druart [Wed, 25 Oct 2017 16:16:53 +0000 (13:16 -0300)]
Bug 19529: Prevent NoIssuesChargeGuarantees.t to fail randomly

Use a categorycode != "X"

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
7 years agoBug 17381: DBRev 17.06.00.021
Jonathan Druart [Wed, 25 Oct 2017 15:07:44 +0000 (12:07 -0300)]
Bug 17381: DBRev 17.06.00.021

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
7 years agoBug 17381: Add system preference SCOMainUserBlock
Marc Véron [Mon, 21 Aug 2017 13:27:20 +0000 (15:27 +0200)]
Bug 17381: Add system preference SCOMainUserBlock

This patch adds a system preference SCOMainUserBlock to display custom HTML
on the self checkout page.

To test:
- Set up self checkout (see section Self Checkout in Circulaton sysprefs )
- Apply patch
- Update db
- Add some HTML system preference SCOMainUserBlock
- Go to sco page
- Verify that HTML displays on page (logged in and not logged in)

New version based on Koha.Preference TT plugin as of comment #7
Depends on Bug 12691

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
7 years agoBug 19028: DBRev 17.06.00.020
Jonathan Druart [Tue, 24 Oct 2017 17:57:54 +0000 (14:57 -0300)]
Bug 19028: DBRev 17.06.00.020

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
7 years agoBug 19028: Add a note to the pref description
Jonathan Druart [Wed, 25 Oct 2017 14:56:31 +0000 (11:56 -0300)]
Bug 19028: Add a note to the pref description

The idea was to keep the current behaviour, plus adding the option to
display on a separate column.
We need an explanation on the syspref description, stating that it is not enough to
choose 'on a separate column', enabling the colum in the columns
settings is required for it to take effect.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
7 years agoBug 19028: Add 'shelving location' to holdings table in detail page
Tomas Cohen Arazi [Thu, 3 Aug 2017 15:55:07 +0000 (12:55 -0300)]
Bug 19028: Add 'shelving location' to holdings table in detail page

This patch adds the option to show shelving locations on a separate
column. This is controlled by a new syspref, 'OpacLocationOnDetail',
which replaces 'OpacLocationBranchToDisplayShelving', adding a
conveniente 'column' option.

The new 'Shelving location' column is conveniently added to the columns
configuration entry added by bug 16759 for this purpose.

The current behaviour is preserved.

To test:
- Apply this patches
- Run the upgrade:
  $ sudo koha-shell kohadev
 k$ cd kohaclone
 k$ perl installer/data/mysql/updatedatabase.pl
=> SUCCESS: Upgrade doesn't fail
- Have an item with shelving location set to something not void
- Have the item set home and holding libraries for testing purposes.
- Set 'OpacLocationBranchToDisplay' to 'home and holding libraries' [*]
- Visit the OPAC detail page for the record containing the item
=> SUCCESS: Both home and holding libraries are displayed.
- Loop through all OpacLocationOnDetail options (except from 'column', we leave it for later).
=> SUCCESS: Works as expected.
- Go to Administration > Columns settings
- Make item_shelving_location available in the OPAC section
- Reload the OPAC detail page
=> SUCCESS: No change
- Set OpacLocationOnDetail to 'on a separate column'
- Reload the OPAC detail page
=> SUCCESS: Shelving location is displayed on a separate column
- Sign off :-D

Sponsored-by: Dover
[*] For testing purposes

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
7 years agoBug 19028: Add OpacLocationOnDetail syspref
Tomas Cohen Arazi [Thu, 3 Aug 2017 15:52:52 +0000 (12:52 -0300)]
Bug 19028: Add OpacLocationOnDetail syspref

This patch renames the 'OpacLocationBranchToDisplayShelving' syspref into
'OpacLocationOnDetail' and adds it a fourth option, 'column', that makes
the OPAC display shelving location on a separate column, instead of the
library names (home, holding or both).

Sponsored-by: Dover
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
7 years agoBug 16759: Use index of elements in specific table
Nick Clemens [Wed, 25 Oct 2017 10:55:12 +0000 (10:55 +0000)]
Bug 16759: Use index of elements in specific table

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
7 years agoBug 16759: Handle the otherholdings tab gracefuly
Tomas Cohen Arazi [Tue, 24 Oct 2017 22:19:09 +0000 (19:19 -0300)]
Bug 16759: Handle the otherholdings tab gracefuly

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
7 years agoBug 16759: Make OPAC holdings table configurable
Tomas Cohen Arazi [Fri, 28 Jul 2017 19:28:08 +0000 (16:28 -0300)]
Bug 16759: Make OPAC holdings table configurable

This patch makes the holdings table in the OPAC biblio detail page
configurable using the Columns configuration tools.

This patch:
- Moves the holdingst table from plain DataTable to KohaTable
- Creates a sample yml colvis configuration for this table
  containing all the currently available columns

To test:
- Visit some record's detail page in the OPAC
- Apply this patch
- Reload
=> SUCCESS: The page shows the same information
- On the staff interface, go to:
  Home > Administration > Columns settings
=> SUCCESS: There's a new OPAC section containing the configuration for
   holdingst.
- Choose to hide some fields (both currently displayed and currently hidden).
- Reload the OPAC detail page
=> SUCCESS:
   - Required fields are hidden
   - It doesn't explode because of trying to hide stuff that is not there to start with
- Sign off :-D

Sponsored-by: DOVER
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Followed test plan, patch worked as described. Also passed QA test tool

Signed-off-by: Alex Buckley <alexbuckley@catalyst.net.nz>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
7 years agoBug 17277: Always display location and *branch item info - opac detail
Jonathan Druart [Wed, 12 Jul 2017 12:32:24 +0000 (09:32 -0300)]
Bug 17277: Always display location and *branch item info - opac detail

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
7 years agoBug 19513: Re-add AnonymousPatron-related tests
Jonathan Druart [Tue, 24 Oct 2017 17:53:36 +0000 (14:53 -0300)]
Bug 19513: Re-add AnonymousPatron-related tests

These tests are still useful

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
The AddMember call is considerably slowing it down. A call to TestBuilder
would be an improvement for performance.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
7 years agoBug 19513: More changes to MarkIssueReturned.t (after bug 19487)
Marcel de Rooy [Fri, 20 Oct 2017 07:03:35 +0000 (09:03 +0200)]
Bug 19513: More changes to MarkIssueReturned.t (after bug 19487)

This patch was initially created as QA follow-up on 19487.

$dbh is not used
$categorycode is no longer used
%item_branch_infos not used
$borrowernumber is obsoleted by using $patron
No real need for $anonymous_borrowernumber (Since MarkIssueReturned returns
undef rightaway for an invalid itemnumber, the privacy stuff is irrelevant.)
No AddMember calls, removing unneeded modules

Adding a test that calls MarkIssueReturned on an item already returned.

Test plan:
[1] Run t/db_dependent/Circulation/MarkIssueReturned.t

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
7 years agoBug 18735: QA Followup - add class to new option
Nick Clemens [Tue, 24 Oct 2017 12:12:52 +0000 (12:12 +0000)]
Bug 18735: QA Followup - add class to new option

New option creates a single item batch, this may cause issues for some
libraries or they may want to disbale this feature. Adding a class to
the list item allows it to be hidden easily

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
7 years agoBug 18735: Print Barcode as soon as adding an item
Nazlı [Thu, 29 Jun 2017 13:24:21 +0000 (16:24 +0300)]
Bug 18735: Print Barcode as soon as adding an item

For testing
1) Look for any records.
2) Go to the material edit page.
3) Under Actions you will see Print label under Duplicate.
4) When you click Print Label, the relevant material will be redirected
to the Label Creator module in the Tools menu.

Signed-off-by: Alex Buckley <alexbuckley@catalyst.net.nz>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
7 years agoBug 18949: Adding thead tags to OPAC MARC details holdings table
Aleisha Amohia [Mon, 17 Jul 2017 22:22:55 +0000 (22:22 +0000)]
Bug 18949: Adding thead tags to OPAC MARC details holdings table

So that it can be styled alongside other tables in the OPAC.

To test:
1) Log into staff side
2) Find OPACUserCSS syspref and add the following CSS:
th,
.table-bordered>thead>tr:first-child>th {
color: red;
}
3) Log into the OPAC
4) Go to your fines, your search history, your reading history etc -
notice all of these table's headings are styled with red text
5) Go to the detail page of an item, then the MARC view.
Notice this table's headings are now styled with red text
6) Apply patch and refresh page
7) Your holdings table should now have red headings.
(You can delete the CSS from OPACUserCSS if you'd like.)

Sponsored-by: Catalyst IT
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
7 years agoBug 18184: Show frequency and numbering pattern info when viewing all subs attached...
Aleisha Amohia [Tue, 4 Apr 2017 23:51:16 +0000 (23:51 +0000)]
Bug 18184: Show frequency and numbering pattern info when viewing all subs attached to a biblio

To test:
1) Go to Serials, find a serial with more than one subscription
2) Click Serial collection
3) Notice how Frequency and Numbering pattern are filled out correctly
4) Click 'see any sub attached to this biblio'
5) Notice how Frequency and Numbering pattern are now missing info
6) Apply patch and refresh page
7) Confirm Frequency and Numbering pattern now show as expected

Sponsored-by: Catalyst IT
Signed-off-by: sonia BOUIS <sonia.bouis@univ-lyon3.fr>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
7 years agoBug 19298: Placing a hold from a list at the OPAC should respect issuing rules
Jonathan Druart [Tue, 12 Sep 2017 16:03:04 +0000 (13:03 -0300)]
Bug 19298: Placing a hold from a list at the OPAC should respect issuing rules

The issuing rule retrieve to know if a hold can be placed on a record of
a list is not correct.

Test plan:
0/ With item-level_itypes = item level
1/ Define a item.itype=BK and biblioitems.itemtype=CF
2/ Create a default rule to allow on shelf holds
3/ Create a specific rule for CF with on shelf holds="If any
unavailable"
4/ Add this bibliographic record to a list and view the list
=> Without this patch you will not see "Place hold"
=> With this patch applied you will see the "Place hold" button,
respecting the correct issuing rule

Followed test plan, patches worked as described.

Note: Just to clarify the test plan slightly in step 4 where it says you will not see 'Place Hold' it means to
the left of the 'Save to another List' link below the item availability
in the opac-shelves.pl page. Not the 'Place hold' button in the grey
page header box.

Signed-off-by: Alex Buckley <alexbuckley@catalyst.net.nz>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
7 years agoBug 19431: Fix error when checking out an unknown barcode
Jonathan Druart [Mon, 9 Oct 2017 22:17:45 +0000 (19:17 -0300)]
Bug 19431: Fix error when checking out an unknown barcode

It seems this has been caused by
  commit 1544f9a5d4a8acd47c97d7c6ac55dee8e759d3ff
    Bug 18276: Remove GetBiblioFromItemNumber - circulation pages

To reproduce the problem you need switch on the two prefs
 - OnSiteCheckouts
 - OnSiteCheckoutsForce

Test plan:
Try to check an item out using an unknown barcode
With the 2 prefs set to on and without this patch, you will get the
following error in the log

  Can't call method "materials" on an undefined value at
  /home/vagrant/kohaclone/circ/circulation.pl line 387.

With this patch applied you should not get this error and a correct
behaviour for the different pref combinations.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
7 years agoBug 19495: Automatic report conversion needs to do global replace on 'biblioitems...
Kyle M Hall [Fri, 20 Oct 2017 14:49:38 +0000 (10:49 -0400)]
Bug 19495: Automatic report conversion needs to do global replace on 'biblioitems' and 'marcxml'

Bug 17898 provides a way of converting reports that use biblioitems.marcxml so that they will use biblio_metadata.metadata instead.

This only works with reports that do not refer to other columns in the biblioitems table. This is a known limitation. It means that we should be able to do a substitution of every occurrence of biblioitems with biblio_metadata, and every occurrence of marcxml with metadata.

Unfortunately, we're not doing a global replace, we're only replacing the first occurrence.

Test Plan:
1) Apply this patch
2) prove t/db_dependent/Reports/Guided.t

All tests successful.
Files=1, Tests=9, 10 wallclock secs ( 0.11 usr  0.01 sys +  2.85 cusr  0.25 csys =  3.22 CPU)
Result: PASS

Signed-off-by: Dominic Pichette <dominic@inlibro.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
7 years agoBug 12768: Fix bad merge resolution conflict
Jonathan Druart [Mon, 23 Oct 2017 19:59:11 +0000 (16:59 -0300)]
Bug 12768: Fix bad merge resolution conflict

RM note:
I have applied
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=68427
on top of other patches that were already pushed.
But it was supposed to replace them, this change revert what was in
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=68417

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
7 years agoBug 12768: (QA follow-up) Don't use manualinvoice for non-manual invoices in chargelo...
Kyle M Hall [Mon, 23 Oct 2017 16:51:50 +0000 (12:51 -0400)]
Bug 12768: (QA follow-up) Don't use manualinvoice for non-manual invoices in chargelostitem

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
7 years agoBug 19517: Prevent dateexpiry.t to fail randomly
Jonathan Druart [Mon, 23 Oct 2017 16:19:42 +0000 (13:19 -0300)]
Bug 19517: Prevent dateexpiry.t to fail randomly

If categorycode is 'X', the test will fail

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
7 years agoBug 12768: DBRev 17.06.00.019
Jonathan Druart [Mon, 23 Oct 2017 15:34:25 +0000 (12:34 -0300)]
Bug 12768: DBRev 17.06.00.019

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
7 years agoBug 12768: (QA follow-up) Use specific account offset types for Processing Fee and...
Kyle M Hall [Mon, 23 Oct 2017 15:01:25 +0000 (11:01 -0400)]
Bug 12768: (QA follow-up) Use specific account offset types for Processing Fee and Lost Item

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
7 years agoBug 12768: Fix tests - itemtypes.rentalcharge is now decimal(28,6)
Jonathan Druart [Mon, 23 Oct 2017 15:05:04 +0000 (12:05 -0300)]
Bug 12768: Fix tests - itemtypes.rentalcharge is now decimal(28,6)

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
7 years agoBug 14826: (QA follow-up) Remove obsolete DBIx schema file
Marcel de Rooy [Mon, 23 Oct 2017 10:49:20 +0000 (12:49 +0200)]
Bug 14826: (QA follow-up) Remove obsolete DBIx schema file

Removes Accountoffset.pm.
Has been replaced by AccountOffset.pm on bug 14826.

Test plan:
Run TestBuilder.t. Should pass now again.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
7 years agoBug 14826: account_offset_types.sql is not in the mandatory subdir
Jonathan Druart [Fri, 20 Oct 2017 21:14:06 +0000 (18:14 -0300)]
Bug 14826: account_offset_types.sql is not in the mandatory subdir

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
7 years agoBug 12768: DBRev 17.06.00.018
Jonathan Druart [Fri, 20 Oct 2017 20:02:31 +0000 (17:02 -0300)]
Bug 12768: DBRev 17.06.00.018

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
7 years agoBug 12768: (follow-up) Add 'Processing fee' to templates
Jonathan Druart [Fri, 20 Oct 2017 19:35:03 +0000 (16:35 -0300)]
Bug 12768: (follow-up) Add 'Processing fee' to templates

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
7 years agoBug 12768: (QA follow-up) Fix doubled code
Nick Clemens [Wed, 18 Oct 2017 15:47:30 +0000 (15:47 +0000)]
Bug 12768: (QA follow-up) Fix doubled code

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
7 years agoBug 12768: (QA follow-up) Add 'Processing fee' to templates
Kyle M Hall [Fri, 13 Oct 2017 14:02:41 +0000 (10:02 -0400)]
Bug 12768: (QA follow-up) Add 'Processing fee' to templates

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
7 years agoBug 12768: Fix up unit tests a bit more
Kyle M Hall [Thu, 12 Oct 2017 16:44:49 +0000 (12:44 -0400)]
Bug 12768: Fix up unit tests a bit more

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
7 years agoBug 12768: DBIC Schema changes
Jonathan Druart [Tue, 10 Oct 2017 20:32:59 +0000 (17:32 -0300)]
Bug 12768: DBIC Schema changes

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
7 years agoBug 12768: Fix YAML syntax in circulation.pref
Jonathan Druart [Tue, 10 Oct 2017 20:29:00 +0000 (17:29 -0300)]
Bug 12768: Fix YAML syntax in circulation.pref

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
7 years agoBug 12768: Add missing IGNORE clauses
Jonathan Druart [Tue, 10 Oct 2017 20:01:56 +0000 (17:01 -0300)]
Bug 12768: Add missing IGNORE clauses

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
7 years agoBug 12768: Revert changes to getcharges
Kyle M Hall [Tue, 10 Oct 2017 14:40:19 +0000 (10:40 -0400)]
Bug 12768: Revert changes to getcharges

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
7 years agoBug 12768: Fix up unit tests
Kyle M Hall [Tue, 10 Oct 2017 14:34:22 +0000 (10:34 -0400)]
Bug 12768: Fix up unit tests

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
7 years agoBug 12768: Replacement cost and processing fee management
charles [Wed, 22 Apr 2015 19:54:04 +0000 (15:54 -0400)]
Bug 12768: Replacement cost and processing fee management

Signed-off-by: Eivin Giske Skaaren <eivin@sysmystic.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
7 years agoBug 12768: DB changes
charles [Wed, 22 Apr 2015 20:03:54 +0000 (16:03 -0400)]
Bug 12768: DB changes

Signed-off-by: Eivin Giske Skaaren <eivin@sysmystic.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
7 years agoBug 14826: DBRev 17.06.00.017
Jonathan Druart [Fri, 20 Oct 2017 20:06:49 +0000 (17:06 -0300)]
Bug 14826: DBRev 17.06.00.017

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
7 years agoBug 14826: DBIC Schema changes
Jonathan Druart [Fri, 20 Oct 2017 19:28:52 +0000 (16:28 -0300)]
Bug 14826: DBIC Schema changes

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
7 years agoBug 14826: (QA follow-up) Make db update idempotent
Kyle M Hall [Thu, 12 Oct 2017 16:00:48 +0000 (12:00 -0400)]
Bug 14826: (QA follow-up) Make db update idempotent

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
7 years agoBug 14826: (QA follow-up) POD fixes
Tomas Cohen Arazi [Fri, 29 Sep 2017 13:55:39 +0000 (10:55 -0300)]
Bug 14826: (QA follow-up) POD fixes

This patch just fixes POD. There are still some false positives with the
QA scripts.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
7 years agoBug 14826: Add account offset type table
Kyle M Hall [Fri, 1 Sep 2017 11:51:49 +0000 (07:51 -0400)]
Bug 14826: Add account offset type table

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
7 years agoBug 14826: (QA follow-up) Only use plural modules in other modules
Kyle M Hall [Tue, 8 Aug 2017 14:04:31 +0000 (10:04 -0400)]
Bug 14826: (QA follow-up) Only use plural modules in other modules

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
7 years agoBug 14826: Add unit tests for _FixAccountForLostAndReturned and _FixOverduesOnReturn
Kyle M Hall [Tue, 6 Jun 2017 13:33:46 +0000 (09:33 -0400)]
Bug 14826: Add unit tests for _FixAccountForLostAndReturned and _FixOverduesOnReturn

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Bug 14826: (QA followup) Fix minor issues with unit tests

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Bug 14826 [QA Followup] - Correct number of tests run following rebase

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
7 years agoBug 14826: Add offset for rental fees
Kyle M Hall [Wed, 15 Feb 2017 16:24:57 +0000 (16:24 +0000)]
Bug 14826: Add offset for rental fees

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
7 years agoBug 14826: Unit Tests
Kyle M Hall [Thu, 21 Jul 2016 18:32:05 +0000 (18:32 +0000)]
Bug 14826: Unit Tests

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
7 years agoBug 14826: Resurrect account offsets table
Kyle M Hall [Tue, 12 Jul 2016 14:48:03 +0000 (14:48 +0000)]
Bug 14826: Resurrect account offsets table

The account offsets table should be used to track increments and
decrements of fines via payments and credits, as well as fine accruals.
It should be able to match fees to payments and visa versa, so we can
know which fee was paid by a given payment, and which payments applied
to a given fee.

Test Plan:
1) Apply this patch
2) Run updatedatabase
3) Note the table accountoffsets has been renamed to account_offsets
4) Ensure fine generation creates offsets
5) Ensure creating a manual invoice creates an offset
6) Ensure a lost item charge creates an offset
7) Ensure Reverse Payment creates an offset
8) Ensure a payment creates an offset
9) Ensure a payment for multiple fees creates an offset for each
10) Ensure writeoffs create offsets

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
7 years agoBug 14826: Add Koha::Account::Offset(s) modules
Kyle M Hall [Tue, 12 Jul 2016 14:13:04 +0000 (14:13 +0000)]
Bug 14826: Add Koha::Account::Offset(s) modules

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
7 years agoBug 14826: Update database
Kyle M Hall [Tue, 12 Jul 2016 13:50:11 +0000 (13:50 +0000)]
Bug 14826: Update database

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
7 years agoBug 19356: Move staff client cart JavaScript to the footer
Owen Leonard [Mon, 9 Jan 2017 16:31:19 +0000 (16:31 +0000)]
Bug 19356: Move staff client cart JavaScript to the footer

This patch modifies the staff client cart template so that
JavaScript is included in the footer instead of the header.

To test, apply the patch and test the JavaScript-driven features of the
cart: All button controls, DataTables functionality.

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
Correction for QA: Removed contditional around footer JS (from
copy-paste) because it will always be true.

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
7 years agoBug 19348: Title column in item search is too narrow
Owen Leonard [Wed, 20 Sep 2017 13:21:27 +0000 (13:21 +0000)]
Bug 19348: Title column in item search is too narrow

This patch adds IDs to the item search results table header so that
columns can be targeted by CSS or JS. The CSS for the item search page
has been modified to give the title column a minimum width.

To test, apply the patch and clear your browser cache if necessary.
Perform an item search and confirm that the title column stays at a
reasonable width.

Signed-off-by: Dominic Pichette <dominic@inlibro.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
7 years agoBug 16187: accept --verbose and -h
Jonathan Druart [Fri, 20 Oct 2017 19:15:46 +0000 (16:15 -0300)]
Bug 16187: accept --verbose and -h

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
7 years agoBug 16187: Do not use DateTime directly
Jonathan Druart [Fri, 20 Oct 2017 19:04:04 +0000 (16:04 -0300)]
Bug 16187: Do not use DateTime directly

Koha::DateUtils takes care of what you need

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
7 years agoBug 16187: (QA follow-up) Additional fixes
Marcel de Rooy [Fri, 20 Oct 2017 06:11:38 +0000 (08:11 +0200)]
Bug 16187: (QA follow-up) Additional fixes

Fix:
Can't locate object method "next" via package "13" (perhaps you forgot to load "13"?) at misc/cronjobs/holds/cancel_unfilled_holds.pl line 119.
Undefined subroutine &main::CancelReserve called at misc/cronjobs/holds/cancel_unfilled_holds.pl line 143.

The script does not use Koha::Object's get_column correctly for getting
the branch codes.
The call to CancelReserve is obsolete. Was moved in the meantime to
Koha::Hold->cancel.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
7 years agoBug 16187: Add a script to cancel unfilled holds after a specified number of days
Nick Clemens [Thu, 14 Jul 2016 10:46:15 +0000 (06:46 -0400)]
Bug 16187: Add a script to cancel unfilled holds after a specified number of days

This script takes parameters:
days - how many days waiting to concal an unfilled hold on or after
library - (repeatable) branches to consider
holidays - whether or not to count holidays (default is no)

This patchset adds two methods and covers them with tests:
Koha::Holds->unfilled(); To return holds where found = undef
Koha::Hold->age( $use_calendar ); To return the number of days since a
hold was placed (including or excluding holidays)

To test:
1 - Place some holds with varying reservedates
2 - Run script with different parameters to verify options are respected
(-v for verbosity will assist here)
3 - verify that script does nothing without days parameter

Sponsored by:
    Siskiyou County Library (http://www.siskiyoulibrary.info/)

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Bug 16187 - Followup

1 - Correct use of original (bad) script name
2 - Explain options better
3 - Remove change from 'W' to 'w'

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
RM note: Squashed for readability

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
7 years agoBug 18961: Use exact match for select filters on item search
Jonathan Druart [Tue, 10 Oct 2017 15:18:10 +0000 (12:18 -0300)]
Bug 18961: Use exact match for select filters on item search

The SQL operator LIKE is always used for filters when searching for
items.

If the filter is a select, we should search for an exact match.
That way we avoid problematic search like "%NFIC%" and "%FIC%" (one
includes the other one).

Test plan:
- Make sure you have collection codes 'Fiction' and 'Non-fiction'
- Do an item search
- Filter column 'Collection', select 'Fiction'
- Result: Column contains items from Fiction only

Followed test plan, works as expected.
Signed-off-by: Marc Véron <veron@veron.ch>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
7 years agoBug 18564: Improve koha-common.cnf parsing to pick the mysql host
Eric Vantillard [Tue, 9 May 2017 21:10:21 +0000 (23:10 +0200)]
Bug 18564: Improve koha-common.cnf parsing to pick the mysql host

my koha-common.cnf is using this form:

[client]
host=db
user=root
password="move_rootpwd_to_dotenv"

this file is working has expected with mysql tools.

but koha-create parsing will not find the db host resulting in
koha-conf.xml containing no values in hostname element.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
7 years agoBug 19487: Refetch the object to get up-to-date values
Jonathan Druart [Fri, 20 Oct 2017 18:56:20 +0000 (15:56 -0300)]
Bug 19487: Refetch the object to get up-to-date values

This has been raised by failures on t/db_dependent/Circulation/issue.t
(thanks tests!)

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
7 years agoBug 19487: Fix MarkIssueReturned.t
Jonathan Druart [Thu, 19 Oct 2017 12:02:20 +0000 (09:02 -0300)]
Bug 19487: Fix MarkIssueReturned.t

MarkIssueReturned must now return directly if the issue does not exist.
We then check if the anonymous patron configuration is correct.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
7 years agoBug 19487: Do not return an item if not checked out
Jonathan Druart [Wed, 18 Oct 2017 16:59:56 +0000 (13:59 -0300)]
Bug 19487: Do not return an item if not checked out

To recreate:
1 - Manually add a lost fine to a ptron and include a barcode
2 - Attempt to write off the fine
3 - Internal server error
4 - Checkout an item and mark lost to checkin and fine
5 - Attempt to write off line
6 - Internal server error

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
7 years agoBug 19296: (QA follow-up) Correct comment in populate_orders
Marcel de Rooy [Fri, 13 Oct 2017 07:03:25 +0000 (09:03 +0200)]
Bug 19296: (QA follow-up) Correct comment in populate_orders

Just replacing a wrong - by a correct + sign in the comment. The code
itself is fine.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
7 years agoBug 19296: Allow all tax processing to happen in C4::Acquisition::populate_order_with...
Nick Clemens [Tue, 12 Sep 2017 16:57:47 +0000 (16:57 +0000)]
Bug 19296: Allow all tax processing to happen in C4::Acquisition::populate_order_with_prices

To test:
 1 - Create an order file that includes prices and items
(MarcFieldsToOrder)
 2 - Stage the file
 3 - Set vendor to 'prices exclude tax'
 4 - Open a basket and add from the file
 5 - View the items in the basket
 6 - Prices are reduced by the tax rate and tax is calculated to return
prices to the value in the file
 7 - Apply patch
 8 - Repeat steps 1-6
 9 - Prices should now calculate correctly
10 - Repeat with 'MarcItemFieldsToOrder'

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>
7 years agoBug 19463: (follow-up) Cosmetic changes
Marcel de Rooy [Wed, 18 Oct 2017 11:59:06 +0000 (13:59 +0200)]
Bug 19463: (follow-up) Cosmetic changes

String::Random version 0.26 (on Jessie) does not yet support the rand_gen
parameter (0.27 does, newest is 0.29 on CPAN now).
So alt_rand is only used in determining the size on Jessie.
That might be enough though.
Adding a documention line in this regard.

Removing the obsolete max parameter.

Note: I timed alt_rand for the creation of a new Bytes::Random::Secure
object each time. But each call is about 0.1 milliseconds. So that
should be fine.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
7 years agoBug 18298: Fix selenium tests
Jonathan Druart [Tue, 17 Oct 2017 15:40:45 +0000 (12:40 -0300)]
Bug 18298: Fix selenium tests

The password has to be better than "password"...

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
7 years agoBug 19463: Additional changes to gen_text
Marcel de Rooy [Tue, 17 Oct 2017 14:57:16 +0000 (16:57 +0200)]
Bug 19463: Additional changes to gen_text

Use Bytes::Random::Secure instead of perl rand.
Return a string from 50 to 100% of $size.

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