This patch makes the method return an actual array instead of a
comma-separated string. The API spec is adjusted so it also expects an
array in the response.
Tests are adjusted for the new return value.
To test:
1. Apply this patch
2. Run:
$ ktd --shell
k$ yarn api:bundle
k$ prove t/db_dependent/Koha/Item.t
=> SUCCESS: Tests pass!
3. Sign off :-D
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Although we're reverting 32216, we still want to be able to force print notices as per the original intent.
This patch adds that into queue_notices, rather than in the cronjob
Co-authored-by: Jake Deery <jake.deery@openfifth.co.uk>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
This reverts commit 3040f46d5e.
Bug 30300 adds a patron messaging preference for the expiration notice and abstracts this logic into queue_notice
Bug 32216 removes this call to enable print notice functionality but this would be handled already by queue_notice based on the patron's messaging preferences
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
The patches on this bug add the ability for staff members to set the patron expiry notice as mandatory at the category level. When set, the cronjob will automatically send an expiry notice regardless of existing messaging preferences. If it is turned off, the old messaging preferences will still be in place and actioned
Test plan:
1) Apply patch and run updatedatabase
2) In system preferences set MembershipExpiryDaysNotice to 5
3) Choose a patron and edit their expiry date to today's date, ensuring they have a primary email set
4) Create a MEMBERSHIP_EXPIRY notice (content of the notice is irrelevant, just needs to exist)
5) Run perl misc/cronjobs/membership_expiry.pl -c -v -before 10 -after 10
6) Check the patron's messages, there should be no expiry notice queued
7) Set the patron's category 'enforce expiry notice' field to Yes
8) Repeat step 5, there should be a notice queued
9) Set that patron's primary contact method to primary email and run step 5 again
10) There should be a notice queued for an email
11) Set the category level enforce expiry notice back to No
12) Choose a second patron and set an email address, expiry date to today and set the patron expiry messaging preference for that patron to 'email'
13) Repeat step 5 - this time only one notice should be queued on the second patron, no new notice should queue for the first
14) Re-set the category level option to Yes
15) Repeat step 5 - this time both patron's should have notices queued
16) Unset the category level option again, the behaviour should be the same as step 13
17) Set the category level option back to Yes and check the patron messaign preferences menus in both the OPAC and Staff client - the patron expiry option should not be visible while the cateogry level enforcement is set to Yes
Signed-off-by: Hanna Leiker <tech.hanna@salinapublic.org>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Hanna Leiker <tech.hanna@salinapublic.org>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Hanna Leiker <tech.hanna@salinapublic.org>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Hanna Leiker <tech.hanna@salinapublic.org>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
With Bug 36552 we set 'date entered on file' (MARC21: 008/0-5)
of a record created by duplication of an existing record to the current
date instead of having there the value from the original record.
The same should be done for the advanced editor (for now, it retains
the date of the original record).
Test plan:
==========
1. Enable EnableAdvancedCatalogingEditor systempreference.
2. Open any record in advanced editor to make it default. Go back to
record normal display.
3. Make a duplicate: Edit > Edit as new (duplicate)
4. Note that the date in 008/0-5 is of the original record, not of
today.
5. Apply the patch ; restart_all.
6. Repeat p. 3. The date in 008/0-5 should be of the today. If not,
refresh browser's cache (Ctrl+Shift+R etc.) to get the fresh
version of the JS.
Signed-off-by: Roman Dolny <roman.dolny@jezuici.pl>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Test plan:
1. Tests should pass: prove t/db_dependent/Koha/Item.t
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
When IndependentBranches is enabled, canreservefromotherbranches
set to don't allow is also required to prevent non-superlibrarians
from placing holds in other libraries.
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
When IndependentBranches is enabled and canreservefromotherbranches
is set to don't allow, then non-superlibrarians should not be able to
place holds for other libraries.
Test plan:
1. Appy the patch.
2. In Koha administration > System preferences, set:
- IndependentBranches: Yes
- canreservefromotherbranches: Don't allow
3. In Koha administration > Circulation and fines rules, check that
you have a rule for all patron categories and all item types, with
unlimited holds.
4. Find (or create) a staff patron for a library other than Centerville:
- Change the username and password so you can log in as the
staff patron.
- Add permissions to the staff patron (More > Set permissions):
. Staff access, allows viewing of catalogue in staff interface
. Add, modify and view patron information
. Place and modify holds for patrons
5. Find (or create) a patron with the same home library as the
staff patron in step 4.
6. Find (or create) a record with an item where the home and
current library are the same as the staff patron in step 3 and the
patron in step 5.
7. As a superlibrarian place a hold for the record from step 6
using the patron from step 5:
- If placing a hold for the next available item, the "Pickup at"
dropdown list should list all libraies.
- If placing a hold on a specific item, the dropdown list for the
"Allowed pickup locations" column for each item should also list
all libraries.
- After placing the hold, in the "Existing holds" table, the dropdown
list for each hold in the "Pickup library" column should
also list all libraries.
8. Log out from the staff interface and login with the staff patron
from step 4.
9. Find the record from step 6 and place a hold using the patron from
step 5 - the library dropdown list should be limited to the
item's home library:
- If placing a hold for the next available item, the "Pickup at"
dropdown list should only list the item's home library.
- If placing a hold on a specific item, the dropdown list for the
"Allowed pickup locations" column for each item should also only
list the item's home library.
- After placing the hold, in the "Existing holds" table, the
"Pickup library" column should now only show the item's home
librayr, with no dropdown list.
Signed-off-by: Anni Rajala <anni.rajala@turku.fi>
Signed-off-by: baptiste <baptiste.bayche@inlibro.com>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
->connect does not raise an exception, so we didn't reached the catch
block.
Adjusting the code but I am not really happy with it, but more changes
will derail the original bug
Now we log:
Cannot connect to broker (Access refused for user 'guest') at /kohadevbox/koha/Koha/BackgroundJob.pm line 96.
Cannot connect to the message broker, the jobs will be processed anyway at /kohadevbox/koha/misc/workers/background_jobs_worker.pl line 100.
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: Katrin Fischer <katrin.fischer@bsz-bw.de>
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: Katrin Fischer <katrin.fischer@bsz-bw.de>
This patch suggests to deal with connection issues at
Koha::BackgroundJob->connect level.
It incorrectly returned a Net::Stomp object when the connection failed.
With this patch, if the CONNECT does not return a CONNECTED frame then
Koha::BackgroundJob->connect returns nothing and the caller is not
fooled.
It also fixes the about page, we now have:
"Using SQL polling (Fallback, Error connecting to RabbitMQ)"
instead of
"Using RabbitMQ"
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: Katrin Fischer <katrin.fischer@bsz-bw.de>
This change adds error handling for ERROR frames to background_jobs_worker.pl.
A previous patch added it to es_indexer_daemon.pl which is a different
background jobs worker.
To test ERROR handling for background_jobs_worker.pl:
1. Change your RabbitMQ connection details in koha-conf.xml or the hard-coded ones in Koha/BackgroundJob.pm
to include an invalid password. For example, if you don't have a message_broker already defined, use the following:
<message_broker>
<password>bad</password>
</message_broker>
2. sudo koha-worker --restart --quiet kohadev
3. View the errors in the logs:
tail -f /var/log/koha/kohadev/worker-output.log
tail -f /var/log/koha/kohadev/worker-error.log
To test MESSAGE handling for background_jobs_worker.pl:
1. Ensure RabbitMQ connection details are correct
2. Go to Batch item modification and add the following barcodes:
39999000001310
39999000004571
3. Add a z - Public Note of the following and click Save:
THEBACKGROUNDWORKERWORKED
4. Search the catalogue using THEBACKGROUNDWORKERWORKED in the top
catalogue search
5. Note that you get 2 results in your search
6. Look in the logs just to make sure there are no new messages there
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: Katrin Fischer <katrin.fischer@bsz-bw.de>
This change causes es_indexer_daemon.pl to die on ERROR frames instead
of spinning in an infinite loop. It also adds a content-type STOMP frame header
to help consumers know what data type is in the MESSAGE frame body.
To test ERROR handling for es_indexer_daemon.pl:
1. Switch to using Elasticsearch
2. Change your RabbitMQ connection details in koha-conf.xml or the hard-coded ones in Koha/BackgroundJob.pm
to include an invalid password. For example, if you don't have a message_broker already defined, use the following:
<message_broker>
<password>bad</password>
</message_broker>
3. sudo koha-es-indexer --restart kohadev
4. View the errors in the logs:
tail -f /var/log/koha/kohadev/es-indexer-output.log
tail -f /var/log/koha/kohadev/es-indexer-error.log
To test MESSAGE handling for es_indexer_daemon.pl:
1. Switch to using Elasticsearch (and ensure RabbitMQ connection details are correct)
2. Change the title of a bib record to something new and unique
3. Try to search for the bib using the new title
4. Note you can find it
5. Look in the logs just to make sure there are no messages there
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: Katrin Fischer <katrin.fischer@bsz-bw.de>
Test plan:
1) Either add loads of suggestions to your KTD or use the script in the data script patch uploaded to the bug
2) Navigate to Acquisitions > Suggestions
3) Depending on how many suggestions you have loaded (the script does 2000), the page will load very slowly
4) Apply patches
5) yarn build && restart_all
6) Hard refresh the page, the page should load much faster and the first tab should load a paginated datatable
7) Click into another tab, the tab should also load a paginated datatable
8) Click back into the first tab, the original table should persist and should not reload
9) Use the edit tools at the bottom of the page, they should work as expected
10) Click on the links in various table cells, they should redirect as expected
11) Use the actions buttons in the far right column, then should work as expected
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Lisette Scheer <lisette@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
This patch removes the existing process intensive searches and moves the search logic to a single group query that returns the values that will be the counts in the tabs. It then formats the parameters for each type and passes them to the template for the datatables ajax requests
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Lisette Scheer <lisette@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
This patch adds a strings_map method to allow the API to return the required authorised values needed for table displays
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Lisette Scheer <lisette@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
This patch fixes the serial collection table to sort in descending order on the date published column.
To test:
1. Create a subscription if you don't already have one.
2. Go to the Serial Collection tab using the left navigation.
3. Click the Generate Next button a bunch of times to generate some serial issues. Note that the issues are displaying in the table in ascending order, with the oldest date published at the top.
4. Apply the patch and refresh the page
5. Confirm the issues are now displaying in the table in descending order, with the newest date published at the top.
6. Click the Generate Next button again and confirm the issue is inserted at the top of the table.
Sponsored-by: Pymble Ladies' College
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Perl can interpolate hashrefs but not method calls. This results in messages like "Cannot connect to Koha::Schema::Result::VendorEdiAccount=HASH(0xaaab059252f0)->host: Name or service not known: My Test at ./misc/cronjobs/edi_cron.pl line 58." when running the edi_cron.pl cronjob.
Test Plan:
1) Enable EDIFACT
2) Create a fake EDI account with a bad FTP server in it
3) Run edi_cron.pl
4) Note the errors like:
Cannot connect to Koha::Schema::Result::VendorEdiAccount=HASH(0xaaab059252f0)->host: Name or service not known: My Test at ./misc/cronjobs/edi_cron.pl line 58.
5) Apply this patch
6) Run edi_cron.pl
7) Note the errors are now like:
Cannot connect to test.example.com: Name or service not known: My Test at ./misc/cronjobs/edi_cron.pl line 58.
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
To test:
1. Have some orders that are late.
2. Go to the late orders page (
http://localhost:8081/cgi-bin/koha/acqui/lateorders.pl )
3. Try to use the export function, nothing happens.
4. APPLY PATCH
5. Try steps 1 and 3 again, this time the export function should work.
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
This patch updates some administration templates so that library
selection uses a Select2-styled menu instead of a standard <select>.
Item types, patron categories, and authorized values all offer a
"library limitation" option, and Select2 will make library selection
behave like item search options do.
To test, apply the patch and rebuild the staff interface CSS.
- Go to Administration -> Item types and edit an item type.
- On the "Library limitation" line, click the field to trigger the
Select2 menu. Confirm that it works as expected.
- Save your changes to confirm that the data is saved correctly.
- Edit the item type again to clear all your selections and confirm that
it saves correctly.
- Repeat the same process on the authorized values page and the patron
categories page.
Sponsored-by: Athens County Public Libraries
Signed-off-by: Janne Seppänen <janne.seppanen@lahti.fi>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
This patch adds Select2 functionality to the select[multiple] fields on
the patron attributes and batch extend due dates pages.
To test, apply the patch and go to Administration -> Patron attribute
types.
- Create or edit a patron attribute type.
- Test the "Library limitation" field: Selecting a single or multiple
library and clearing selections.
- Save your changes and confirm that your selections were saved
correctly.
- Perform the same test on Tools -> Batch extend due dates:
- Test the patron categories, item types, and libraries fields.
Sponsored-by: Athens County Public Libraries
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
This patch changes the sample MEMBERSHIP_EXPIRY email notice to Template
Toolkit syntax.
To test:
1. Apply patch and reset_all
2. Go to Tools > Notices and slips
3. Check the MEMBERSHIP_EXPIRY email notice, make sure everything looks good (TT syntax, grammar and spelling OK)
4. Add a value in MembershipExpiryDaysNotice
5. Change a patron's account so that it expires in the number of days in MembershipExpiryDaysNotice
6. Add an email address in the patron's account
7. Run /misc/cronjobs/membership_expiry.pl -c
8. Go to the patron's notices and check that the text of the notice was generated correctly and that the grammar and spelling are OK
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
This patch updates the credit and debit type administration templates so
that library selection uses a Select2-styled menu instead of a standard
<select>. Both pages offer a "library limitation" option, and Select2
will make library selection behave like item search options do.
To test, apply the patch and rebuild the staff interface CSS.
- Go to Administration -> Credit types edit a credit type.
- On the "Library limitation" line, click the field to trigger the
Select2 menu. Confirm that it works as expected.
- Save your changes to confirm that the data is saved correctly.
- Edit the credit type again to clear all your selections and confirm
that it saves correctly.
- Repeat the same process on the debit types page.
Sponsored-by: Athens County Public Libraries
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
This patch restores the ability to export late serial claims to CSV
Test plan:
1) Create a new subscription, setting the vendor id as 1
2) Set the subscription start date as yesterday's date, the other
details aren't relevant so set whatever you want
3) Click into claims
4) If you get a warning saying no claims notice is defined then click
the link to define one (on the dropdown for the 'New notice' button
you want 'Claim serial issue. The content of the notice isn't
relevant here so input anything). Then head back to the claims page.
If no warning shows, proceed to the next step
5) Choose My Vendor and hit OK
6) You should see a table of claims with the first issue for your new
serial
7) Click the checkbox next to the row
8) Click the 'Download selected claims' button at the bottom
9) The CSV will download
10) Click into it - it will have the header but the rows will be blank
11) Apply patch
12) Hard refresh the page
13) Click the download button again
14) Check the new file, the rows will be filled out correctly with data
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
To test:
1 - go to the log viewer in tools, perform a search
2 - observe the diff column is visible by default
3 - apply patch, reset_all
4 - reload log viewer, repeat search
5 - observe the diff column is now hidden by default
6 - confirm you can toggle diff visibility in the log viewer page
7 - go to column settings and confirm you can toggle diff visibility there
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
This patch adds a hook for adding information to notices context from
plugins.
The method is passed all the `GetPreparedLetter()` paramerters so it
gets all the context for calculating the values to pass the template.
The main target use for this hook is ILL, where we need to identify
candidate ILL requests related to the filled hold for printing the right
ILL-related message.
The implementation is generic so it can be used for any other use case.
To test:
1. Apply the unit tests
2. Run:
$ ktd --shell
k$ prove t/db_dependent/Koha/Plugins/Notices_content_hook.t
=> FAIL: The hook is not implemented, the letter doesn't include
plugin-calculated data the tests expect.
3. Apply this patch
4. Repeat 2
=> SUCCESS: Tests pass!
5. Sign off :-D
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Lisette Scheer <lisette@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Test plan, k-t-d:
1) Before defining any additional fields for account_credit_types,
confirm that the 'Additional fields' section does not appear when
attempting to add a new or edit an existing credit type.
2) Add a new additional field to 'account_credit_types':
<staff_url>/cgi-bin/koha/admin/additional-fields.pl?tablename=account_credit_types
3) Click 'New field'. Add a name. Click Save.
4) Repeat step 2 but repeatable. Repeat again for 2 more of AV category
(one repeatable, one not repeatable)
5) Edit an account credit type:
<staff_url>/cgi-bin/koha/admin/credit_types.pl?op=add_form&code=MANUAL
6) Input various values in the different additional fields. Click
'Submit'
7) Edit the same credit type again and note the additional fields added
in the previous step are visible
<staff_url>/cgi-bin/koha/admin/credit_types.pl?op=add_form&code=MANUAL
Sponsored-by: PTFS Europe <https://ptfs-europe.com>
Signed-off-by: Hannah Dunne-Howrie <hdunne-howrie@westminster.gov.uk>
Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>