This patch ensures we catch checkouts that would interfer with the
preparation period set for an existing booking by adding said period to
the bookings search.
We also reduce the proposed due date for the checkout to be confirmed by
the preparation period for the item.
Test plan
1) Set a booking preparation period for an itemtype
2) Add a booking for an item with that itemtype to fall beyond the due
date that the item would be assigned if you were to check it out now
to your test user, but within the number of days you've set for your
preparation period.
3) Attempt to check the item out to your test user.
4) Note that we catch the booking and warn and that the latest return
date suggested take the preparation period into account.
Sponsored-by: Cuyahoga County Public Library <https://cuyahogalibrary.org/>
Signed-off-by: Kristi Krueger <KKRUEGER@cuyahogalibrary.org>
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Sponsored-by: Cuyahoga County Public Library <https://cuyahogalibrary.org/>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Sponsored-by: Cuyahoga County Public Library <https://cuyahogalibrary.org/>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
This patch updates all instances where the current noissuescharge sysprefs are used. They will now use the is_patron_inside_charge_limits method to handle the patron category level limits
Sponsored-by: Cuyahoga County Public Library <https://cuyahogalibrary.org/>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
This patch updates the changed code to set the logged in librarian as
the person who resolved the return claim at checkin/checkout action.
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
We're actioning the change of claim status outside of any block that
checks the $item exists. As such we'll want to add that check in here.
I did consider that this should live inside AddIssue, but on reflection
the librarian may want to not proceed with the issue given other return
values from the CanBookBeIssued call, but you still want the
AutoClaimReturn to fire regardless as you've now found the item.
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
To test:
1. Configure Claims returned
1. Go to Administration > Authorized Values > LOST
2. Add a new authorized value with value:6 and description:Claims returned
3. Go to Administration > System Preferences
4. Set ClaimReturnedLostValue to 6 and save
2. Check out an item to a patron.
1. Mark the item as claim returned
2. Check the item in.
3. A message stating that the item has been claimed as returned pops up with
an option to resolve.
4. Resolve the claim.
3. Check out the item to the patron again.
1. Mark the item as claim returned.
2. Check out the item to a new patron. Select “Yes, check out”
3. Go back to the previous patron. Notice that their claim was not resolved.
4. Apply the patch.
1. Updatedatabase
2. restart_all
3. Go to the system preferences and set the system preference
‘AutoClaimReturnStatusOnCheckin’ to ‘Returned by patron’
4. Set ‘AutoClaimReturnStatusOnCheckout’ to ‘Found in library’
5. Redo step 2
1. When checking the claim returned item in you will now see a message that
says “The previously claimed returned item has been found, automatically
resolving the associated claim.”
2. View the previous patron. Their claim has automatically been resolved
with a status of ‘Returned by patron’
6. Redo step 3
1. Upon checking the item out to another patron you will see a message that
says “The previously claimed returned item has been found, automatically
resolving the associated claim.”
2. View the previous patron. Their claim has automatically been resolved
with a status of ‘Found in library’.
7. Sign off and have a wonderful day!
Sponsored-by: Altadena Library District
Signed-off-by: Andrew Fuerste Henry <andrewfh@dubcolib.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Andrew Fuerste Henry <andrewfh@dubcolib.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Bug 31422 added a warning message when library limitations issue in patron edition page.
We should add this patron's messages in circ and details pages.
Like age limitations.
Test plan:
1) User's login branch and home library is: Centerville
2) Patron category "B - Board" is limited to Franklin
3) Edit a patron with Board category from Centerville
4) A message appears "The patron's current category (Board) is limited to other libraries."
Signed-off-by: Laura Escamilla <laura.escamilla@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Bug 35518 moved some code blocks to after the call to
get_user_and_template() so that userenv would be populated before it
was needed. This caused a couple variables to be set before the
AutoSwitchPatron block could prevent them from being set. Which broke
AutoSwitchPatron functionality. This clears two variable so that
AuthSwitchPatron works again.
The AutoSwitchPatron clears the $borrowernumber variable to switch
patrons. With the AuthSwitchPatron block moved, the $patron variable
still gets set, and the patron doesn't get switched. The clears the
$patron variable too.
Also clear the barcode list.
The AutoSwitchPatron block got moved, and now the @$barcodes variable
gets filled and not cleared. Leading to a 'Barcode not found' error
when the patron is auto switched.
Test plan:
1. Ensure AutoSwitchPatron is turned on.
2. Select the card number of two patron accounts.
3. Find the first patron in circulation.
4. Enter the second patron's card number in the item barcode field to
switch patrons.
5. Observe the error about item barcode not existing, and the patron did
not switch.
6. Apply patch and restart services.
7. Enter the second patron's card number in the item barcode field
again.
8. Observe that the patron was switched with no error about an invalid
barcode.
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Kelly <kelly@bywatersolutions.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
When there are holds waiting for patrons, sometimes the librarian misses
the "Holds waiting here" display. This patch adds a modal popup warning
when checking out an item for a patron with waiting holds.
Test plan:
1) find a user (user1)
2) find a biblio (biblio1)
3) add a hold for biblio1 to user1
(search biblio1 > Holds > find user1 > Place hold)
4) checkout biblio1 to another user if not already checked out
and checkin through circulation page (not through the user page)
> confirm hold
5) there should be a "Holds waiting here (1)" section added on user1 page
6) checkout any items that isn't the one on hold for user1
-> notice it just checks out as normal
7) apply patch and update database
8) go to administration > system preferences > switch "WaitingNotifyAtCheckout" to "Notify"
9) refresh page and redo step 6
-> notice there is now a modal to warn the librarian of a waiting hold
click Ok to proceed with the checkout, click outside the modal to not do anything
10) additionnally, the popup shouldn't appear if we checkout any of
user1's waiting hold
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
Signed-off-by: Mia Kujala <mia.kujala@xamk.fi>
Signed-off-by: Kelly <kelly@bywatersolutions.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
There should be no change in beahavior. Following the test plan from Bug 35840.
To test:
1. APPLY PATCH, restart_all
2. Turn on RecordLocalUseOnReturn
3. Create a Statistical patron.
4. Check an item out to a regular patron.
5. Check the item out to a Statistical patron.
6. This should trigger a return and you will see 2 entries in the statistics table, one for localuse and one for a return.
7. Try checking out an item to the Stats patron that is NOT checked out.
8. You should only see 1 entry, localuse, in the statistics table.
Signed-off-by: Andrew Fuerste Henry <andrewfh@dubcolib.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
This patch fixes a mistake in the circulation controller such that the
proper reduceddue date is passed to the template when a checkout would
overlap with a booking.
I also take the oportunity to enhance the functionality to allow
librarians to set their own reduceddue date between now and the hard
reduceddue as required for the existing booking.
Test plan
1) Set an item to 'bookable'
2) Add a booking to that item for user A for a few days time.
3) Attempt to checkout the item to user B and note the warning that
the item is booked for another user.
4) With the patch applied, a reduced due date of 1 day prior to the
booking should be defaulted to in the displayed date picker.
5) You should be able to select any date between today and the day
before the booking starts
6) Confirm you can checkout with the reduceddue date set.
7) Bonus point, confirm the field is required, so if you try to wipe it
and then checkout, you will be blocked.
Signed-off-by: Kelly <kelly@bywatersolutions.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
We do not longer need to generate_csrf from pl files
TODO - members/boraccount.tt and sco/sco-main.tt needs to be adjusted
Bug 34478: [TO SQUASH] Remove generate_csrf from pl
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Currently we get the userenv before we have set it correctly for the session
To test:
1 - Sign in as a user with fast cataloging permission
2 - Bring up a patron, type gibberish into barcode field to get a fast cataloging link
3 - Check the link, it should have your current signed in barcode
4 - Sign in to a different browser with a different user and at a different branch
5 - Bring up a aptron in circulation and type gibberish into barcode field to get a fast cataloging link
6 - It may have your branch, but it may also have the other user's branch from the other window
7 - Keep entering gibberish to get a link until one user has the correct branch
8 - Then switch to the other browser, and keep entering gibberish, watch the branchcode change
9 - Apply patch, restart all
10 - Test switching between browsers. generating fast cataloging links
11 - Users should now consistently have the correct branch
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Test plan:
1 - Apply two patches
2 - Confirm code changes make sense
3 - Confirm you can check out items
4 - Confirm checkout blocks still block
Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
This patch adds a few pieces of information to the print slip button
and makes the code confirm the hold
As we are printing before the confirm, we also add the ability to pass
in the itemnumber to 'ReserveSlip'
This is slightly hacky, however, I don't see another way to allow
printing without an additional page reload.
To test:
1 - Place a title level hold for patron A, for delivery to library B
2 - Attempt to checkout an item from the record above to Patron B from
library A
3 - You receive an alert about the hold
4 - Click "Don't check out, confirm hold, and print slip"
5 - Confirm the slip looks correct and has item info
6 - Confirm that item is in transit to fill hold
7 - Revert transit status
8 - Attempt to checkout the item to Patron B from Library B
9 - Click "Don't check out, confirm hold, and print slip"
10 - Confirm slip is correct
11 - Confirm item is marked waiting
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
This patch adds handling for circulation of booked materials.
We prevent checkouts of booked items during the booking period where the
booking is for another user.
We update the due date to match the end of booking period when checking
out to the user who the booking is for.
If a checkout would overlap a booking to another user, we ask the user if
they will accept a reduced due date so the booked item is returned in
time to fulfill the booking.
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Janet McGowan <janet.mcgowan@ptfs-europe.com>
Signed-off-by: Caroline Cyr La Rose <caroline.cyr-la-rose@inlibro.com>
Signed-off-by: Laurence Rault <laurence.rault@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Test Plan:
1. Apply patch
2. create a patron list if there aren't any
3. search for a patron
4. observe the "Patron lists" tab showing the list that the patron is not in
5. try adding the patron to the list and removing them from the list to
be sure the feature has full operation
6. click "Check Out" on the side bar menu to navigate to the circulation
page for this patron
7. observe the "Patron lists" tab, and verify it operates as it did on the
patron details page
Bug 32730: (follow-up) Minor corrections
by Owen Leonard
This patch corrects an instance of an incorrect capital letter
("Patron Lists" -> "Patron lists") and makes minor tweaks to
indentation.
Signed-off-by: Stina Hallin <stina.hallin@ub.lu.se>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Edit: (tcohen) new files should be run through perltidy ALWAYS. Did it
and squashed it here.
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
The anonymous patron circulation page should show an alert message and not allow check-out.
1) Configure an existing borrowernumber in system preference
AnonymousPatron
2) Go to circulation page of this borrower :
/cgi-bin/koha/circ/circulation.pl?borrowernumber=x
3) Check you see alert 'This is the anonymous patron, so circulation is disabled.'
Signed-off-by: Kelly McElligott <kelly@bywatersolutions.com>
Signed-off-by: Johanna Miettunen <johanna.miettunen@haaga-helia.fi>
Signed-off-by: Päivi Knuutinen <paivi.knuutinen@joensuu.fi>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
This patch updates the patron search bar and pages to default search
method to that defined by DefaultPatronSearchMethod system preference.
Test plan
1) Prior to this patch confirm that regardless of what you set
DefaultPatronSearchMethod to, the search in /members/member.pl,
members/members-home.pl and the search from the patrons search top bar
all default to 'contains'.
2) Apply the patch
3) Confirm that the system preference now affects the default option for
match type upon page load.
Signed-off-by: Sam Lau <samalau@gmail.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Since Bug 30718, date due uses flatpickr.
The JavaScript code setting due date via on-site checkout checkbox needs to be adapted.
Sort of like Bug 30717.
This patch renames the variable sent to template
'today_due_date_and_time' to avoid confusion with variable 'todaysdate'
used in other templates.
Test plan :
1) Enable system preference 'OnSiteCheckouts'
2) Go to a patron circulation page /cgi-bin/koha/circ/circulation.pl
3) Click on settings icon inside barcode input
=> Check due date input is empty
4) Click on 'On-site checkout'
=> Check due date input is filled with today date at 23:59
5) Fill barcode input and do check-out
6) Check due date is correct
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
This is a rebased submission following bug 31095 which removed the use of GetDebarments. This patch now uses $patron->restrictions to find the date and pass it to the template
Test plan:
1) Create a restriction on a patron and navigate to that patron in Checkouts or the patron details page
2) There should be a message with details about the restriction but the creation date of the restriction won't be included in the message
3) Apply patch
4) The message should now say "Restricted since DATE" as in the screenshot attached.
5) Change the 'dateformat' syspref and refresh, the date should change to reflect the syspref
Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk>
Signed-off-by: Laura Escamilla <laura.escamilla@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
This patch remove the use of GetDebarments from circ/circulation.pl,
replacing it with a reference to patron.restrictions in the template and
includes.
Test plan
1. Confirm that the 'Restrictions (x)' tab still appears on the checkout
page for a user.
2. Confirm that the 'Restrictions (x)' tab count is correct
3. Confirm that the 'Restrictions (x)' tab table functions
4. Confirm that the 'Restrictions (x)' tab 'Add manual restriction' form
works as expected
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
To test:
* Turn on patronimages system preferences
* Go to any patron account
* Hover over the 'dummy image' for the Add button
* Browse and select an image for upload
* Saving results in the following error:
The form submission failed (Wrong CSRF token). Try to come back, refresh the page, then try again.
Apply patch and try again. You shouldn't need to try twice, it should work on the first attempt now.
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: David Cook <dcook@prosentient.com.au>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
This patch moves the new classes under ::Patron::Restriction:: and
enhances the Unit tests for those classes.
NOTE: We should drop keyed_on_code as part of bug 31095
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
The structure of debarments has changes slightly in that the displayed
text is now a product of a call to Koha::RestrictionTypes rather than
just the debarment's code. This patch allows for that
Sponsored-by: Loughborough University
Signed-off-by: Benjamin Veasey <B.T.Veasey@lboro.ac.uk>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
The idea rely on the KohaDates TT plugin for the date formatting. We
should not have any output_pref calls in pl or pm (there are some
exceptions, for ILSDI for instance).
Also flatpickr will deal with the places where dates are inputed. We
will pass the raw SQL value (what we call 'iso' in Koha::DateUtils), and
the controller will receive the same value, no need to additional
conversion.
Note that DBIC has the capability to auto-deflate DateTime objects,
which makes things way easier. We can either pass the value we receive
from the controller, or pass a DT object to our methods.
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
This enhancement shows recalls ready for pick-up on the patron's account
so they can't be missed.
To test:
1) Enable the UseRecalls system preference and set up your
recalls-related circulation rules.
2) Check out an item to Patron B.
3) Log into the OPAC as Patron A and search for the item.
4) Place a recall on that item. Note the pickup library.
5) Go back to the staff client. At the top right of the page, confirm
your logged in library matches the recall pickup library. Set the
library to the recall pickup library if needed.
6) Check in the recalled item and confirm the recall as waiting for
Patron A.
7) Go to Patron A's account (members/moremember.pl). Confirm the recall
shows under 'Recalls waiting here' and all the information is correct.
8) Go to Patron A's checkouts (circ/circulation.pl). Confirm the recall
shows under 'Recalls waiting here' and all the information is correct.
9) Click on the menu at the top right of the page and choose 'Set
library'. Change the library to some other library.
10) Repeat steps 7 and 8, however this time the recall should show under
'Recalls waiting at other libraries'.
Sponsored-by: Catalyst IT
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
To Test:
1. Apply patch, updatedatabase, and restart_all
2. A small change the global scss file means you should regenerate the CSS as well. ( https://wiki.koha-community.org/wiki/Working_with_SCSS_in_the_OPAC_and_staff_interface )
3. Set DisplayClearScreenButton to "don't show"
4. Go to the patron checkout screen and see that no button should show to clear the screen and print
5. Set DisplayClearScreenButton to 'ISSUESLIP' and make sure the button now appears and the ISSUESLIP prints
6. Set DisplayClearScreenButton to 'ISSUEQSLIP' and make sure the button now appears and the ISSUEQSLIP prints
Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
1) This removes support for passing string dates to CanBookBeIssued. The
function didn't publicly even document support for string dates, only
DateTime objects.
2) We get a $duedate always at least from CalcDateDue so having
$issuingimpossible{INVALID_DATE} = output_pref($duedate);
was unneccesary and thus removed.
3) The check "duedate cannot be before now" was needlessly complex: if
the due date really cannot be before now we should check seconds too
and warn the librarian! Thus the truncation to minutes can be dropped
safely.
To test:
1) prove t/db_dependent/Circulation.t
2) prove t/db_dependent/Illrequests.t
3) Enable OnSiteCheckouts and disable SpecifyDueDate syspref. Create
on-site checkout for any patron and verify the due date is your
current date at 23:59, you can check the exact minute with sql:
> select * from issues
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Barcode is trimmed of leading/trailing whitespaces in many instances
before the barcodedecode sub was called. This patch instead makes that
barcodedecode sub is going to trim it itself and removes unnecessary,
and repetitive code that was used before barcodedecode was called.
Steps to test:
1. Edit item with any barcode, add a bunch of whitespaces at the start
and at the bottom of it. Save the item. Ensure that this action ruins
the barcode and ensure that the spaces are still there by editing the
same item again.
2. Apply the patch.
3. Edit the same item again in the same fashion. Ensure that now all
whitespaces are getting trimmed and it doesn't affect the barcode in
any negative way.
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
This patch updates all the calls to pass a hasref rather than an array
It also removes the no longer used framework parameter
To test:
prove -v t/Biblio.t t/db_dependent/Biblio/TransformMarcToKoha.t
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
There are several occurrences of `my $var += ` or .= in the code.
It should not cause problems but it's confusing.
Test plan:
Read the patch and confirm that the changes make sense.
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>