]> git.koha-community.org Git - koha.git/log
koha.git
5 years agoBug 22709: (follow-up) Mock enable_plugins config entry
Tomas Cohen Arazi [Tue, 2 Jul 2019 13:07:27 +0000 (10:07 -0300)]
Bug 22709: (follow-up) Mock enable_plugins config entry

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 22709: Add after biblio/item action hooks
Tomas Cohen Arazi [Fri, 21 Jun 2019 20:10:23 +0000 (17:10 -0300)]
Bug 22709: Add after biblio/item action hooks

This patch introduces after-action hooks for
- C4::Biblio::{Add|Mod|Del}Biblio
- C4::Items::{Add|Mod|Del}Biblio

After the action has taken place, a call to a helper method is done,
which loops through all plugins implementing the hooks, and calls the
plugin method. The related object is passed, along with an 'action'
string specifying the action that took place, and the object id (which
is specially important for the 'Del' case).

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

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 22709: Unit tests
Tomas Cohen Arazi [Fri, 21 Jun 2019 20:09:56 +0000 (17:09 -0300)]
Bug 22709: Unit tests

This patch introduces tests for new plugin hooks added to
C4::Biblio::{Add|Mod|Del}Biblio and C4::Items::{Add|Mod|Del}Item.

They are tested together as for creating an item you need to first create
a biblio and tests looks basically the same.

The testing strategy is
- Make sure the plugin is passed the right params
- Throw an exception at plugin-level, to be trapped by the C4::Biblio
and C4::Items lib, and converted into a warning. So we test for the
warning.
- Also, the fact that C4::Biblio and C4::Items warns, means the
exception was cought, and then Koha won't break on faulty plugins or
fatal errors from plugins.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 22999: (follow-up) Indentation updates
Owen Leonard [Tue, 2 Jul 2019 12:29:08 +0000 (12:29 +0000)]
Bug 22999: (follow-up) Indentation updates

The markup changes require indentation updates. This patch contains
indentation changes only.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 22999: Switch two-column templates to Bootstrap grid: Circulation
Owen Leonard [Fri, 28 Jun 2019 16:27:16 +0000 (16:27 +0000)]
Bug 22999: Switch two-column templates to Bootstrap grid: Circulation

This patch modifies the circulation page template to use the Bootstrap
grid instead of YUI.

To test, apply the patch and view the checkout page, confirming that
it looks correct at various browser widths:

 - Check out (no patron)
 - Check out -> Patron search
   - Results
   - No results
 - Check out -> Patron selected
   - Can check out
     - Checkout blocked (renewal confirmation, item on hold, etc)
   - Can't check out (expired, restricted)

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 23250: Just use an @ in the password
Mark Tompsett [Thu, 4 Jul 2019 00:29:01 +0000 (00:29 +0000)]
Bug 23250: Just use an @ in the password

Rather than try to use -y and symbols, since
older versions of pwgen don't have the -y,
Purposefully just shorten the generated
password to 15 characters and put @ on the end.
This avoids nasty shell globbing, fixes the
MySQL requiring a symbol by default in the
newer versions.

While @ at the end is less secure, the
password portion providing security is
still 15 characters long.

Before patch, password should have potentially
multiple ugly symbols in it.
After patch, when creating an instance, the
password will have an @ at the end of it.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 23255: Correct HomeOrHoldingBranch descriptions
Nick Clemens [Tue, 2 Jul 2019 16:10:10 +0000 (16:10 +0000)]
Bug 23255: Correct HomeOrHoldingBranch descriptions

To test:
1 - Apply patch
2 - View 'HomeOrHoldingBranch' system preference
3 - Confirm the options make sense

Signed-off-by: Claire Gravely <claire.gravely@bsz-bw.de>
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 14419: (QA follow-up) Restore the link styling
Josef Moravec [Wed, 3 Jul 2019 20:56:56 +0000 (20:56 +0000)]
Bug 14419: (QA follow-up) Restore the link styling

Test plan:
Look at Show more/less links in facets, in opac and staff client
--> without this patch they are pure text, no styling, no hand cursor
--> with this patch it is link, but continues to work as before

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 14419: Expanding facets (Show more) performs a new search
Nick Clemens [Tue, 2 Jul 2019 11:58:49 +0000 (11:58 +0000)]
Bug 14419: Expanding facets (Show more) performs a new search

This patch removes the constraint of only passing 5 facets to the template unless the list is expanded, in fact, it removes the 'expanded' attribute from Search.pm
Now that all facets are passed to page it adds a 'show more' link at the bottom of lists and allows user to expand or collapse any facet set without reloading page.

Updated tests included.

To test:
1  - Perform an OPAC search that returns more than 5 of any given facet type
2  - Click the "Show more" link on the facets and see that the search is reloaded
3  - Apply patch
4  - Repeat search
5  - Note that you can click "Show more" without reloading page
6  - Test that page load is not greatly affected
7  - Ensure that all facet links function normally
8  - Ensure that facets are the same a prior to patch
9  - Repeat for staff client
10 - Prove t/Search.t

NOTE: This patch makes it much easier to see that there is an existing issue with marking the "active" facet.  Ending punctuation seems to confuse the matcher.

Signed-off-by: Michal Denar <black23@gmail.com>
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 23230: (follow-up) Fix broken tests
Mark Tompsett [Wed, 3 Jul 2019 02:35:16 +0000 (02:35 +0000)]
Bug 23230: (follow-up) Fix broken tests

Before patch, the new tests don't run.
After patch, they do.

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 23230: Make _version_compare OO context aware
Tomas Cohen Arazi [Mon, 1 Jul 2019 14:42:51 +0000 (11:42 -0300)]
Bug 23230: Make _version_compare OO context aware

On using _version_compare in plugins development, it would be nice if it
was able to be called as an object method. This way we don't need to
fully qualify it like this:

    Koha::Plugins::Base::_version_compare

and we can do

    $self->_version_compare

instead.

This patch implements this behavior change. It is backwards compatible
so plugins using the 'old way' don't break.

To test:
- Apply the unit tests patch
- Run:
  $ kshell
 k$ prove t/db_dependent/Plugins.t
=> FAIL: Tests fail
- Apply this patch
- Run:
 k$ prove t/db_dependent/Plugins.t
=> SUCCESS: Tests pass!
- Sign off :-D

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 23230: Unit tests
Tomas Cohen Arazi [Mon, 1 Jul 2019 14:33:41 +0000 (11:33 -0300)]
Bug 23230: Unit tests

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 20959: (RM follow-up) Fix selenium test
Martin Renvoize [Tue, 2 Jul 2019 16:08:10 +0000 (17:08 +0100)]
Bug 20959: (RM follow-up) Fix selenium test

The basic_workflow test started to fail with this bug as the xpath for
the checking button changed. I have updated the test to reflect the
change.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 22897: Switch two-column templates to Bootstrap grid: ILL requests
Owen Leonard [Mon, 13 May 2019 16:22:49 +0000 (16:22 +0000)]
Bug 22897: Switch two-column templates to Bootstrap grid: ILL requests

This patch modifies the ILL requests template to use the Bootstrap grid
instead of YUI.

To test, apply the patch and look at the ILL requests template. Confirm
that it looks correct at various browser widths.

Signed-off-by: Andrew Isherwood <andrew.isherwood@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 20959: Compiled CSS
Martin Renvoize [Tue, 2 Jul 2019 08:19:28 +0000 (09:19 +0100)]
Bug 20959: Compiled CSS

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 20959: Style checkin form more like the checkout form, with collapsed settings...
Owen Leonard [Thu, 27 Jun 2019 18:11:51 +0000 (18:11 +0000)]
Bug 20959: Style checkin form more like the checkout form, with collapsed settings panel

This patch modifies the structure of the checkin form so that settings
(Specify return date, book drop mode, forgive overdue charges) are in a
collapsed panel when inactive. The style of the barcode field and the
mode notification messages has been changed to reduce the vertical
motion of the form when selecting options.

Some class names have been changed in circulation.tt and circulation.js
to make them appropriate for use on both forms.

To test, apply the patch and rebuild the staff client CSS
(https://wiki.koha-community.org/wiki/Working_with_SCSS_in_the_OPAC_and_staff_client).
Clear your browser cache if necessary.

 - View the checkin page. The "checkin settings" panel should be
   collapsed by default.
 - Confirm that the settings panel collapses and expands as it should.
 - Confirm that selecting "Forgive overdue charges" or "Book drop mode"
   trigger the display of the correct message and that the style of the
   barcode field is changed.
 - Confirm that after submitting a barcode for check-in, the
   settings panel stays open and your selected settings are still
   selected.
 - Confirm that specifying a due date and selecting "remember" shows
   a new message with the selected date.
   - Confirm that unchecking "remember" hides the message.
   - Confirm that date settings are remembered and the correct message
     displayed (or not) during check-in.
 - Test with CircSidebar enabled and disabled.

Signed-off-by: Arthur Bousquet <arthur.bousquet@inlibro.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 23222: Update plugins-home.tt with new ENABLE/DISABLE flag name
Agustin Moyano [Wed, 26 Jun 2019 19:15:43 +0000 (16:15 -0300)]
Bug 23222: Update plugins-home.tt with new ENABLE/DISABLE flag name

At some point of history, the flag to indicate if a plugin was enabled/disabled was called "enabled", now it's called "is_enabled"

To test:
1) get a fresh master copy
2) Enable plugins
3) Install any plugin
CHECK => plugin appears as disabled
      => If you try to enable it, it just appears as disabled just the same
4) Apply this patch
5) Reload page
SUCCESS => plugin appears as enabled
        => enable / disable action works again
6) Sign off

Signed-off-by: Frédéric Demians <f.demians@tamil.fr>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 23058: Prevent XSS vulnerabiliies when 'tag' is passed to opac-search
Jonathan Druart [Wed, 5 Jun 2019 23:40:54 +0000 (18:40 -0500)]
Bug 23058: Prevent XSS vulnerabiliies when 'tag' is passed to opac-search

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 17003: (QA follow-up) Fix the number of tests
Kyle M Hall [Fri, 28 Jun 2019 15:27:27 +0000 (15:27 +0000)]
Bug 17003: (QA follow-up) Fix the number of tests

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 17003: (follow-up) Update definitions according to voted RFC
Josef Moravec [Fri, 29 Mar 2019 07:53:27 +0000 (07:53 +0000)]
Bug 17003: (follow-up) Update definitions according to voted RFC

Test plan:
1) Have some patrons with checkouts, some renewable and some not
renewable
2) Use your favorite API tester and access GET
http://koha.url/api/v1/checkouts/{checkout_id}/allows_renewal
3) Check the response is OK according to voted RFC:
https://wiki.koha-community.org/wiki/Checkouts_endpoint_RFC#Checkout_renewability_2
4) prove t/db_dependent/api/v1/checkouts.t

Signed-off-by: Michal Denar <black23@gmail.com>
Signed-off-by: Johanna Raisa <johanna.raisa@gmail.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 17003: Adapt to OpenAPI
Josef Moravec [Thu, 21 Feb 2019 02:30:00 +0000 (02:30 +0000)]
Bug 17003: Adapt to OpenAPI

Test plan:
prove t/db_dependent/api/v1/checkouts.t

Signed-off-by: Michal Denar <black23@gmail.com>
Signed-off-by: Johanna Raisa <johanna.raisa@gmail.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 17003: Add API route to get checkout's renewability
Lari Taskula [Mon, 22 Aug 2016 14:35:44 +0000 (17:35 +0300)]
Bug 17003: Add API route to get checkout's renewability

Signed-off-by: Johanna Raisa <johanna.raisa@gmail.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 17492: (RM follow-up) Use more specific method name
Martin Renvoize [Mon, 1 Jul 2019 15:06:42 +0000 (16:06 +0100)]
Bug 17492: (RM follow-up) Use more specific method name

Changed the method introduced into Koha::Patron from is_category_valid
to the more specific is_valid_age to clarify it's intent to future
developers.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 17492: (QA follow-up) Correct template variable
Nick Clemens [Fri, 28 Jun 2019 15:15:06 +0000 (15:15 +0000)]
Bug 17492: (QA follow-up) Correct template variable

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 17492: (follow-up) Add missing filters
Josef Moravec [Wed, 26 Jun 2019 18:31:44 +0000 (18:31 +0000)]
Bug 17492: (follow-up) Add missing filters

Signed-off-by: Michal Denar <black23@gmail.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 17492: Add a warning about age being of-limits and a button to update it
Radek Šiman [Mon, 24 Oct 2016 01:41:02 +0000 (03:41 +0200)]
Bug 17492: Add a warning about age being of-limits and a button to update it

This patch adds a warning if a patron's age is out of limits if an assigned category.
It also adds a button allowing to change the category.

Test plan:
1) Apply patch
2) Create a patron and assign him a category having age limits set
3) Change patron's age to be older/younger than category's limits
4) At "Check out" and "Details" tabs you should see a warning with a
button allowing to change the category, eg.:
 - http://prntscr.com/cz7ch3
 - http://prntscr.com/cz7em4
 - http://prntscr.com/cz7dj1
5) Set a valid category according to patron's age
6) Warning should disappear
7) Perform similar test again, but instead of changing the age change
the limits of a category
8) During tests verify "Change category" button everytime opens "Modify
patron" page:
  http://prntscr.com/cz7g5q
9) Ensure that left-side panel is always on its expected place
10) Remove patron's date of birth and test that all categories are
allowed now
11) Run automated tests: prove t/db_dependent/Koha/Patron.t

Signed-off-by: Marc Véron <veron@veron.ch>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Michal Denar <black23@gmail.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 18928: DBRev 19.06.00.010
Martin Renvoize [Mon, 1 Jul 2019 14:17:38 +0000 (15:17 +0100)]
Bug 18928: DBRev 19.06.00.010

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 18928: (QA follow-up) Remove DBIC files and reference to DefaultCircRule
Nick Clemens [Fri, 28 Jun 2019 14:50:26 +0000 (14:50 +0000)]
Bug 18928: (QA follow-up) Remove DBIC files and reference to DefaultCircRule

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 18928: (bug 22847 follow-up) Display correctly the values (not the propagated...
Jonathan Druart [Tue, 11 Jun 2019 15:05:24 +0000 (10:05 -0500)]
Bug 18928: (bug 22847 follow-up) Display correctly the values (not the propagated ones)

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 18928: Remove '(not set)'
Jonathan Druart [Mon, 6 May 2019 17:10:58 +0000 (12:10 -0500)]
Bug 18928: Remove '(not set)'

The "(not set)" part must be removed IMO, I am not sure I understand its goal.
Now that we have 1 entry per rule (and not 1 DB row for the whole "Default
checkout, hold and return policy for Centerville" table), it will be harder
to handle it correctly. Not impossible, but if not really needed I would prefer
to just remove it. If a rule is not set, the cell is empty or the dropdown list
displays the option "Not set", which seems to correct the problem.

Signed-off-by: Agustin Moyano <agustinmoyano@theke.io>
Signed-off-by: Liz Rea <wizzyrea@gmail.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 18928: (bug 22847 follow-up) Display correctly the values (not the propagated...
Jonathan Druart [Fri, 3 May 2019 21:39:28 +0000 (17:39 -0400)]
Bug 18928: (bug 22847 follow-up) Display correctly the values (not the propagated ones)

Signed-off-by: Agustin Moyano <agustinmoyano@theke.io>
Signed-off-by: Liz Rea <wizzyrea@gmail.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 18928: (bug 22679 follow-up) Do not remove all rules along with the issuing rule
Jonathan Druart [Fri, 3 May 2019 20:47:59 +0000 (16:47 -0400)]
Bug 18928: (bug 22679 follow-up) Do not remove all rules along with the issuing rule

We actually want to remove maxissueqty, maxonsiteissueqty and max_holds (for now)

Signed-off-by: Agustin Moyano <agustinmoyano@theke.io>
Signed-off-by: Liz Rea <wizzyrea@gmail.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 18928: Use get_effective_rule in GetBranchItemRule
Jonathan Druart [Mon, 29 Apr 2019 15:14:27 +0000 (11:14 -0400)]
Bug 18928: Use get_effective_rule in GetBranchItemRule

Signed-off-by: Agustin Moyano <agustinmoyano@theke.io>
Signed-off-by: Liz Rea <wizzyrea@gmail.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 18928: DBIC schema update
Jonathan Druart [Mon, 29 Apr 2019 15:03:13 +0000 (11:03 -0400)]
Bug 18928: DBIC schema update

Signed-off-by: Agustin Moyano <agustinmoyano@theke.io>
Signed-off-by: Liz Rea <wizzyrea@gmail.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 18928: (follow-up) Unset max_holds rule if needed
Josef Moravec [Wed, 24 Apr 2019 21:11:29 +0000 (21:11 +0000)]
Bug 18928: (follow-up) Unset max_holds rule if needed

Test plan:
1) Set all values in Default checkout, hold and return policy section on
circulation rules admin page, try for all libraries and for one specific
library. Save.
2) Click on unset and confitm
--> without patch, the Maximum total holds allowed value remains
--> with patch the unset removex Maximum holds value too

Signed-off-by: Agustin Moyano <agustinmoyano@theke.io>
Signed-off-by: Liz Rea <wizzyrea@gmail.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 18928: (follow-up) Make DB update idempotent
Tomas Cohen Arazi [Wed, 6 Mar 2019 12:51:28 +0000 (09:51 -0300)]
Bug 18928: (follow-up) Make DB update idempotent

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Agustin Moyano <agustinmoyano@theke.io>
Signed-off-by: Liz Rea <wizzyrea@gmail.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 18928: Update new occurrences
Jonathan Druart [Thu, 21 Feb 2019 20:27:57 +0000 (17:27 -0300)]
Bug 18928: Update new occurrences

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Agustin Moyano <agustinmoyano@theke.io>
Signed-off-by: Liz Rea <wizzyrea@gmail.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 18928: Add missing filters
Jonathan Druart [Wed, 24 Oct 2018 22:40:24 +0000 (19:40 -0300)]
Bug 18928: Add missing filters

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Agustin Moyano <agustinmoyano@theke.io>
Signed-off-by: Liz Rea <wizzyrea@gmail.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 18928: Add DB structure changes
Jonathan Druart [Wed, 24 Oct 2018 22:32:48 +0000 (19:32 -0300)]
Bug 18928: Add DB structure changes

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Agustin Moyano <agustinmoyano@theke.io>
Signed-off-by: Liz Rea <wizzyrea@gmail.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 18928: Move holdallowed, hold_fulfillment_policy, returnbranch to circulation_rules
Kyle M Hall [Tue, 11 Jul 2017 15:10:01 +0000 (11:10 -0400)]
Bug 18928: Move holdallowed, hold_fulfillment_policy, returnbranch to circulation_rules

Test Plan:
1) Apply dependancies
2) Apply this patch set
3) Run updatedatabase.pl
4) Ensure holdallowed and hold_fulfillment_policy rules behavior remains unchanged

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Agustin Moyano <agustinmoyano@theke.io>
Signed-off-by: Liz Rea <wizzyrea@gmail.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 23045: Return record along with errors
Nick Clemens [Fri, 7 Jun 2019 10:14:36 +0000 (10:14 +0000)]
Bug 23045: Return record along with errors

We don't seem to directly handle the errors in most cases, let's always return the record

To test:
1 - Add some blank lines to editor, previous patch is okay with this
2 - Add a line with just 'e' or some other incomplete field
3 - Try to save
4 - Note JS leader error
5 - Apply this patch
6 - No errors

Signed-off-by: Liz Rea <wizzyrea@gmail.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 23045: TextMarc errors on blank lines
Nick Clemens [Tue, 4 Jun 2019 14:25:53 +0000 (14:25 +0000)]
Bug 23045: TextMarc errors on blank lines

Since bug 16251 we use TextMarc to get some record fields, however, it throws an error when
processing blank lines.

We should just pass on these rather then erroring

To test:
1 - Define a new macro that delete more fields than it adds
  delete 245
2 - Run it
3 - Note an error in JS console, and helpers will not load
4 - Apply patch
5 - Reload, try again
6 - No error

Signed-off-by: Claire Gravely <claire.gravely@bsz-bw.de>
Signed-off-by: Liz Rea <wizzyrea@gmail.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 23225: Do not hide a biblio if there is no item
Jonathan Druart [Fri, 28 Jun 2019 19:01:04 +0000 (14:01 -0500)]
Bug 23225: Do not hide a biblio if there is no item

This patch fixes a 404 redirect from the OPAC ISBD view if the
bibliographic record does not have item attached.

Signed-off-by: Luis F. Lopez <lflfalagan@gmail.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 23225: Add a test
Jonathan Druart [Fri, 28 Jun 2019 19:00:53 +0000 (14:00 -0500)]
Bug 23225: Add a test

Signed-off-by: Luis F. Lopez <lflfalagan@gmail.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 17178: DBRev 19.06.00.009
Martin Renvoize [Fri, 28 Jun 2019 15:41:58 +0000 (16:41 +0100)]
Bug 17178: DBRev 19.06.00.009

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 17178: (RM follow-up) Use latest version of library
Martin Renvoize [Fri, 28 Jun 2019 15:33:29 +0000 (16:33 +0100)]
Bug 17178: (RM follow-up) Use latest version of library

This patch just updates us to the latest version of the jQuery library
introduced in this patchset.

Thankyou goes out to Josef Moravec who has already contributed a
language translation upstream for Czech (and the reason I pulled in this
updated library at this time)

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 17178: (QA follow-up) Make DB update idempotent
Martin Renvoize [Fri, 28 Jun 2019 14:52:37 +0000 (15:52 +0100)]
Bug 17178: (QA follow-up) Make DB update idempotent

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 17178: Add virtual keyboard to advanced cataloguing editor
Agustin Moyano [Thu, 9 May 2019 02:41:43 +0000 (23:41 -0300)]
Bug 17178: Add virtual keyboard to advanced cataloguing editor

This patch adds Mottie keyboard (https://github.com/Mottie/Keyboard) to advanced editor.

To test:
1) Apply patches
2) perl install/data/mysql/updatedatabase.pl
3) Enable EnableAdvancedCatalogingEditor system preference
4) Go to cataloguing and to Advanced editor
5) Click on Keyboard shortcuts
SUCCESS => the keyboard shortcut "Ctrl-K" should be displayed, with "Toggle keyboard" as description
6) press Ctrl-K
SUCCESS => a virtual keyboard should be displayed, and a new toolbar button labeled "Keyboard layout" should appear.
=> when you press a letter on both the physical and virtual keyboard, they should be added to the editor.
7) Click on "Keyboard layout"
SUCCESS => a modal should appear, where you can filter and select keyboard layouts.
=> when you select a layout, it should be reflected on the keyboard.
=> when you close the modal without selecting a layout, it should keep using the previous layout.
8) Sign off

Sponsored-by: Round Rock Public Library
Signed-off-by: Liz Rea <wizzyrea@gmail.com>
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 17178: Add shortcut to keyboard_shortcut table
Agustin Moyano [Tue, 14 May 2019 05:57:07 +0000 (02:57 -0300)]
Bug 17178: Add shortcut to keyboard_shortcut table

This patch adds Ctrl-K shortcut to toggle virtual keyboard shortcut

Sponsored-by: Round Rock Public Library
Signed-off-by: Liz Rea <wizzyrea@gmail.com>
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 23196: (follow-up) Add comments to highlight structure
Owen Leonard [Mon, 24 Jun 2019 17:16:07 +0000 (17:16 +0000)]
Bug 23196: (follow-up) Add comments to highlight structure

This follow-up adds a few comments to the markup in order to highlight
and clarify the the HTML structure.

To test, apply the patch and perform a diff against master using the
'-w' flag:

git diff -w origin/master

You should only see the addition of HTML comments.

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 23196: Reindent tools/batch_record_modification.tt
Owen Leonard [Mon, 24 Jun 2019 17:09:36 +0000 (17:09 +0000)]
Bug 23196: Reindent tools/batch_record_modification.tt

This patch re-indents the template for batch record modifications. It
makes only whitespace changes. It should have no effect on the behavior
of the page.

To test, apply the patch and perform a diff against master using the
'-w' flag:

git diff -w origin/master

There should be no changes reported.

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 23183: Reindent cataloging.js
Owen Leonard [Fri, 21 Jun 2019 14:07:49 +0000 (14:07 +0000)]
Bug 23183: Reindent cataloging.js

This patch makes some very minor corrections to indentation in
cataloging.js, a JavaScript file used by the bibliographic and item
records editors.

To test, apply the patch and perform a diff against master using the
'-w' flag:

git diff -w origin/master

There should be no changes reported.

Signed-off-by: Nadine Pierre <nadine.pierre@inLibro.com>
Signed-off-by: Bin Wen <bin.wen@inlibro.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 23193: Make set_password.pl use Koha::Script
Tomas Cohen Arazi [Mon, 24 Jun 2019 13:28:00 +0000 (10:28 -0300)]
Bug 23193: Make set_password.pl use Koha::Script

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 22128: Add Rudolf Byker to contributors
Martin Renvoize [Fri, 28 Jun 2019 13:31:03 +0000 (14:31 +0100)]
Bug 22128: Add Rudolf Byker to contributors

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 22128: Removed outdated comment
Mark Tompsett [Tue, 11 Jun 2019 13:39:48 +0000 (13:39 +0000)]
Bug 22128: Removed outdated comment

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 22128: Use DROP USER IF EXISTS instead of GRANT USAGE before DROP USAGE
Rudolf Byker [Fri, 24 May 2019 18:25:45 +0000 (13:25 -0500)]
Bug 22128: Use DROP USER IF EXISTS instead of GRANT USAGE before DROP USAGE

MySQL 5.7 is old, and the latest versions fail on "GRANT USAGE" if the
user does not exist. "DROP USER IF EXISTS" has been with us since 5.7,
so all users should have it by now. This patch fixes the issue.

To test:

Try to koha_remove a site, and if it works with no errors, all good!

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 23220: Prevent form submission before redirect
Nick Clemens [Wed, 26 Jun 2019 12:49:14 +0000 (12:49 +0000)]
Bug 23220: Prevent form submission before redirect

To test:
 1 - Check in an item to generate a transfer (form another library, no floating)
 2 - Check it in again, click 'Cancel transfer'
 3 - It may or may not work
 4 - To highlight the issue edit return.tt to add the delay line as below:
$('.cancel-transfer').on("click",function(e){
delay(5000);
window.location.href='/cgi-bin/koha/circ/returns.pl?itemnumber=[% itemnumber | html %]&amp;canceltransfer=1'
});
 5 - Check in the item repeatedly, click 'Cancel transfer'
 6 - View the item in the staff or opac and verify it remains in transit
 7 - Undo changes above, apply patch
 8 - Test 'Cancel transfer', note it works
 9 - Add the delay back in, confirm it still works

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 23211: Prevent SIP/Transaction.t to fail randomly
Jonathan Druart [Tue, 25 Jun 2019 22:43:41 +0000 (17:43 -0500)]
Bug 23211: Prevent SIP/Transaction.t to fail randomly

The checkout failed because patron's category is the one used for statistics (category_type=X).

To recreate the failure:
modified: t/db_dependent/SIP/Transaction.t
@ Transaction.t:37 @ subtest fill_holds_at_checkout => sub {
     plan tests => 6;

-    my $category = $builder->build({ source => 'Category' });
+    my $category = $builder->build({ source => 'Category', value => { category_type => 'X' }});
     my $branch   = $builder->build({ source => 'Branch' });
     my $borrower = $builder->build({ source => 'Borrower', value =>{
         branchcode => $branch->{branchcode},

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 23191: (follow-up) Improve output
Martin Renvoize [Tue, 25 Jun 2019 08:21:44 +0000 (09:21 +0100)]
Bug 23191: (follow-up) Improve output

This patch adds a check of what plugins installed before the script run
and outputs only those plugins that have been installed for the first
time or upgraded during this run.

Signed-off-by: Alex Arnaud <alex.arnaud@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 23191: Add commandline script to install plugins
Martin Renvoize [Mon, 24 Jun 2019 12:30:54 +0000 (13:30 +0100)]
Bug 23191: Add commandline script to install plugins

This adds an initial skeliton script to enable plugin installation at
the commandline.

Signed-off-by: Alex Arnaud <alex.arnaud@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 23126: Add tests
Jonathan Druart [Mon, 24 Jun 2019 17:39:15 +0000 (12:39 -0500)]
Bug 23126: Add tests

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 23126: Remove more unnecessary linebreak processing from serial collection
Katrin Fischer [Fri, 21 Jun 2019 01:25:02 +0000 (01:25 +0000)]
Bug 23126: Remove more unnecessary linebreak processing from serial collection

This should have no visible effect on the templates as the
information the grep changes is not used in the template.

It's also strange, that these lines existed, as
GetSubscriptionsFromBiblionumber contained the same changes.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Arthur Bousquet <arthur.bousquet@inlibro.com>
Signed-off-by: Nadine Pierre <nadine.pierre@inLibro.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 23126: Display multi-line entries in subscrpitions correctly
Katrin Fischer [Tue, 18 Jun 2019 06:06:10 +0000 (08:06 +0200)]
Bug 23126: Display multi-line entries in subscrpitions correctly

There are several notes and other fields in a subscription that
can be entered as multi-line input with breaks. We should display
them as they were entered with keeping the line breaks intact.

To test:
- Add a subscription
  - Add comments including line breaks in internal and OPAC note
  - Check the manual history checkbox
- Go to the subscription detail page, tab 'Planning'
- Use the 'Edit history' link to edit the history
- Enter content with line breaks in all the input fields where
  it's possible
- Go to the OPAC detail page for your subscription record
- Go to tab 'Subscriptions' > More details > Brief history
- Verify the line breaks show there as <br>
- Apply patch
- Relaod page, verify all information displays correctly now
- Go back to the detail page, subscription tab - verify same there
- Go back to the subscription detail page in staff
  - Check editing the history works as expected
  - Verify information on all tabs displays correctly
  - Receive a serial issue - verify note on top displays right
  - Go to the serial collection page of the subscription - same there

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Nadine Pierre <nadine.pierre@inLibro.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 23156: Add pagination to checkouts in ILS-DI GetPatronInfo service
Julian Maurice [Wed, 19 Jun 2019 10:07:58 +0000 (12:07 +0200)]
Bug 23156: Add pagination to checkouts in ILS-DI GetPatronInfo service

When patrons have a lot of checkouts, GetPatronInfo can take a lot of
time. This patch introduces two new parameters to allow pagination of
this list of checkouts

Also, fix a warning in C4::ILSDI::Services::GetPatronInfo

Test plan:
1. Go to /cgi-bin/koha/ilsdi.pl?service=GetPatronInfo&patron_id=X&show_loans=1
   where X is a borrowernumber of a patron who has several checkouts
   Verify that all checkouts are listed
2. Add '&loans_per_page=1&loans_page=1' to the URL. Verify that you have
   now only one checkout listed, and that there is a new element
   <total_loans> which contain the total number of checkouts
3. Increase the page number in the URL until you have seen all checkouts
4. prove t/db_dependent/ILSDI_Services.t

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 23179: Add 'edit subfields' button to framework management
Nick Clemens [Fri, 21 Jun 2019 11:02:43 +0000 (11:02 +0000)]
Bug 23179: Add 'edit subfields' button to framework management

To test:
1) Go to Administration > MARC bibliographic framework
2) On a line click Actions > MARC structure
3) Note the dropdowns for each tag are: Edit, Subfields, Delete
4) Apply patch
5) Reload and note dropdowns are: Edit tag, View subfields, Edit subfields, Delete
6) Confirm options do what is selected

Signed-off-by: Bin Wen <bin.wen@inlibro.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 23096: Add floating toolbar to OPAC lists
Owen Leonard [Tue, 11 Jun 2019 16:46:27 +0000 (16:46 +0000)]
Bug 23096: Add floating toolbar to OPAC lists

This patch makes the list contents table's toolbar "stick" to the top of
the screen when scrolling. Minor markup changes have been made to enable
this change.

To test, apply the patch and open a list in the OPAC which has multiple
titles on it. Confirm that the toolbar sticks to the top of the screen
when you scroll down.

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 22566: (QA follow-up) Fix pod complaint
Nick Clemens [Tue, 25 Jun 2019 12:40:57 +0000 (12:40 +0000)]
Bug 22566: (QA follow-up) Fix pod complaint

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 22566: Add 'branch' key to GetPreparedLetter
Martin Renvoize [Tue, 18 Jun 2019 13:29:02 +0000 (14:29 +0100)]
Bug 22566: Add 'branch' key to GetPreparedLetter

The branch key was missing from the subsitution call to
GetPreparedLetter.

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 22566: Clarify intent of reports and add warnings
Martin Renvoize [Tue, 18 Jun 2019 13:24:27 +0000 (14:24 +0100)]
Bug 22566: Clarify intent of reports and add warnings

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 22566: Rename 'report_email' to 'report_by_branch'
Martin Renvoize [Tue, 18 Jun 2019 12:38:43 +0000 (13:38 +0100)]
Bug 22566: Rename 'report_email' to 'report_by_branch'

To clarify the intention of this routine, lets rename it

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 22566: Accept 'all' in the branch params
Martin Renvoize [Tue, 18 Jun 2019 11:57:07 +0000 (12:57 +0100)]
Bug 22566: Accept 'all' in the branch params

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 22566: Fix some more issues
Martin Renvoize [Fri, 7 Jun 2019 11:50:32 +0000 (12:50 +0100)]
Bug 22566: Fix some more issues

1) Fix warning for undefined value in sprintf when no items have the
indemand flag set.
2) Corrections to report_full for bad ternary in string construction
3) Perldoc corrections

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 22566: Fix some problems
Nick Clemens [Fri, 22 Mar 2019 17:23:35 +0000 (13:23 -0400)]
Bug 22566: Fix some problems

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 22949: Markup error in OPAC course reserves template
Owen Leonard [Tue, 21 May 2019 14:45:06 +0000 (14:45 +0000)]
Bug 22949: Markup error in OPAC course reserves template

This patch adds a missing "=" in opac-course-reserves.tt in order to
quiet errors returned by the HTML validator.

To reproduce the problem you should have one or more course reserves
available in the OPAC. Go to the course reserves page. Run the page
through the W3C validation service: https://validator.w3.org. Either by
pasting in the URL for the search results (if web accessible) or by
viewing source, copying, and pasting into "Validate by Direct Input."

This patch addresses these errors:

 - 'Quote " in attribute name. Probable cause: Matching quote missing
    somewhere earlier.'
 - 'Attribute class"inst_surname" not allowed on element span at this
    point.'

To test, apply the patch and try again to reproduce the validation
errors. Those errors should no longer be present. There should be no
visible change to the page.

Signed-off-by: Frederik Chenier <frederik@inlibro.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 23082: Fatal error editing a restricted patron
Jonathan Druart [Mon, 24 Jun 2019 14:58:00 +0000 (09:58 -0500)]
Bug 23082: Fatal error editing a restricted patron

In members/memberentry.pl we have to explicitely remove the template's
params that are not patron's attributes.

Certainly caused by
  commit 1bb6cec902088d07c7a43addc4b4adb5b0bf3d4f
  Bug 20287: Fix update of patrons, clean the data before ->store

Test plan:
Create a restriction for a patron
Edit patron's details
Remove the restriction
=> Without this patch you get "No property remove_debarment for
Koha::Patron"
=> With this patch applied the restriction is removed

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 23116: AllowHoldPolicyOverride allows a librarian to almost place a hold on an...
Kyle M Hall [Thu, 13 Jun 2019 10:34:38 +0000 (06:34 -0400)]
Bug 23116: AllowHoldPolicyOverride allows a librarian to almost place a hold on an item already on hold

A library appears to be able to place a second item level hold on an item a patron already has on hold if
A) AllowHoldPolicyOverride is enabled
and
B) the circ rule allow for multple item level holds.

Once the patron submits the hold requests though, the hold does not get stored in the database.

Because allowing two item level holds for the same item makes no sense, we should not allow
this attempt to take place, even if AllowHoldPolicyOverride is enabled.

Test Plan:
 1) Enable AllowHoldPolicyOverride
 2) Set up circ rules to allow for multiple item level holds on one record
 3) Place an item level hold on a record
 4) Note you can force placing a second item hold on that reocrd
 5) Attempt to do so, it will not actually work
 6) Apply this patch
 7) Note you can no longer place another item level hold for the same item
   you just placed an item-level hold on
 8) Note you can still force holds that contravene the circ rules for
   any and all other reasons
 9) Test with record level holds
10) Test by placing multiple holds from search results

Signed-off-by: Martha Fuerst <mfurest@hmcpl.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Simple fix for a regression. Works as expected.
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 5287: (RM follow-up) Make tests basket compatible
Martin Renvoize [Tue, 25 Jun 2019 15:19:43 +0000 (16:19 +0100)]
Bug 5287: (RM follow-up) Make tests basket compatible

The selenium tests for addtobasket/removefrombasket started to fail
after the introduction of bug 5287. It turns out that a selenium click
handler will trigger a scroll event if the element you're trying to
click isn't in the view port. Unfortunately it scrolls the viewport just
enough for the element to come on screen but that also triggers the
floating toolbar in this case which ends up floating directly over the
element we want to 'click' and so the click rightfully fails as the
element is not 'clickable'.

This patch works around the issue by setting the window size to being a
HD screen in portrait orientation and therefore negates the need for
scrolling to put the elements in within the viewport.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 23109: (RM follow-up) Correction to typo in DBRev
Martin Renvoize [Mon, 24 Jun 2019 17:24:47 +0000 (18:24 +0100)]
Bug 23109: (RM follow-up) Correction to typo in DBRev

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 23152: (RM follow-up) Correct pluralisation of Koha::Libraries
Martin Renvoize [Mon, 24 Jun 2019 17:22:08 +0000 (18:22 +0100)]
Bug 23152: (RM follow-up) Correct pluralisation of Koha::Libraries

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 23109: DBRev 19.06.00.008
Martin Renvoize [Mon, 24 Jun 2019 16:12:44 +0000 (17:12 +0100)]
Bug 23109: DBRev 19.06.00.008

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 23109: (follow-up) fix typo in upgrade script
Mark Tompsett [Thu, 20 Jun 2019 16:42:22 +0000 (16:42 +0000)]
Bug 23109: (follow-up) fix typo in upgrade script

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 23109: Improve description of staffaccess permission
Katrin Fischer [Mon, 17 Jun 2019 21:50:01 +0000 (21:50 +0000)]
Bug 23109: Improve description of staffaccess permission

Changes:
Allow staff members to modify permissions for other staff members
To:
Allow staff members to modify permissions and passwords for other staff members.

As suggested by Andre on the initial bug report.

To test:
- Go to any patron account and check More > permissions
- Veriy the description is shown as noted above
- Apply patch and run database update
- Reload the page and verify the description has changed
- Run the following SQL and verify the description in the
  database table matches as well:

SELECT * FROM userflags where flag = "staffaccess";

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 23158: Make the assignment statement more readable
Jonathan Druart [Mon, 24 Jun 2019 15:37:54 +0000 (10:37 -0500)]
Bug 23158: Make the assignment statement more readable

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 23158: keep on-site checkout info when using itemBarcodeFallbackSearch
Fridolin Somers [Wed, 19 Jun 2019 11:42:16 +0000 (13:42 +0200)]
Bug 23158: keep on-site checkout info when using itemBarcodeFallbackSearch

When using preference itemBarcodeFallbackSearch one can enter a search term instead of a barcode in checkout form.
If on-site is selected this should be transmitted to itemBarcodeFallbackSearch form.

Test plan :
1) Enable system preferences "itemBarcodeFallbackSearch" and "OnSiteCheckouts"
2) Disable system preference "ConsiderOnSiteCheckoutsAsNormalCheckouts"
3) Go to a patron circulation page
4) Check "On-site checkout" in "Checkout settings"
5) Enter a barcode in checkout form and click on "Check out"
6) You see the checkout in table with red "(On-site checkout)"
7) Check "On-site checkout" in "Checkout settings"
8) Enter the title of a record in in checkout form and click on "Check out"
9) Click on "Checkout" on a line
10) You see the checkout in table with red "(On-site checkout)"

Signed-off-by: Arthur Bousquet <arthur.bousquet@inlibro.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 5287: Compiled CSS
Martin Renvoize [Mon, 24 Jun 2019 16:07:04 +0000 (17:07 +0100)]
Bug 5287: Compiled CSS

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 5287: (QA follow-up) update deprecated button
Liz Rea [Sat, 8 Jun 2019 17:57:17 +0000 (17:57 +0000)]
Bug 5287: (QA follow-up) update deprecated button

Signed-off-by: Liz Rea <wizzyrea@gmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 5287: Add floating toolbar to search results in OPAC
Owen Leonard [Tue, 11 Jun 2019 12:16:10 +0000 (12:16 +0000)]
Bug 5287: Add floating toolbar to search results in OPAC

This patch adds the "hc-sticky" JavaScript library to the OPAC and uses
it to make the search results toolbar "stick" to the top of the page as
the user scrolls down.

This patch also moves search results pagination into the toolbar so that
pagination links are available. Font Awesome icons are added to the
pagination include to replace arrow HTML entities.

To test, apply the patch and rebuild the OPAC CSS
(https://wiki.koha-community.org/wiki/Working_with_SCSS_in_the_OPAC_and_staff_client).

 - Perform a catalog search in the OPAC which will return multiple pages
   of results. Confirm that the toolbar "sticks" and that all controls
   in the toolbar work correctly.
 - Test at various browser widths to confirm that it adapt well to
   various sizes.

Signed-off-by: Liz Rea <wizzyrea@gmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 23152: (RM follow-up) Add handling for Koha::Plugin::Methods
Martin Renvoize [Mon, 24 Jun 2019 15:56:56 +0000 (16:56 +0100)]
Bug 23152: (RM follow-up) Add handling for Koha::Plugin::Methods

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 23152: Implement koha_object[s]_class when needed
Jonathan Druart [Wed, 19 Jun 2019 02:42:07 +0000 (21:42 -0500)]
Bug 23152: Implement koha_object[s]_class when needed

A simple use case is the ->get_from_storage (useful when writing tests)

Test plan:
Apply only the first patch and notice the test failures
Apply the second patch and confirm the the tests are returning green

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 23152: Add tests
Jonathan Druart [Wed, 19 Jun 2019 02:39:45 +0000 (21:39 -0500)]
Bug 23152: Add tests

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 23154: Add pagination to /api/v1/checkouts
Julian Maurice [Wed, 19 Jun 2019 09:10:14 +0000 (11:10 +0200)]
Bug 23154: Add pagination to /api/v1/checkouts

Allow to use _page and _per_page query parameters for
/api/v1/checkouts
Also fix a timezone problem in t/db_dependent/api/v1/checkouts.t

Test plan:
1. With your favorite REST tester tool, or directly in the browser,
   fetch http://koha/api/v1/checkouts and check that you have results
2. Fetch /api/v1/checkouts?_per_page=1&_page=1 and check that only the
   first result is returned. Check that response contains headers
   X-Total-Count and Link
3. Fetch /api/v1/checkouts?_per_page=1&_page=2 and check that only the
   second result is returned. Check that response contains headers
   X-Total-Count and Link
4. prove t/db_dependent/api/v1/checkouts.t

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 23159: Add comments to addbiblio.tt
Mark Tompsett [Wed, 19 Jun 2019 14:06:28 +0000 (14:06 +0000)]
Bug 23159: Add comments to addbiblio.tt

This patch adds code comments to the template to clarify indenting over
the page boundary.

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 23159: Reindent addbiblio.tt
Owen Leonard [Tue, 18 Jun 2019 15:32:24 +0000 (15:32 +0000)]
Bug 23159: Reindent addbiblio.tt

This patch corrects whitespace in the basic MARC editor template,
addbiblio.tt: Tabs converted to spaces, indentation corrected. Some
comments have been added in the markup to clarify the page structure.

To test, apply the patch and open the basic MARC editor. Confirm that
everything works correctly, including:

 - Showing/hiding subfields
 - Re-ordering subfields
 - Removing tags and subfields
 - Cloning tags and subfields
 - Plugin links

Use the "-w" flag when using diff to examine the patch. The only changes
should be places where single lines were broken up and where comments
were added.

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 23146: (QA follow-up) Make sure we use the absolute path
Tomas Cohen Arazi [Wed, 19 Jun 2019 15:30:28 +0000 (12:30 -0300)]
Bug 23146: (QA follow-up) Make sure we use the absolute path

When making a request using any tool (like cUrl or Postman) you get a
'Basic authentication disabled' error (if it is actually disabled) or an
'invalid password' error if it is disabled. This is because the
comparisson of the path we do passes on oauth.t but fails on external
tools. This is probably related to our stack including Apache URL
mappings and then in the plack.psgi file. The safest way is to just ask
Mojo::URL the absolute path to be sure.

To test:
- Having the rest of the patches applied and plack restarted, run: [1]
  $ curl -X POST -H 'Authorization: Basic ZGQ2NjlmNGUtZmI1NS00Y2YzLWE4ZmYtYmFiYzJiNDIwNWY1OmM0ZDJmYmYzLWYwOWMtNGJkZi1iNWE4LTgxMDJmNjcwYTI1Mw' -i 'http://kohadev.myDNSname.org:8081/api/v1/oauth/token' --data grant_type=client_credentials
=> FAIL: It fails saying Basic auth is disabled
- Run:
  $ kshell
 k$ prove t/db_dependent/api/v1/oauth.t
=> SUCCESS: Tests pass
- Apply this patch
- Replicate your curl/postman test
=> SUCCESS: It now works as expected
- Run:
 k$ prove t/db_dependent/api/v1/oauth.t
=> SUCCESS: Tests still pass!
- Sign off :-D

[1] You need to generate a client_id and client_secret, and encode them
using: encode_base64url( "$client_id:$client_secret" );

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 23146: Add support for Basic auth on the OAuth2 token endpoint
Tomas Cohen Arazi [Tue, 18 Jun 2019 19:09:01 +0000 (16:09 -0300)]
Bug 23146: Add support for Basic auth on the OAuth2 token endpoint

The original implementation only contemplated the option to pass the
client_id and client_secret on the request body. It is very common that
clients expect to be able to pass them as a Basic authorization header:

Authorization: Basic encode_base64(client_id:client_secret)

This patch introduces support for this, by:
- Adding a check for the presence of the Authorization header in the
OAuth token request handling code and making that case extract the
client_id and client_secret from the header instead of the original
implementation. No behaviour changes.
- The Auth#under sub is changed so it doesn't go through the
authenticate_api_request chain step, as it would be in conflict with
general Basic authentication.
- Original tests are generalized so they are run in both ways, with the
same expected results.

To test:
- Apply the unit tests patch
- Run:
  $ kshell
 k$ prove t/db_dependent/api/v1/oauth.t
=> FAIL: Tests fail because the current API doesn't support the feature
- Apply this patch
- Run:
 k$ prove t/db_dependent/api/v1/oauth.t
=> SUCCESS: Tests pass!
- Sign off :-D

Sponsored-by: ByWater Solutions
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 23146: Unit tests
Tomas Cohen Arazi [Tue, 18 Jun 2019 19:08:54 +0000 (16:08 -0300)]
Bug 23146: Unit tests

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 22935: Compiled CSS
Martin Renvoize [Mon, 24 Jun 2019 14:42:04 +0000 (15:42 +0100)]
Bug 22935: Compiled CSS

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 22935: Improve style of Bootstrap pagination
Owen Leonard [Fri, 17 May 2019 15:03:24 +0000 (15:03 +0000)]
Bug 22935: Improve style of Bootstrap pagination

This patch makes some updates to the staff client CSS and adds Font
Awesome icons to the Bootstrap pagination include.

To test, apply the patch and rebuild the staff client CSS.

Perform a search in the staff client which will return multiple pages of
results. Check that the pagination links look good.

Signed-off-by: Maryse Simard <maryse.simard@inlibro.com>
Signed-off-by: Bin Wen <bin.wen@inlibro.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 20292: Filter/censor info sent via SIP
Kyle M Hall [Fri, 30 Nov 2018 17:23:43 +0000 (12:23 -0500)]
Bug 20292: Filter/censor info sent via SIP

Some libraries would like to limit the amount of personal information a SIP server sends
to arbitrary parties on a per-login basis.

Test Plan:
1) Add a new key/value pair to one of your existing login stanzas in your SIP config file
   For example: hide_fields="BD,BE,BF,PB"
2) Restart SIP
3) Send a SIP message that would normally return those fields ( in this example, a Patron Information Request )
4) Note the response has had those fields removed

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Christopher Davis <tubaclarinet@protonmail.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 22509: (RM follow-up) Add use of Koha::Script base class
Martin Renvoize [Mon, 24 Jun 2019 14:07:53 +0000 (15:07 +0100)]
Bug 22509: (RM follow-up) Add use of Koha::Script base class

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>