Bug 16464 - If a patron has been discharged, show a message in the OPAC
Summary: If a patron has been discharged, show a message in the OPAC
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: OPAC (show other bugs)
Version: Main
Hardware: All All
: P5 - low minor
Assignee: Owen Leonard
QA Contact: Testopia
URL: /cgi-bin/koha/opac-discharge.pl
Keywords:
Depends on: 8007
Blocks:
  Show dependency treegraph
 
Reported: 2016-05-06 14:58 UTC by Owen Leonard
Modified: 2017-12-07 22:18 UTC (History)
6 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Small patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:


Attachments
Bug 16464 - If a patron has been discharged, show a message in the OPAC (4.38 KB, patch)
2016-08-09 13:57 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 16464 - If a patron has been discharged, show a message in the OPAC (4.39 KB, patch)
2016-08-15 09:05 UTC, Claire Gravely
Details | Diff | Splinter Review
Bug 16464 - If a patron has been discharged, show a message in the OPAC (4.47 KB, patch)
2016-08-23 13:19 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 16464: Add FIXME (1.37 KB, patch)
2016-08-23 13:19 UTC, Jonathan Druart
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
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