It failed inconsistently, let's try to use build_sample_item and see if
it fixes the random failures.
Test plan:
% prove t/db_dependent/Patron/Borrower_PrevCheckout.t
must return green
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
# Failed test 'DelSuggestion deletes the correct suggestion'
# at t/db_dependent/Suggestions.t line 413.
# got: 'my title 3'
# expected: 'my deleted title'
t/db_dependent/Suggestions.t .. 112/113 # Looks like you failed 1 test of 113.
Suggestions were returned in the reverse order. Adding an ORDER BY clause fixes the problem.
Test plan:
% prove t/db_dependent/Suggestions.t
must return green
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
This patch modifies the event handler on the individual "Mark seen" /
"Mark unseen" buttons in the table of checkout notes. For an event to be
successfully attached to a hidden element it must be given a context.
To test you should have multiple checkout notes to work with, both seen
and unseen. Apply the patch and go to "Checkout notes pending" from the
staff client home page.
- Navigate to the second "page" of data in the DataTable.
- Test the functionality of the "Mark seen" and "Mark unseen" buttons.
They should work correctly.
Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
This patch changes the way checkbox events are handled on the checkout
notes page so that checking a checkbox enables the batch operation
controls.
Note: The addition of a "markseen" class is a preventative measure to
avoid future problems where using the "btn-small" class might not be
specific enough.
To test you should have multiple checkout notes to work with, both seen
and unseen. Apply the patch and go to "Checkout notes pending" from the
staff client home page.
- Check any checkbox. The "Mark seen" and "Mark not seen" should go
from disabled to enabled.
- Test that the buttons work correctly.
- Click the "Select all" and "Clear all" controls and confirm that the
buttons are enabled and disabled correctly.
Signed-off-by: Andrew Fuerste-Henry <andrew@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: Michal Denar <black23@gmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Invalid 008 with helper silently fails to save.
This patch adds a "else if" to fall through if the error message isn't
one of the previously defined ones ("syntax" and "invalid") and presents
the human with a generic message that "Something went wrong, cannot
save."
Prior to testing:
a/Verify that Advanced Editor is enabled
b/Download the errorrecord.mrc from bug
To test:
1/Apply patch
2/Go to Cataloging->Advanced Editor
3/Click "Import Record" button and navigate to the record saved from
step b/
4/Add an 003 field (as required by the default cataloging config)
5/Hit "Save to catalog"
6/Verify that a message is passed to the user that the file was unable
to be saved
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Same fix for the intranet side
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
TO TEST:
1. Make an OPAC search with plenty of results.
2. Use the search facets to limit the search in some way, item type, author, etc.
3. Click on 'Limit to currently available items', everything is still fine.
4. Attempt to return to 'Show all items', there will be no search results.
5. Apply patch
6. Ateempt steps 1-4 again.
7. Should work this time.
Signed-off-by: Rhonda Kuiper <rkuiper@roundrocktexas.gov>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
This patch makes minor corrections to the basic MARC editor CSS, fixing
an error caused by Bug 23259.
To test, apply the patch and clear your browser cache if necessary.
Open the basic MARC editor and check the numbered tabs. There should be
no stripe of green background showing below the tabs.
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Guillaume Paquet <guillaume@inlibro.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: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
As shown in the comments on the bug, it appears that Unicode::Normalize
is the most reliable way to strip accents from strings for this use
case.
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
This patch corrects a typo in the cash register template.
To test:
1) Go to Administration > Global system preferences
2) Search for UseCashRegisters
3) Enable UseCashRegisters and save
4) Go to Administration > Cash registers
5) Click on 'New cash register'
6) Notice the title says 'Add new cash_register'
7) Apply patch
8) Refresh and notice it now says 'Add new cash register'
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
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>
This enhancement adds a refined workflow to allow librarians
to refund payments to patrons and record these refunds on the
patrons account.
The use case is that a patron has paid for something before
then performing an action that may require some level of refund
to be actioned. Perhaps they are returning a lost and paid for
book.
Test plan:
1) Undertake a series of transactions that result in a debit
accountline being partially or fully paid off.
2) Note that a new 'Issue refund' button appears next to a
debit (but only if your user has the refund permission or
is a superlibrarian)
3) Click the 'Issue refund' button and a modal should appear
pre-populated with the amount - amountoutstanding.
4) You should be able to edit the amount you wish to refund,
record the refund or cancel.
5) Signoff
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>
Add a new subpermission called 'refund' to the 'updatecharges'
permission group which will allow/prevent refund actions to be
performed by staff.
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>
This enhancement adds a 'reduce' method to Koha::Account::Line which can
be used to reduce a charge/debit by adding a credit to offset against
the amount outstanding.
It may be used to apply a discount whilst retaining the original debit
amounts or to apply a full or partial refund for example when a lost
item is found and returned.
The created credit will be immediately applied against the debit unless
the debit has already been paid, in which case a 'zero' offset will be
added to maintain a link to the debit but the outstanding credit will be
left so it may be applied to other debts.
Test Plan:
1) Run the included tests and verify they pass.
2) Signoff
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>
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>
When an add for biblio or item is recorded there is no space in the info field
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
This patch adds a link to the the biblio that shows the biblionumber of the item. It makes things a little more obvious
To test:
1 - Find a biblio with an item where an itemnumber on another biblio is equal to that biblionumber
i.e. In the sample data:
biblionumber 59 with item with itemnumber 127
item with itemnumber 59 on biblionumber 23
2 - Edit both items however you wish
3 - On biblionumber 59 click the modification log
4 - You should see "Item 127"
5 - Click "Submit" on the form - this searches as itemnumber
6 - You should see "Item 59"
7 - Apply patch
8 - On biblionumber 59 click the modification log
9 - You should see "Item 127 from Biblio 59"
10 - Click "Submit" on the form - this searches as itemnumber
11 - You should see "Item 59 from Biblio 23"
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
To dissociate a search on biblio and item, we pass a new "object_type"
parameter to viewlog.pl. If equals 'biblio' we will assume that "object"
contains a biblionumber
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
The 'Modification log" link in the cataloguing module returns confusing
results. The 'object' parameter is the biblionumber, but the all log
from itemnumber=biblionumber will be displayed as well.
Since bug 11473 we have the action_logs.info column that is prefixed by
'item ' or 'biblio ' to disociated an item modification from a biblio
modif.
This patch suggests a quick and dirty approach, use this column to make
sure we are searching for the correct logs.
/!\ As bug 11473 did not update the existing rows, we will no longer display
the logs created prior to this change.
Test plan:
Make sure you have at least 2 bibliographic records with some items
Make sure you have the biblionumbers of those records that match
existing itemnumbers
Edit them (no matter what you change)
Go to the bibliographic detail page (staff) and click "Modification log"
You should see the correct changes.
Signed-off-by: hc <hc@interleaf.ie>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
From
commit 295ae33800
Bug 20272: Replace error numbers by codes in XSLT_Handler
"""
Make XSLT_Handler a little bit less noisy by defaulting print_warns to
false unless $ENV{DEBUG} is set. (See also bug 19018).
"""
I think we should warn the errors in the logs. They are not debug messages here, we should not rely on DEBUG.
If too noisy we should fix the original issues, not hide all the errors (which make the XSLT debugging super hard)
Test plan:
Break a XSLT, reload the page and confirm that there are useful errors in the Koha log file
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
If elastic is used as search engine, the bulkmarcimport.pl will not
handle correctly UTF-8 encoded MARCXML
Koha::SearchEngine::Search->new uses a require statement to load the correct Search module.
This is done l.257 of bulkmarcimport.pl:
257 my $searcher = Koha::SearchEngine::Search->new
Koha::SearchEngine::Elasticsearch::Search will `use MARC::File::XML`, and so resets the arguments set before:
216 $MARC::File::XML::_load_args{BinaryEncoding} = 'utf-8';
220 $MARC::File::XML::_load_args{RecordFormat} = $recordformat;
An easy (but dirty) fix could be to move the declaration of my $searcher before in the script.
The tricky (but correct) fix would be to remove the long standing "ugly hack follows" comment.
This patch is the easy, and dirty, fix
Test plan:
Use the command line tool to import MARXCML records that contains unicode characters into Koha
Something like `misc/migration_tools/bulkmarcimport.pl -biblios -file record.marcxml -m=MARCXML`
Without this patch you will notice that unicode characters will not be displayed correctly
Signed-off-by: Michal Denar <black23@gmail.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Add a bit of missing POD whilst we're working in here
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Hourly loans can be short enough to not cross a day boundary and as such
we should test for that scenario in the hour_between tests too.
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
This patch does not change anything, just a bit of cleaning
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
This patch adds a number of summation methods to Koha::Account::Lines
giving quick access to overall total, total credits and total debits.
Test plan
1) Run the included tests
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
When a item-transfer-modal is prompted by returns.tt and the option
"Yes, print slip" is selected the transfer is not initiated and the
modal does not disappear.
The print_slip hidden input must be in the same form as the
submit/button .print, otherwise the browser logs
this.form.print_slip is undefined
Test plan:
1. set AutomaticItemReturn to "don't"
2. Check out an item and attempt to check it in at a branch it doesn't
belong to.
3. When the popup modal appears select 'Yes, print slip'.
=> Observe that the transfer does initiate and the modal closes
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
This patch introduces the OpenAPI definitions required for the orders
endpoint. It matches the voted RFC.
Sponsored-by: Camden County
Signed-off-by: Matthias Meusburger <matthias.meusburger@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
This patch makes the objects.search helper use the koha.embed structure
that is embedded in the authenticate_api_request step.
This way, any controller using it will benefit from automatic embed
handling.
To test:
1. Apply this patch
2. Run:
$ kshell
k$ prove t/db_dependent/Koha/REST/Plugin/Objects.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>
This patches implement the /acquisitions/orders endpoint.
The attribute names are consistent with the voted RFC
To test:
1. Apply this patchset
2. Run:
$ kshell
k$ prove t/db_dependent/api/v1/acquisitions_orders.t
=> SUCCESS: Tests pass!
3. Test the API with your favourite tool (Postman?)
=> SUCCESS: It works as expected!
4 Sign off :-D
Sponsored-by: Camden County
Signed-off-by: Matthias Meusburger <matthias.meusburger@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
This patch implements unit tests for the orders endpoint.
Sponsored-by: Camden County
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
This patch introduces a helper for handling x-koha-embed headers on API
requests. It reads the embed definitions and adds them to the stash for
later use (either manually on the controllers, or in the objects.search
helper.
x-koha-embed needs to be defined as a list on the OpenAPI spec.
It throws an exception when invalid combinations are found.
To test:
1. Apply this patch
2. Run:
$ kshell
k$ prove t/Koha/REST/Plugin/Query.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>
This patch makes the parameters for Koha::Object(s)->to_api a hashref
preparing the ground for new parameters. The proposed syntax is:
$object->to_api(
{
embed => {
'items' => {
'children' => {
'homebranch' => {}
}
}
}
}
);
Tests are added for the Koha::Objects implementation and tests for
Koha::Object are adjusted to the new syntax, and a test for the single
result accessor is added as well.
To test:
1. Apply this patches
2. Run:
$ kshell
k$ prove t/db_dependent/Koha/Object.t t/db_dependent/Koha/Objects.t
=> SUCCESS: Tests pass!
3. Sign off :-D
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
This patch makes Koha::Object(s)->to_api have an 'embeds' parameter that
using dot notation (e.g. resource.related_resource.another_one) allows
embedding objects recursively.
To test:
1. Apply this patch
2. prove t/db_dependent/Koha/Object.t
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Agustin Moyano <agustinmoyano@theke.io>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
This patch adds two new relationships to the Koha::Account::Line object.
* credit_offsets - returns all credit type Koha::Account::Offsets
related to this Koha::Account::Line.
* debit_offsets - returns all debit type Koha::Account::Offsets related
to this Koha::Account::Line.
* credits - returns all credits related to this Koha::Account::Line.
* debits - returns all debits related to this Koha::Account::Line.
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Test plan:
prove t/db_dependent/Koha/Objects.t
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>