Bug 14787 - Allow confirm/continue option to circulation warnings at checkout
Summary: Allow confirm/continue option to circulation warnings at checkout
Status: Needs documenting
Alias: None
Product: Koha
Classification: Unclassified
Component: Circulation (show other bugs)
Version: Main
Hardware: All All
: P5 - low enhancement
Assignee: Matt Blenkinsop
QA Contact: Martin Renvoize (ashimema)
URL:
Keywords:
: 14728 16943 18021 (view as bug list)
Depends on:
Blocks: 39183 39422
  Show dependency treegraph
 
Reported: 2015-09-04 14:05 UTC by Nicole C. Engard
Modified: 2025-04-28 14:33 UTC (History)
12 users (show)

See Also:
GIT URL:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
This patch adds functionality that will remember whether an action has been confirmed for a particular patron for the session. While carrying out an action on that patron, if the same checkout confirmation message keeps appearing the user can now select to remember their confirmation while they are still working on that patron. When the user moves onto a new patron the confirmations then reset and accumulate again for the new patron. **Sponsored by** *ByWater Solutions*, *Colorado Library Consortium (CLIC)*, *Panhandle Public Library Cooperative* and *Arcadia Public Library*
Version(s) released in:
24.11.00
Circulation function:


Attachments
Bug 14787: Remember confirmations for a patron session (10.51 KB, patch)
2024-06-12 13:30 UTC, Matt Blenkinsop
Details | Diff | Splinter Review
Bug 14787: Fix tidying issue in circulation.pl (42.23 KB, patch)
2024-06-12 13:30 UTC, Matt Blenkinsop
Details | Diff | Splinter Review
Bug 14787: Remember confirmations for a patron session (10.65 KB, patch)
2024-09-09 10:48 UTC, Matt Blenkinsop
Details | Diff | Splinter Review
Bug 14787: Fix tidying issue in circulation.pl (42.47 KB, patch)
2024-09-09 10:48 UTC, Matt Blenkinsop
Details | Diff | Splinter Review
Bug 14787: Remember confirmations for a patron session (10.65 KB, patch)
2024-10-23 15:05 UTC, Matt Blenkinsop
Details | Diff | Splinter Review
Bug 14787: Fix tidying issue in circulation.pl (42.29 KB, patch)
2024-10-23 15:05 UTC, Matt Blenkinsop
Details | Diff | Splinter Review
Bug 14787: Remember confirmations for a patron session (10.68 KB, patch)
2024-10-25 20:50 UTC, Roman Dolny
Details | Diff | Splinter Review
Bug 14787: Fix tidying issue in circulation.pl (42.32 KB, patch)
2024-10-25 20:50 UTC, Roman Dolny
Details | Diff | Splinter Review
Bug 14787: Remember confirmations for a patron session (10.75 KB, patch)
2024-10-28 15:31 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 14787: Fix tidying issue in circulation.pl (42.39 KB, patch)
2024-10-28 15:31 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 14787: Remember confirmations for a patron session (14.74 KB, patch)
2024-10-30 14:20 UTC, Matt Blenkinsop
Details | Diff | Splinter Review
Bug 14787: Fix tidying issue in circulation.pl (36.29 KB, patch)
2024-10-30 14:20 UTC, Matt Blenkinsop
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Nicole C. Engard 2015-09-04 14:05:56 UTC
It would be great if we offered an option to say 'yes' or 'confirm' to warnings at checkout (like patron owes too much are you sure) and then have it remember for the session so you don't have to click that every item you check out.
Comment 1 Katrin Fischer 2020-01-07 23:38:48 UTC
*** Bug 14728 has been marked as a duplicate of this bug. ***
Comment 2 Katrin Fischer 2020-01-11 14:44:43 UTC
*** Bug 16943 has been marked as a duplicate of this bug. ***
Comment 3 Katrin Fischer 2020-01-11 18:53:09 UTC
*** Bug 18021 has been marked as a duplicate of this bug. ***
Comment 4 Matt Blenkinsop 2024-06-12 13:30:30 UTC
Created attachment 167656 [details] [review]
Bug 14787: Remember confirmations for a patron session

This patch adds functionality that will remember whether an action has been confirmed for a particular patron for the session. While carrying out an action on that patron, if the same checkout confirmation message keeps appearing the user can now select to remember their confirmation while they are still working on that patron. When the user moves onto a new patron the confirmations then reset and accumulate again for the new patron.

Test plan:
We're going to use rental fees as the example to prompt the checkout confirmation dialog. If you wish to use something else to test then feel free, it should work the same. Do not use patron debts though, as we already track a confirmation for this elsewhere and the test plan will appear to fail when in fact it is behaving as expected

1) In system preferences set RentalFeesCheckoutConfirmation to 'ask'
2) Choose a patron and checkout an item to that patron that incurrs a rental charge (in KTD this will be any item that does not have an itype of 'BK', 'REF' or 'VM'
3) A dialog should display asking you to confirm the checkout.
4) There should be a checkbox on the dialog to "Remember for the session for this patron"
5) Click Yes, checkout out without checking this checkbox
6) Select another item and checkout - the dialog should display again
7) This time, check the checkbox and click Yes, check out
8) Checkout another item (depending on your fines limit settings, you may need to pay the rental charges before the system will allow you to checkout again so go ahead and do this)
9) This time the dialog should not appear as the system has remembered our confirmation for this patron for the session
10) Choose a new patron
11) Repeat steps 2 - 9
12) It should work as outlined above
13) Sign off!
Comment 5 Matt Blenkinsop 2024-06-12 13:30:32 UTC
Created attachment 167657 [details] [review]
Bug 14787: Fix tidying issue in circulation.pl

There are large blocks of code in circulation.pl that are incorrectly indented. This means any new code placed within those blocks fails the QA tests as it automatically adds new untidy lines. This patch tidies the file to remove this issue and start from a clean position in terms of tidyness.
Comment 6 Matt Blenkinsop 2024-09-09 10:48:46 UTC
Created attachment 171183 [details] [review]
Bug 14787: Remember confirmations for a patron session

This patch adds functionality that will remember whether an action has been confirmed for a particular patron for the session. While carrying out an action on that patron, if the same checkout confirmation message keeps appearing the user can now select to remember their confirmation while they are still working on that patron. When the user moves onto a new patron the confirmations then reset and accumulate again for the new patron.

Test plan:
We're going to use rental fees as the example to prompt the checkout confirmation dialog. If you wish to use something else to test then feel free, it should work the same. Do not use patron debts though, as we already track a confirmation for this elsewhere and the test plan will appear to fail when in fact it is behaving as expected

1) In system preferences set RentalFeesCheckoutConfirmation to 'ask'
2) Choose a patron and checkout an item to that patron that incurrs a rental charge (in KTD this will be any item that does not have an itype of 'BK', 'REF' or 'VM'
3) A dialog should display asking you to confirm the checkout.
4) There should be a checkbox on the dialog to "Remember for the session for this patron"
5) Click Yes, checkout out without checking this checkbox
6) Select another item and checkout - the dialog should display again
7) This time, check the checkbox and click Yes, check out
8) Checkout another item (depending on your fines limit settings, you may need to pay the rental charges before the system will allow you to checkout again so go ahead and do this)
9) This time the dialog should not appear as the system has remembered our confirmation for this patron for the session
10) Choose a new patron
11) Repeat steps 2 - 9
12) It should work as outlined above
13) Sign off!
Comment 7 Matt Blenkinsop 2024-09-09 10:48:49 UTC
Created attachment 171184 [details] [review]
Bug 14787: Fix tidying issue in circulation.pl

There are large blocks of code in circulation.pl that are incorrectly indented. This means any new code placed within those blocks fails the QA tests as it automatically adds new untidy lines. This patch tidies the file to remove this issue and start from a clean position in terms of tidyness.
Comment 8 Matt Blenkinsop 2024-09-09 10:49:05 UTC
Rebased on main
Comment 9 Matt Blenkinsop 2024-10-23 15:05:41 UTC
Created attachment 173224 [details] [review]
Bug 14787: Remember confirmations for a patron session

This patch adds functionality that will remember whether an action has been confirmed for a particular patron for the session. While carrying out an action on that patron, if the same checkout confirmation message keeps appearing the user can now select to remember their confirmation while they are still working on that patron. When the user moves onto a new patron the confirmations then reset and accumulate again for the new patron.

Test plan:
We're going to use rental fees as the example to prompt the checkout confirmation dialog. If you wish to use something else to test then feel free, it should work the same. Do not use patron debts though, as we already track a confirmation for this elsewhere and the test plan will appear to fail when in fact it is behaving as expected

1) In system preferences set RentalFeesCheckoutConfirmation to 'ask'
2) Choose a patron and checkout an item to that patron that incurrs a rental charge (in KTD this will be any item that does not have an itype of 'BK', 'REF' or 'VM'
3) A dialog should display asking you to confirm the checkout.
4) There should be a checkbox on the dialog to "Remember for the session for this patron"
5) Click Yes, checkout out without checking this checkbox
6) Select another item and checkout - the dialog should display again
7) This time, check the checkbox and click Yes, check out
8) Checkout another item (depending on your fines limit settings, you may need to pay the rental charges before the system will allow you to checkout again so go ahead and do this)
9) This time the dialog should not appear as the system has remembered our confirmation for this patron for the session
10) Choose a new patron
11) Repeat steps 2 - 9
12) It should work as outlined above
13) Sign off!
Comment 10 Matt Blenkinsop 2024-10-23 15:05:44 UTC
Created attachment 173225 [details] [review]
Bug 14787: Fix tidying issue in circulation.pl

There are large blocks of code in circulation.pl that are incorrectly indented. This means any new code placed within those blocks fails the QA tests as it automatically adds new untidy lines. This patch tidies the file to remove this issue and start from a clean position in terms of tidyness.
Comment 11 Roman Dolny 2024-10-25 20:50:01 UTC
Created attachment 173412 [details] [review]
Bug 14787: Remember confirmations for a patron session

This patch adds functionality that will remember whether an action has been confirmed for a particular patron for the session. While carrying out an action on that patron, if the same checkout confirmation message keeps appearing the user can now select to remember their confirmation while they are still working on that patron. When the user moves onto a new patron the confirmations then reset and accumulate again for the new patron.

Test plan:
We're going to use rental fees as the example to prompt the checkout confirmation dialog. If you wish to use something else to test then feel free, it should work the same. Do not use patron debts though, as we already track a confirmation for this elsewhere and the test plan will appear to fail when in fact it is behaving as expected

1) In system preferences set RentalFeesCheckoutConfirmation to 'ask'
2) Choose a patron and checkout an item to that patron that incurrs a rental charge (in KTD this will be any item that does not have an itype of 'BK', 'REF' or 'VM'
3) A dialog should display asking you to confirm the checkout.
4) There should be a checkbox on the dialog to "Remember for the session for this patron"
5) Click Yes, checkout out without checking this checkbox
6) Select another item and checkout - the dialog should display again
7) This time, check the checkbox and click Yes, check out
8) Checkout another item (depending on your fines limit settings, you may need to pay the rental charges before the system will allow you to checkout again so go ahead and do this)
9) This time the dialog should not appear as the system has remembered our confirmation for this patron for the session
10) Choose a new patron
11) Repeat steps 2 - 9
12) It should work as outlined above
13) Sign off!

Signed-off-by: Roman Dolny <roman.dolny@jezuici.pl>
Comment 12 Roman Dolny 2024-10-25 20:50:05 UTC
Created attachment 173413 [details] [review]
Bug 14787: Fix tidying issue in circulation.pl

There are large blocks of code in circulation.pl that are incorrectly indented. This means any new code placed within those blocks fails the QA tests as it automatically adds new untidy lines. This patch tidies the file to remove this issue and start from a clean position in terms of tidyness.

Signed-off-by: Roman Dolny <roman.dolny@jezuici.pl>
Comment 13 Martin Renvoize (ashimema) 2024-10-28 15:31:22 UTC
Created attachment 173559 [details] [review]
Bug 14787: Remember confirmations for a patron session

This patch adds functionality that will remember whether an action has been confirmed for a particular patron for the session. While carrying out an action on that patron, if the same checkout confirmation message keeps appearing the user can now select to remember their confirmation while they are still working on that patron. When the user moves onto a new patron the confirmations then reset and accumulate again for the new patron.

Test plan:
We're going to use rental fees as the example to prompt the checkout confirmation dialog. If you wish to use something else to test then feel free, it should work the same. Do not use patron debts though, as we already track a confirmation for this elsewhere and the test plan will appear to fail when in fact it is behaving as expected

1) In system preferences set RentalFeesCheckoutConfirmation to 'ask'
2) Choose a patron and checkout an item to that patron that incurrs a rental charge (in KTD this will be any item that does not have an itype of 'BK', 'REF' or 'VM'
3) A dialog should display asking you to confirm the checkout.
4) There should be a checkbox on the dialog to "Remember for the session for this patron"
5) Click Yes, checkout out without checking this checkbox
6) Select another item and checkout - the dialog should display again
7) This time, check the checkbox and click Yes, check out
8) Checkout another item (depending on your fines limit settings, you may need to pay the rental charges before the system will allow you to checkout again so go ahead and do this)
9) This time the dialog should not appear as the system has remembered our confirmation for this patron for the session
10) Choose a new patron
11) Repeat steps 2 - 9
12) It should work as outlined above
13) Sign off!

Signed-off-by: Roman Dolny <roman.dolny@jezuici.pl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 14 Martin Renvoize (ashimema) 2024-10-28 15:31:26 UTC
Created attachment 173560 [details] [review]
Bug 14787: Fix tidying issue in circulation.pl

There are large blocks of code in circulation.pl that are incorrectly indented. This means any new code placed within those blocks fails the QA tests as it automatically adds new untidy lines. This patch tidies the file to remove this issue and start from a clean position in terms of tidyness.

Signed-off-by: Roman Dolny <roman.dolny@jezuici.pl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 15 Martin Renvoize (ashimema) 2024-10-28 15:32:25 UTC
Whilst this is code from my team, it's not code I'd fully reviewed and tested until now.

It's all working well and there are no regressions.

Passing QA
Comment 16 Katrin Fischer 2024-10-30 13:06:47 UTC
We have a conflict in circulation.pl that I am not confident to resolve. Please rebase ASAP.
Comment 17 Matt Blenkinsop 2024-10-30 14:20:01 UTC
Created attachment 173720 [details] [review]
Bug 14787: Remember confirmations for a patron session

This patch adds functionality that will remember whether an action has been confirmed for a particular patron for the session. While carrying out an action on that patron, if the same checkout confirmation message keeps appearing the user can now select to remember their confirmation while they are still working on that patron. When the user moves onto a new patron the confirmations then reset and accumulate again for the new patron.

Test plan:
We're going to use rental fees as the example to prompt the checkout confirmation dialog. If you wish to use something else to test then feel free, it should work the same. Do not use patron debts though, as we already track a confirmation for this elsewhere and the test plan will appear to fail when in fact it is behaving as expected

1) In system preferences set RentalFeesCheckoutConfirmation to 'ask'
2) Choose a patron and checkout an item to that patron that incurrs a rental charge (in KTD this will be any item that does not have an itype of 'BK', 'REF' or 'VM'
3) A dialog should display asking you to confirm the checkout.
4) There should be a checkbox on the dialog to "Remember for the session for this patron"
5) Click Yes, checkout out without checking this checkbox
6) Select another item and checkout - the dialog should display again
7) This time, check the checkbox and click Yes, check out
8) Checkout another item (depending on your fines limit settings, you may need to pay the rental charges before the system will allow you to checkout again so go ahead and do this)
9) This time the dialog should not appear as the system has remembered our confirmation for this patron for the session
10) Choose a new patron
11) Repeat steps 2 - 9
12) It should work as outlined above
13) Sign off!
Comment 18 Matt Blenkinsop 2024-10-30 14:20:04 UTC
Created attachment 173721 [details] [review]
Bug 14787: Fix tidying issue in circulation.pl

There are large blocks of code in circulation.pl that are incorrectly indented. This means any new code placed within those blocks fails the QA tests as it automatically adds new untidy lines. This patch tidies the file to remove this issue and start from a clean position in terms of tidyness.
Comment 19 Katrin Fischer 2024-10-30 17:47:06 UTC
Pushed for 24.11!

Well done everyone, thank you!
Comment 20 Lucas Gass (lukeg) 2024-12-05 21:09:36 UTC
Enhancement won't be backported to 24.05.x
Comment 21 Andrii Nugged 2025-04-28 14:18:06 UTC
We probably should have follow up for this, some notes for not to lose the point:



    my $patron_session_confirmation = $query->cookie('patronSessionConfirmation') || undef;

- why screening it to undef? protecting for "" and 0?



    my ( $patron_for_session, $session_confirmations ) = split( /:/, $patron_session_confirmation, 2 );

- split of undef leads to:

[2025/04/28 16:40:52] [WARN] Use of uninitialized value $patron_session_confirmation in split at /usr/share/koha/intranet/cgi-bin/circ/circulation.pl line ...


    my $patron_match = $borrowernumber == $patron_for_session;

- numeric == with undef or '' leads to:

[2025/04/28 16:40:52] [WARN] Use of uninitialized value $patron_for_session in numeric eq (==) at /usr/share/koha/intranet/cgi-bin/circ/circulation.pl line ...



    my @conf_keys    = split( /\|/, $session_confirmations );

- and this will make warning:

[2025/04/28 16:40:52] [WARN] Use of uninitialized value $session_confirmations in split at /usr/share/koha/intranet/cgi-bin/circ/circulation.pl line ...




I'd solve this way (but this is "local solution just for this block" :) ) ->


```
                my ( $patron_for_session, $session_confirmations, $patron_match );
                my @conf_keys;

                my $patron_session_confirmation = $query->cookie('patronSessionConfirmation') || undef;
                if ($patron_session_confirmation) {
                    ( $patron_for_session, $session_confirmations ) = split( /:/, $patron_session_confirmation, 2 );
                    $patron_match = $borrowernumber == $patron_for_session;
                    @conf_keys    = split( /\|/, $session_confirmations );
                }
                $template_params->{sessionConfirmationKeys} = ();
```
Comment 22 Katrin Fischer 2025-04-28 14:33:52 UTC
Please fix on new and separate bug reports as this has already been released.