Bug 16464

Summary: If a patron has been discharged, show a message in the OPAC
Product: Koha Reporter: Owen Leonard <oleonard>
Component: OPACAssignee: Owen Leonard <oleonard>
Status: CLOSED FIXED QA Contact: Testopia <testopia>
Severity: minor    
Priority: P5 - low CC: f.demians, jonathan.druart, julian.maurice, kyle, mtompset, veron
Version: Main   
Hardware: All   
OS: All   
URL: /cgi-bin/koha/opac-discharge.pl
Change sponsored?: --- Patch complexity: Small patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:
Bug Depends on: 8007    
Bug Blocks:    
Attachments: Bug 16464 - If a patron has been discharged, show a message in the OPAC
Bug 16464 - If a patron has been discharged, show a message in the OPAC
Bug 16464 - If a patron has been discharged, show a message in the OPAC
Bug 16464: Add FIXME

Description Owen Leonard 2016-05-06 14:58:32 UTC
When a patron is discharged a restriction is added to their account. In the OPAC this triggers the default warning about the account being frozen.

If the restriction is for a discharge a different message should be shown, with a link to the discharge.
Comment 1 Owen Leonard 2016-05-31 15:16:05 UTC
I'm working on this, but I'm not sure what the message should say. "Your account has been discharged?" "You have been discharged?"
Comment 2 Mark Tompsett 2016-08-02 17:01:49 UTC
(In reply to Owen Leonard from comment #1)
> I'm working on this, but I'm not sure what the message should say. "Your
> account has been discharged?" "You have been discharged?"

I vote for the former, if that's any help. It's not like the person is fired. ;)
Comment 3 Owen Leonard 2016-08-09 13:57:40 UTC Comment hidden (obsolete)
Comment 4 Claire Gravely 2016-08-15 09:05:41 UTC Comment hidden (obsolete)
Comment 5 Jonathan Druart 2016-08-15 14:59:03 UTC
Comment on attachment 54454 [details] [review]
Bug 16464 - If a patron has been discharged, show a message in the OPAC

Review of attachment 54454 [details] [review]:
-----------------------------------------------------------------

::: opac/opac-user.pl
@@ +101,5 @@
>      }
> +    my $available = Koha::Patron::Discharge::count({
> +        borrowernumber => $borrowernumber,
> +        validated      => 1,
> +    });

Why do you count the number of validated discharges? I'd say that the following call to is_discharged is enough.
Comment 6 Owen Leonard 2016-08-23 12:54:36 UTC
(In reply to Jonathan Druart from comment #5)
> Why do you count the number of validated discharges? I'd say that the
> following call to is_discharged is enough.

I was following the example of opac-discharge.pl.
Comment 7 Jonathan Druart 2016-08-23 13:19:17 UTC
Created attachment 54774 [details] [review]
Bug 16464 - If a patron has been discharged, show a message in the OPAC

This patch adds a message to the patron home page in the OPAC to be
shown if the user is restricted because of a discharge.

To test, apply the patch and log into the OPAC as a patron who has been
discharged.
 - You should see a message which says so, including a link to
   the discharge notice.
 - Log in to the OPAC as a patron with a manual restriction and confirm
   that the correct notice is displayed.

Signed-off-by: Claire Gravely <c.gravely@arts.ac.uk>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 8 Jonathan Druart 2016-08-23 13:19:21 UTC
Created attachment 54775 [details] [review]
Bug 16464: Add FIXME

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 9 Jonathan Druart 2016-08-23 13:20:09 UTC
(In reply to Owen Leonard from comment #6)
> (In reply to Jonathan Druart from comment #5)
> > Why do you count the number of validated discharges? I'd say that the
> > following call to is_discharged is enough.
> 
> I was following the example of opac-discharge.pl.

Added FIXME to see later.
Comment 10 Kyle M Hall (khall) 2016-09-02 16:49:07 UTC
Pushed to master for 16.11, thanks Jonathan, Owen!
Comment 11 Frédéric Demians 2016-09-08 19:58:06 UTC
Pushed in 16.05. Will be in 16.05.04.
Comment 12 Julian Maurice 2016-09-16 07:28:47 UTC
Pushed to 3.22.x, will be in 3.22.11