Emmi Takkinen [Thu, 14 May 2020 09:32:13 +0000 (12:32 +0300)]
Bug 14723: Make delivery notes translatable
Delivery notes weren't translatable. This patch adds
them in notices.tt. If note is Mail::Sendmail error generic
'Error occured while sending email' is shown.
Also fixes MySQLisms and adds AFTER to atomicupdate file.
To test prove t/db_dependent/Letters.t
Sponsored-by: Koha-Suomi Oy Signed-off-by: Stina Hallin <stina.hallin@ub.lu.se> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
This patch adds additional delivery notes to messages in message queue as there
can be multiple reasons for a delivery to fail.
Currently in message_queue we are given only two delivery statuses for messages,
"sent" and "failed". When the status becomes failed, we have no idea why it fails.
This feature can be useful with SMS gateway providers. Many SMS gateways inform
the application the reason of SMS delivery failure. With this feature, this
information can now be stored. As well as for emails, instead of simply logging
failures, we can now store the reason of failure directly into the message row
of message_queue.
Test plan:
1. Enable EnhancedMessagingPreferences syspref
2. Find a borrower with notices at members/notices.pl
3. Observe that there is no column for Delivery notes
4. Apply patch and run the given database update
5. Repeat step 1.
6. Observe that there is now a column for Delivery notes
Sponsored-by: Hypernova Oy Signed-off-by: Liz Rea <wizzyrea@gmail.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Aleisha Amohia [Wed, 5 May 2021 05:22:06 +0000 (17:22 +1200)]
Bug 21249: (follow-up) Adding parentheses to fix query
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net> Signed-off-by: David Cook <dcook@prosentient.com.au> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Aleisha Amohia [Tue, 23 Feb 2021 21:48:10 +0000 (10:48 +1300)]
Bug 21249: (follow-up) Implement SearchLibraryLimit for individual library
before this patch, the limit only applies to groups of libraries
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net> Signed-off-by: David Cook <dcook@prosentient.com.au> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Bug 21249: (follow-up) Fixing syspref name, description, get working with OPAC masthead search
Syspref is now called SearchLimitLibrary, and the description better
explains what the feature does. It works with the advanced search on the
staff client and OPAC, and the masthead search on the OPAC when
OpacAddMastheadLibraryPulldown is enabled.
Sponsored-by: Catalyst IT Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net> Signed-off-by: David Cook <dcook@prosentient.com.au> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Jonathan Druart [Wed, 6 Nov 2019 11:19:11 +0000 (12:19 +0100)]
Bug 21249: Code cleaning
Trying to make the code a bit more readable removing unecessary
variables and parenthesis.
Code is duplicated but no idea where we could move it to.
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net> Signed-off-by: David Cook <dcook@prosentient.com.au> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Alex Buckley [Thu, 27 Dec 2018 01:44:22 +0000 (01:44 +0000)]
Bug 21249: Made the SQL INSERT statement idempotent
Sponsored-BY: Brimbank Library, Australia
Signed-off-by: Amandine Zocca <azocca@ville-montauban.fr> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net> Signed-off-by: David Cook <dcook@prosentient.com.au> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Alex Buckley [Mon, 20 Aug 2018 09:49:43 +0000 (21:49 +1200)]
Bug 21249: New syspref controlling branch fields queried against selected library group value in advanced search
This commit allows librarians to choose whether they want to query the
homebranch, holdingbranch or homebranch AND holdingbranch when they set
a library or library group search condition in the staff client and OPAC
advanced searches.
Test plan:
1. Apply patches, update database, restart services
2. Set up a record with one item. Edit the item so that:
home branch = Branch A
holding/current branch = Branch B.
Note the barcode of your item.
3. Go to Administration -> Library Groups. Create a library group that
only contains Branch A.
= homebranch and holdingbranch =
4. Go to Administration -> System preferences and find the new
SearchLimitLibrary syspref. Confirm it is set to 'homebranch and
holdingbranch' by default. Keep this tab open.
5. Go to Advanced Search in the staff client in another tab. Under 'location and
availability', select your library group from the dropdown. Under
'search for', select the barcode option and enter your item's barcode.
6. Submit the search and confirm you are taken to your item as expected.
7. Go back to Advanced Search. Under 'location and availability', select
Branch A from the individual libraries dropdown. Under 'search for',
select the barcode option and enter your item's barcode.
8. Submit the search and confirm you are taken to your item as expected.
9. Go back to Advanced Search. Under 'location and availability', select
Branch B from the individual libraries dropdown. Under 'search for',
select the barcode option and enter your item's barcode.
10. Submit the search and confirm you are taken to your item as expected.
= homebranch only =
11. Go back to your System preferences tab. Set the SearchLimitLibrary
syspref to 'homebranch'. keep this tab open.
12. Go to Advanced Search in the staff client in another tab. Under 'location and
availability', select your library group from the dropdown. Under
'search for', select the barcode option and enter your item's barcode.
13. Submit the search and confirm you are taken to your item as expected,
because the syspref is set to homebranch and the library group contains our item's
homebranch.
14. Go back to Advanced Search. Under 'location and availability', select
Branch A from the individual libraries dropdown. Under 'search for',
select the barcode option and enter your item's barcode.
15. Submit the search and confirm you are taken to your item as expected.
16. Go back to Advanced Search. Under 'location and availability', select
Branch B from the individual libraries dropdown. Under 'search for',
select the barcode option and enter your item's barcode.
17. Submit the search and confirm you are NOT taken to your item and your item
does not show in the search results.
= holdingbranch only =
18. Go back to your System preferences tab. Set the SearchLimitLibrary
syspref to 'holdingbranch'. keep this tab open.
19. Go to Advanced Search in the staff client in another tab. Under 'location and
availability', select your library group from the dropdown. Under
'search for', select the barcode option and enter your item's barcode.
20. Submit the search and confirm you are NOT taken to your item and your
item does not show in the search results, because the syspref is set to
holdingbranch and the library group does not contain our item's holdingbranch.
21. Go back to Advanced Search. Under 'location and availability', select
Branch B from the individual libraries dropdown. Under 'search for',
select the barcode option and enter your item's barcode.
22. Submit the search and confirm you are taken to your item as expected.
23. Go back to Advanced Search. Under 'location and availability', select
Branch A from the individual libraries dropdown. Under 'search for',
select the barcode option and enter your item's barcode.
24. Submit the search and confirm you are NOT taken to your item and your item
does not show in the search results.
25. Repeat the above test plan but do your searching with the OPAC
advanced search.
Sponsored-By: Brimbank Library Signed-off-by: Amandine Zocca <azocca@ville-montauban.fr> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net> Signed-off-by: David Cook <dcook@prosentient.com.au> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Bug 16486: Display the timestamp when an accountline is updated
This patch updates the Date field to be 'Created' and adds a new column
'Updated' which shows the timestamp of the accountline.
To test:
1) Apply patch, restart services
2) Test the following staff client pages:
- Reports -> Cash register
- Patron Accounting tab -> Transactions
- Create a manual invoice. Click 'Print' on the transactions tab to
generate Invoice slip
- Make a payment. Click 'Print' on the transactions tab to generate
Receipt slip
3) Test the OPAC:
- your charges
Sponsored-by: Catalyst IT Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk> Signed-off-by: Owen Leonard <oleonard@myacpl.org> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Nick Clemens [Fri, 29 Jan 2021 13:33:34 +0000 (13:33 +0000)]
Bug 27577: Autolink biblio after biblionumber is generated
If BiblioAddsAuthorities and AutoCreateAuthorities are enabled, a new record is auto linked when saving and authorities generated with a 670 field that indicates which record generated the new authority.
The code to do this is called before the biblionumber is generated, so the variable that adds the biblionumber to the citation is empty
This patch moves the linking code to after the biblionumber is generated
To recreate:
1 - Enable BiblioAddsAuthorities and AutoCreateAuthorities
2 - Import or create a new record
3 - Ensure the record has controlled fields that do not have authorities before saving, i.e.:
Add a 650 with "test_bug_27577_01"
4 - Search for the authority record
5 - Note the 670 field does not contain the biblionumber
6 - Apply patch, restart all the things
7 - Repeat 2-4
8 - Note the 670 now has the biblionumber
Signed-off-by: Phil Ringnalda <phil@chetcolibrary.org> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Henry Bolshaw [Wed, 21 Apr 2021 15:16:49 +0000 (15:16 +0000)]
Bug 27740: (follow-up) changed "User summary" css
Changed user summary CSS to style H2 not H3 heading
To test:
1) Go to OPAC homepage
2) Login as a user with at least one loan
3) See that the "User summary" heading is not styled
4) Apply patch
5) Run yarn build --view OPAC
6) Confirm the heading is now styled with grey background
Signed-off-by: Wainui Witika-Park <wainuiwitikapark@catalyst.net.nz> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
To test:
1) Go to OPAC
2) Go to home page
3) Check that there is a <h2> saying "User summary"
Sponsored-by: Catalyst IT Signed-off-by: Henry Bolshaw <bolshawh@parliament.uk> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
If the quote of the day feature is enabled, a "Quote of the day" heading
is displayed. It was an <h3> which was not proper hierarchy, so this has
been changed to an <h2>.
To test:
1) Go to staff client
2) Enable quote of the day preference
3) Go to the OPAC
4) Observe "Quote of the day" heading
5) Ensure it is an <h2>
Sponsored-by: Catalyst IT Signed-off-by: Henry Bolshaw <bolshawh@parliament.uk> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Bug 27740: (follow-up) changed welcome user to <p>
In the 'user_summary block', the "Welcome, user" was an <h3>. This has
been changed to a <p> as it isn't really a heading.
The styling can be changed to make it appear as it was before, or to
make it appear more significant on the page.
To test:
1) Go to the OPAC
2) Go to the home page
3) Go to the 'user_summary' block
4) Check that the part where is says "Welcome, user" is now a <p>
Sponsored-by: Catalyst IT Signed-off-by: Henry Bolshaw <bolshawh@parliament.uk> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
On the purchase suggestions page you could end up with two "Your
purchase suggestions" headings, one as an h1 and one as an h2..
Test plan
1/ Add at least one purchage suggestion to a patron
2/ Navigate to 'Purchase suggestions'
3/ Note that just one 'Your purchase suggestsions' heading appears with
a top level '1'.
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Wainui Witika-Park <wainuiwitikapark@catalyst.net.nz> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Martin Renvoize [Thu, 15 Apr 2021 14:00:52 +0000 (15:00 +0100)]
Bug 27740: (QA follow-up) Fix 'Payment method'
The 'Payment method' heading now needs to be moved to the second level
to ensure consistent header heirarchy.
Test plan
1/ Add some debts to a patrons account
2/ Enable online payments (Paypal is a good example)
3/ Login to the OPAC and navigate to the 'Charges' page
4/ Note the header hierarchy has no gaps... (h1 -> h2, not h1 -> h3)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Wainui Witika-Park <wainuiwitikapark@catalyst.net.nz> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Bug 27610 corrected the <h1> tags in each of the OPAC files. This patch
corrects the hierarchy of the rest of the headings on each of the pages.
To test:
1) Go to the OPAC
2) Apply Bug 27610 patch
3) Apply patch (Bug 27740)
4) Go to each of the pages and check that the headings under <h1> are in
the correct order and hierarchy
Sponsored-by: Catalyst IT Signed-off-by: Owen Leonard <oleonard@myacpl.org> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Owen Leonard [Mon, 12 Apr 2021 10:49:45 +0000 (10:49 +0000)]
Bug 28134: Replace use of input type number in onboarding templates
This patch changes the instances of input of type="number" to input
type="text" with attributes inputmode="numeric" and pattern="[0-9]*"
To test, apply the patch and run through the process of installing Koha.
When you reach onboarding step 2, "Create a patron category," check the
enrollment period -> "In months" field. The field should not accept any
input except numbers.
Continue onboarding until step 5, "Create a new circulation rule." On
this page, check that these fields accept only numbers:
- Current checkouts allowed
- Loan period
- Renewals allowed
- Renewals period
- Holds allowed (total)
- Holds allowed (daily)
- Holds per record (count)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Jonathan Druart [Wed, 16 Dec 2020 10:04:48 +0000 (11:04 +0100)]
Bug 27246: Remove obsolete BEGIN code from C4::Context
We don't longer enter the HTTP_USER_AGENT conditional in the BEGIN block
of C4::Context. It was used when apache only was used.
I am suggesting to remove it but keep the $CGI::VERSION < 4.08 condition
to keep support of all version (not sure it's needed but won't hurt).
I have not found a lot of occurrences of KOHA_BACKTRACES and I am
assuming not much people are using it, we should prefer the dev_install
flag instead (to set environment="development" when plack is started and
enabled the starman trace)
Test plan:
Regression test what you think is useful
Confirm the above statements
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net> Signed-off-by: David Cook <dcook@prosentient.com.au> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Bug 27865: Pass the x-koha-override header to PUT /holds/:hold_id from the patron's page
This patch makes the AJAX call to update an existing hold, pass the
'x-koha-override' header with the value of 'any', so any pickup location
policy override that is needed, is applied.
As the override is taken into account only if AllowHoldPolicyOverride is
enabled, this in fact restores the previous behavior.
To test:
1. Have a patron with a hold
2. Have AllowHoldPolicyOverride set to 'yes'
3. Try changing the pickup location to an invalid one
=> FAIL: The options are the same as before 27205, yet the AJAX call
fails because of invalid pickup location.
4. Apply this patch
5. Repeat 3
=> SUCCESS: The API call succeeds, and the hold is updated (it is
actually refetch, so just verify it has the value you selected
6. Sign off :-D
Signed-off-by: Petro Vashchuk <stalkernoid@gmail.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Martin Renvoize [Fri, 30 Apr 2021 13:41:43 +0000 (14:41 +0100)]
Bug 28254: (QA follow-up) override -> force
After some discussion we decided that the parameter should be called
'force' for pushign through an action against policy. (as per the
Transfers work).
We decided to stick to 'override' at the API level however as it
highlights the 'human interaction' element of the call.
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Bug 28254: Make PUT /holds/:hold_id/pickup_location honour x-koha-override
This patch adds a new parameter (x-koha-override header) to the route,
and makes the controller pass this information (override requested) when
the AllowHoldPolicyOverride syspref is set, to
Koha::Hold->set_pickup_location.
This way, under certain conditions, we can be sure the update wont'
fail.
To test:
1. Apply this patchset
2. Run:
$ kshell
k$ prove t/db_dependent/api/v1/holds.t
=> SUCCESS: Tests pass!
3. Sign off :-D
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Bug 28254: Add 'override' parameter to Koha::Hold->set_pickup_location
This patch adds a new parameter to the method. If passed+true it makes
the method skip the pickup validation test.
Tests and POD added for this change.
To test:
1. Apply this patch
2. Run:
$ kshell
k$ prove t/db_dependent/Koha/Hold.t
=> SUCCESS: Tests pass!
3. Sign off :-D
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Bug 27898: Make PUT /holds/:hold_id accept overrides
This patch makes the route handle overriding pickup locations by passing
the 'x-koha-override' header (set to 'any').
To test:
1. Apply the unit tests patch
2. Run:
$ kshell
k$ prove t/db_dependent/api/v1/holds.t
=> FAIL: Tests fail, because things cannot be overridden ATM.
3. Apply this patch
4. Repeat 2
=> SUCCESS: Tests pass!
5. Sign off :-D
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com> Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
This patch adds unit tests for the PUT /holds/:hold_id route so it
accepts the x-koha-override header and is able to override pickup
location constraints.
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com> Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Bug 27797: (QA follow-up) Pickup locations can be overridden too
This patch adds regression tests for overridding pickup locations, which
was inadvertedly not covered by the original dev. What this does, is
moving the $can_override variable definition above, and avoid returning
400 if conditions are not met for the passed pickup_library_id, when
$can_override is true.
To test:
1. Apply this patch
2. Run:
$ kshell
k$ prove t/db_dependent/api/v1/holds.t
=> SUCCESS: Tests pass!
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
This patch makes the tests mock things so the complex holds scenarios
where existing data could interfere, don't get in the middle with what
we need to test.
To test:
1. Apply this patch
2. Run:
$ kshell
k$ prove t/db_dependent/api/v1/holds.t
=> SUCCESS: Nothing broke
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Bug 27797: Make POST /holds use the stashed koha.overrides
Bug 26181 introduced a way to override behavior through a new header,
x-koha-override. And bug 27760 introduced a generic approach to handle
x-koha-override.
This patchset makes the POST /api/v1/holds route rely on this new way of
handling x-koha-override instead of doing it manually.
but the versions of JSON::Validator we use have lots of bugs related to
header type coercion, so it just doesn't work. The changelog for
JSON::Validator is fairly elocuent about it.
The override now takes a list of valid keywords (right now only 'any'
but it would be fairly straight-forward to add a fairly granular set of
options based on each possible AddReserve failure.
To test:
1. Apply this patches
2. Run:
$ kshell
k$ prove t/db_dependent/api/v1/holds.t
=> SUCCESS: Tests pass!
4. Sign off!
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
This patch improves the POD for the added helper, and also adds
references to the JSON::Validator issue that explains the current
implementation. A FIXME is added for when we upgrade our used
JSON::Validator version.
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Bug 27760: Make authenticate_api_request call stash_overrides
By making this method call the helper, we make sure the overrides
hashref is available to any controller to make us of it.
To test:
1. Apply this patches
2. Run:
$ kshell
k$ prove t/db_dependent/api/v1/auth_authenticate_api_request.t \
t/Koha/REST/Plugin/Query.t
=> SUCCESS: Tests pass! The helper works as expected and the
authenticate_api_request method invokes it!
3. Sign off :-D
Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
This patch adds a simple helper that reads the x-koha-override request
header, and processes it to stash a hashref with the passed overrides.
No check on the overrides themselves is done, as they should be
validated using the OpenAPI spec.
To test:
1. Apply this patch
2. Run:
$ kshell
k$ prove t/db_dependent/api/v1/auth_authenticate_api_request.t
=> SUCCESS: Tests pass!
3. Sign off :-D
Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
This patch makes the dropdown width inherit the existing style.
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Bug 27864: Visual feedback on overridden pickup locations when placing hold
This patch makes the form for placing a hold, use the API to retrieve
the valid pickup locations for a biblio.
To test:
1 - In Circulation and fines rules > Default checkout, hold and return policy, change 'Hold pickup library match' to 'item's home library'
2 - Set AllowHoldPolicyOverride system preference to Allow
3 - Try placing a hold on a biblio with several items.
Ensure that there is one item with homebranch of the patrons branch and
one at another branch
4 - Note the pickup location dropdown lists all branches, even those not matching the policy (Item's home library)
5 - FAIL: There's no sign they are overrides to rules
6 - Apply the patch
7 - Repeat 3
8 - SUCCESS: Same behavior as before all libraires listed, but there's a sign
+ tooltip for overridden ones.
9 - Sign off :-D
Note: styling follow-up coming
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Bug 27932: Add GET /biblios/:biblio_id/pickup_locations route
This patch adds the mentioned route. It does so by:
- Adding the new path in paths.json
- Adding the full route spec in biblios.json
- Adds a controller method that takes care of the task
To test:
1. Apply this patches
2. Run:
$ kshell
k$ prove t/db_dependent/api/v1/biblios.t
=> SUCCESS: Tests pass!
3. Play with your favourite REST tool. Pay special care to
the AllowHoldPolicyOverride syspref and the expected behaviors.
=> SUCCESS: All works as expected
4. Sign off :-D
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Jonathan Druart [Fri, 30 Apr 2021 12:27:20 +0000 (14:27 +0200)]
Bug 28270: (bug 24279 follow-up) Fix tooltip for the claim lost status
It says "At least one item is available at this library" instead of
"Return claims must be processed from the patron details page"
(like on cataloguing/additem)
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Bug 28170: Fix upload.tt search result buttons for page two onwards
From https://datatables.net/faqs/index
"When attaching events to cells in a table controlled by DataTables, you need
to be careful how it is done. Because DataTables removes nodes from the DOM,
events applied with a static event listener might not be able to bind
themselves to all nodes in the table."
Before this patch, there were three non-functional buttons on upload search
result page, "+ Choose", "Download" and "Delete".
This patch binds the handlers to a static element so that the three buttons
in upload.tt on page two onwards are functional again.
To test:
1. This test is for the "Download" and "Delete" buttons
1.1. Before applying patch, go to cgi-bin/koha/tools/upload.pl
1.2. Make sure you have at least 21 files uploaded
1.3. Perform a search via "Search term" form so that at least 21 results are
returned (e.g. a dot (.) as the search term should return all files with
filetype)
1.4. Press "Download" and "Delete" for the first result row, it should work
as expected (no need to actually delete the file - as long as it pops up
a confirmation, it works as expected)
1.5. Go to page 2 of results
1.6. Press "Download" and "Delete" for the first result in page 2
1.7. Observe nothing happening
1.8. Apply patch
1.9. Repeat steps 3-6
1.10. Observe buttons working as expected
2. This test is for the "+ Choose" button
2.1. Go to cgi-bin/koha/admin/marc_subfields_structure.pl?op=add_form&tagfield=856&frameworkcode=#subufield
2.2. Under "Other options (choose one), for "Plugin", select "upload.pl"
2.3. Find a biblio and click Edit Record
2.4. Go to 856$u and click "Upload"
2.5. Repeat steps 1.1. - 1.10., but this time for the "+ Choose" button
Signed-off-by: Owen Leonard <oleonard@myacpl.org> Signed-off-by: Julian Maurice <julian.maurice@biblibre.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Jonathan Druart [Mon, 26 Apr 2021 08:49:12 +0000 (10:49 +0200)]
Bug 28207: Fix biblio_framework.frameworktext isn't in GROUP BY
When a new framework is created and "Marc structure" is opened, a SQL
error happened if sql_strict_mode is on.
Test plan:
Create a 2 new biblio frameworks
Click "Marc structure" for one of them
=> You see the list of all frameworks with an existing structure
Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net> Signed-off-by: Julian Maurice <julian.maurice@biblibre.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Jonathan Druart [Fri, 23 Apr 2021 13:37:46 +0000 (15:37 +0200)]
Bug 28217: Prevent several non-repeatable attributes to be merged
When using the patron merge feature it's possible to generate a patron
with several non-repeatable attributes.
This patch prevents that.
Test plan:
Create 2 patron attribute types, one repeatable and one non-repeatable
Create 2 patrons and add them repeatable attributes
Add a non-repeatable attribute to one of them
Merge the 2 patrons
=> It succeeds, the resulting patron has all the repeatable attribute
and the non-repeatable one.
Do it again but this time add non-repeatable to both patrons
Merge them
=> It fails, you should see an error on the UI
Merge failed! The following error was reported: Tried to add more than one non-repeatable attributes. type=TYPE value=VALUE.
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net> Signed-off-by: Julian Maurice <julian.maurice@biblibre.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Jonathan Druart [Fri, 20 Nov 2020 08:04:30 +0000 (09:04 +0100)]
Bug 27061: Remove duplicate permission check in svc/mana/search
There is a call to check_cookie_auth then another one to get_template_and_user
Test plan:
Use mana to create new report and new subscription.
Confirm that you need the necessary permissions to use it
Signed-off-by: Owen Leonard <oleonard@myacpl.org> Signed-off-by: Julian Maurice <julian.maurice@biblibre.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
David Cook [Wed, 28 Apr 2021 04:53:07 +0000 (04:53 +0000)]
Bug 28244: Fix typo in Ukrainian in language tables in English
This changes the English of Ukranian to Ukrainian.
1) Apply patch
2) Go to http://localhost:8080/cgi-bin/koha/opac-search.pl
3) Click on "Language" drop-down
4) Note near the bottom it says "Ukrainian" instead of "Ukranian"
Signed-off-by: Henry Bolshaw <bolshawh@parliament.uk> Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Jonathan Druart [Thu, 29 Apr 2021 08:43:31 +0000 (10:43 +0200)]
Bug 28258: Fix existing occurrence
I think it's good to fix the original problem as well
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Lucas Gass [Wed, 28 Apr 2021 20:48:37 +0000 (20:48 +0000)]
Bug 28258: Update bad formatting in AUTO_RENEWALS notice
To test:
-Look at the AUTO_RENEWALS notice and see the syntax [% checkout.date_due as_due_date => 1 %]
-Apply patch, updatedatabase
-Look at the AUTO_RENEWALS notice and see the syntax [% checkout.date_due | $KohaDates as_due_date => 1%]
Additional test:
1 - Checkout an item to a patron
2 - Find their borrowernumber, the itemnumber, and the biblionumber
3 - Use the get_prepared_letter script to test the letter content
perl misc/devel/get_prepared_letter.pl --module circulation --letter-code AUTO_RENEWALS --tables="{\"borrowers\": 5,\"issues\": 1040,\"items\": 1040,\"biblio\": 2 }"
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Jonathan Druart [Thu, 22 Apr 2021 12:20:27 +0000 (14:20 +0200)]
Bug 27811: Hide payment buttons if not enough permission
If the logged in librarian does not have the updatecharges >
remaining_permissions subpermission, we should hide the 2 "Make payment"
and "Pay all fines" button from the patron detail/circ page.
Test plan:
1 - Grant an account circulation/staffaccess permissions and any subpermissions in updatechagres but NOT 'remaining_permissions'
2 - Add some charges to a patron account
3 - Sign in with the account created in #1
4 - Bring up the patron you added charges to
=> The two buttons are not displayed
Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Martin Renvoize [Wed, 28 Apr 2021 09:21:14 +0000 (10:21 +0100)]
Bug 27636: (QA follow-up) Fix tests and validate
This patch fixes the tests for when a negative amount is passed to the
pay method. Prior to now, a negative amount would have been passed
through and recorded. This was inconsistent with all other accounts
methods and has been deprecated to ensure consistent amounts handling.
This patch also introduces basic validation to prevent negatives being
entered into the UI.
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Bug 28202: Pickup libraries must be sorted by name when placing hold
When placing hold, the pickup libraries are not sorted by name but by code.
You can see in other places : pickup_locations() calls
Koha::Libraries->search with { order_by => ['branchname'] }
Test plan :
1) Go to staff interface
2) Create a new libary with code 'AAA' and name 'ZZZ'.
2) Select a record
3) Begin placing hold
4) Look at list in "Pickup at:"
=> Without patch library 'ZZZ' is first
=> With patch library 'ZZZ' is last
Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Andrew Nugged [Mon, 19 Apr 2021 12:02:09 +0000 (15:02 +0300)]
Bug 28169: Add quotes around value in template to render proper JS
There is code in request.tt:
homebranch: "[% ... %]",
holdallowed: [% ... %]
There only digits where expected earlier in holdallowed
but now it can be string value ('from_any_library' for example),
so it should be in quotes.
To reproduce the problem:
1. Add circulation rules which allow 1 hold only to the itemtype
2. Make sure AllowHoldPolicyOverride syspref enabled
3. Make 1 hold to patron for any biblio which has a few items available,
for example on "reset_all dev db set":
/cgi-bin/koha/reserve/request.pl?biblionumber=4&findborrower=1
(this biblio record has 4 items)
4. Start another hold for same patron on any biblio record or the same,
and keep browser's JS console open,
for example on "reset_all dev db set":
/cgi-bin/koha/reserve/request.pl?biblionumber=4&findborrower=1
5. You should see now JS error in browser console:
Uncaught ReferenceError: from_any_library is not defined
Uncaught ReferenceError: columns_settings_borrowers_table is not defined
6. Apply the patch
7. Repeat the steps 4-5 (reload the page) and now the JS error should be gone
Signed-off-by: Owen Leonard <oleonard@myacpl.org> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Nick Clemens [Wed, 14 Apr 2021 15:17:53 +0000 (15:17 +0000)]
Bug 28148: Remove 'print' class from 'Print transfer slip' when transfer exists
The 'print' class triggers JS to create the transfer and update a form
When a transfer exists we have no form and use 'openWin' to trigger the
print
Also, I remove a stray '1' in the template
To test:
1 - Set AutomaticItemReturn to "Don't"
2 - Check in an item from another branch
3 - Confirm the transfer
4 - Check it in again
5 - Click 'Print slip'
6 - Note error in console:
Uncaught TypeError: this.form is null
7 - apply patch
8 - Repeat
9 - No error!
Signed-off-by: Owen Leonard <oleonard@myacpl.org> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Nick Clemens [Sat, 27 Feb 2021 17:48:29 +0000 (17:48 +0000)]
Bug 27819: Fix Object POD
Signed-off-by: Owen Leonard <oleonard@myacpl.org> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Nick Clemens [Sat, 27 Feb 2021 17:24:56 +0000 (17:24 +0000)]
Bug 27819: Spurious item deletion errors from delete_records_via_leader.pl
The job reports errors when deleting items.
The issue seems to be that Koha::Object->delete claims in the POD to
return -1, 0, or 1 as a result, but it in fact returns the Object
itself on a successful deletion
The errors are reported as:
ERROR DELETING ITEM 501740: Koha::Item=HASH(0x55ce407a1a78)
To recreate:
1 - Find or create a record with some items
2 - Ensure those items can be deleted (not on loan, etc.)
3 - Edit the record leader and set position 5 to 'd'
4 - perl misc/cronjobs/delete_records_via_leader.pl -i -v --confirm
5 - Deletion succeeds, but reports failure on items
6 - Apply patch
7 - Find or create a new record as above, but this time add an
additional item and check it out to a patron
8 - perl misc/cronjobs/delete_records_via_leader.pl -i -v
9 - Test mode should report 1 item to be deleted, one with error
10 - perl misc/cronjobs/delete_records_via_leader.pl -i -v --confirm
11 - One item should be deleted, one item not, record not deleted
12 - check the item in
13 - perl misc/cronjobs/delete_records_via_leader.pl -i -v --confirm
14 - Successful deletion with no error reported
Signed-off-by: Owen Leonard <oleonard@myacpl.org> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Nick Clemens [Wed, 7 Apr 2021 13:56:56 +0000 (13:56 +0000)]
Bug 17202: Don't report an item in a collection if the collection doesn't exist
This simply adds a JOIN to the collections table - if the collection is gone
then the item is not considered to be in a rotating collection
Also remove variable to store the return that is not used later
To test:
Create a rotating collection
Add an item
Delete the rotating collection
View the db (SELECT * FROM collections_tracking;)
The item is still in the collection
Enable AutomaticItemReturn
Checkin the item at a branch not its home
The item does not get transferred home
Apply patch
Restart all the things
Check in the item, it is transferred home
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>
Jonathan Druart [Mon, 26 Apr 2021 09:10:11 +0000 (11:10 +0200)]
Bug 28213: Prevent crash if patron or club deleted after search to hold
Deleting a patron or patron club causes server error on searching.
To recreate:
- create a club template
- create a club
- enroll a patron in the club
- from the clubs page, select Search To Hold for your club
- do a search, see that it says "Hold for [club name]" in your search results page
- go back to the clubs page and delete your club
- try to perform a search
=> Without this patch you get "Can't call method "name" on an undefined value at /kohadevbox/koha/catalogue/search.pl line 207"
Same when placing a hold for a patron (check the search result and the
detail pages)
Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Jonathan Druart [Wed, 3 Mar 2021 11:21:33 +0000 (12:21 +0100)]
Bug 27842: Update serial.biblionumber when a subscription is linked with another record
It seems that a librarian can edit the biblionumber for a given subscription, however, when receiving serials the biblionumber is pulled from the existing serials, so all new received issues are received on the old biblionumber.
This is problematic in light of bug 21901 - you can change the biblionumber, the serials still point to the old biblionumber - and deleting the biblio deletes the serials. Additionally, the update will delete serials where this was the case
Test plan:
1 - Create a new subscription
2 - Receive an issue
3 - Edit the subscription and change the biblionumber
4 - Receive another issue
5 - SELECT biblionumber FROM serial
=> the biblionumber link must have been updated
Signed-off-by: Petro Vashchuk <stalkernoid@gmail.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Jonathan Druart [Wed, 3 Mar 2021 11:21:20 +0000 (12:21 +0100)]
Bug 27842: Add tests
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Bug 28230: Store C4::Message->{metadata} as Perl string always
When loading C4::Message->{metadata} we load it as perl string in all
other cases, see e.g. the subroutine find_last_message(). In this one
case we incorrectly populate the C4::Message->{metadata} as an UTF-8
octet instead of a Perl string. This causes a problem later on because
encode_utf8 later on in the line:
excepts a perl string and not a UTF-8 octet (please refer to the
functions perldoc). This breaks the encoding and causes an internal
server error:
To test the error is gone:
1. Create biblio with "AE" (bugzilla doesn't let me write the real
letter here, see it in the bugzilla comments) in title
2. Enable RenewalSendNotice
3. Enable "Item checkout and renewal" message preference for patron
4. Checkout an item from biblio "AE" to patron
5. Try to renew the patron's loan and notice the renewal fails
6. Apply patch and restart plack
7. Notice renewal works now and message h's the AE letter displayed correctly
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Jonathan Druart [Tue, 27 Apr 2021 08:06:39 +0000 (10:06 +0200)]
Bug 28230: Regression tests
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Bug 28230: Add execute bit to test
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Bug 28234: TestBuilder->build_sample_biblio should set UTF-8 encoding for record
This patch makes the build_sample_biblio method, correctly set the UTF-8
flag for the MARC::Record object.
Tests are added.
To test:
1. Apply the regression tests patch
2. Run:
$ kshell
k$ prove t/db_dependent/TestBuilder.t
FAIL: Tests fail! An unexpected encoding warning shows
3. Apply this patch
4. Repeat 2
=> SUCCESS: No warning! Tests pass!
5. Sign off :-D
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Petro Vashchuk [Thu, 25 Feb 2021 10:28:17 +0000 (12:28 +0200)]
Bug 27790: separate earliest hold date into two different columns
Currently "Earliest hold date" and "Pickup place" are displayed
in one single column, but to make filtering possible it is necessary
to split those fields into separate ones.
This patch does exactly that and adds sorting list drop down feature to
the "Pickup place" column.
To reproduce:
1) Make a few holds and head over to "Circulations->Holds to pull".
2) Ensure that pickup place and earliest hold date are
in the same column "Earliest hold date"
3) Apply the patch.
4) Check "Circulations->Holds to pull list" again, this time
booking date and pickup place should have their own columns.
Ensure that filtering by "pickup location" works fine.
Signed-off-by: Owen Leonard <oleonard@myacpl.org> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Martin Renvoize [Fri, 19 Mar 2021 12:06:31 +0000 (12:06 +0000)]
Bug 27636: Update failing test
It would appear that ->pay didn't fully respect AccountAutoReconcile!
Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Martin Renvoize [Fri, 19 Mar 2021 12:00:36 +0000 (12:00 +0000)]
Bug 27636: Update ->pay to use ->payin_amount internally
This patch is an interim patch to update Koha::Account->pay to use the
new Koha::Account->payin_amount method internally. It simply utilises
that method for the logic and acts as an input/output shim for
compatability and to allow us to use the existing tests.
Test plan
1/ Run t/db_dependent/Koha/Account.t
Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Martin Renvoize [Fri, 5 Feb 2021 12:56:43 +0000 (12:56 +0000)]
Bug 27636: Add payin_amount to Koha::Account
This patch adds a `payin_amount` method to the Koha::Account as a modern
replacement to the `pay` method.
The new method uses the `add_credit` and `Koha::Account::Line->apply`
methods internally for consistency and returns the created credit
Koha::Account::Line result.
Test plan
1/ Run t/db_dependent/Koha/Account.t
Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>