Bug 22134

Summary: Add account expiration information to patron details
Product: Koha Reporter: Owen Leonard <oleonard>
Component: TemplatesAssignee: Owen Leonard <oleonard>
Status: CLOSED FIXED QA Contact: Testopia <testopia>
Severity: enhancement    
Priority: P5 - low CC: dcook, josef.moravec, katrin.fischer, martin.renvoize, nick
Version: master   
Hardware: All   
OS: All   
See Also: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25299
Change sponsored?: --- Patch complexity: Small patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Bug Depends on: 19818    
Bug Blocks: 25301    
Attachments: Bug 22134: Add account expiration information to patron details
Bug 22134: Add account expiration information to patron details
Bug 22134: (follow-up) Simplify check for expired patron
Bug 22134: (follow-up) Simplify check for expired patron
Bug 22134: (follow-up) Simplify check for expired patron
Bug 22134: Add account expiration information to patron details
Bug 22134: (follow-up) Simplify check for expired patron
k
Bug 22134: Add account expiration information to patron details
Bug 22134: (follow-up) Simplify check for expired patron

Description Owen Leonard 2019-01-15 14:51:59 UTC
On the patron detail page in the staff client, expired patrons should show a message at the top like the checkout page does.
Comment 1 Owen Leonard 2019-01-15 15:08:14 UTC Comment hidden (obsolete)
Comment 2 Devinim 2019-01-15 18:10:33 UTC
Created attachment 83998 [details] [review]
Bug 22134: Add account expiration information to patron details

This patch modifies the patron detail template in the staff client so
that when a patron's registration is expired a message shows at the top
of the page along with the same "Renew" and "Edit" links which appear on
the checkout page. Links are also shown next the the expiration date in
the body of the page.

This patch also corrects the capitalization of the "Edit Details" link
on circulation.tt.

To test, apply the patch and locate a patron record which is expired.

 - On the patron detail page (members/moremember.pl) you should see a
   message at the top of the page.
 - In the body of the page, next to the expiration date information, you
   should see similar message and links.
 - On the patron's checkout page the "Edit details" link in the
   expiration message should have correct capitalization.

Signed-off-by: Devinim <kohadevinim@devinim.com.tr>
Comment 3 Katrin Fischer 2019-01-16 20:37:06 UTC
Hi Owen,
I think it shoudl be possible to use is_expired and is_going_to_expire from the template without having to pass template variable from the .pl file.
I found some examples with is_child: [% IF patron.is_child %]
Can you take a look please?
Comment 4 Owen Leonard 2019-01-17 00:09:45 UTC
Thanks Cait -- You're right that patron.is_expired works right in the template, but patron.is_going_to_expire doesn't seem to work as it should. It always evaluates as true. I'll see if I can figure out why.
Comment 5 Owen Leonard 2019-01-17 16:31:57 UTC Comment hidden (obsolete)
Comment 6 Jack 2019-01-17 21:03:43 UTC Comment hidden (obsolete)
Comment 7 Owen Leonard 2019-01-18 13:25:45 UTC
Created attachment 84191 [details] [review]
Bug 22134: (follow-up) Simplify check for expired patron

This patch move the check for "is_expired" to the template and removes
unnecessary code from the script.

The page now correctly handles messages for patrons who are about to
expire, as defined in the NotifyBorrowerDeparture preference.

To test, apply the patch and locate a patron record which is expired.

 - On the patron detail page (members/moremember.pl) you should see a
   message at the top of the page.
 - In the body of the page, next to the expiration date information, you
   should see similar message and links.

Select a patron who will expire within the period defined in
NotifyBorrowerDeparture.

 - On the patron detail page you should see a message at the top of the page.
 - In the body of the page, next to the expiration date information, you
   should see similar message and links.
Comment 8 Maryse Simard 2019-01-18 19:49:06 UTC
Created attachment 84214 [details] [review]
Bug 22134: Add account expiration information to patron details

This patch modifies the patron detail template in the staff client so
that when a patron's registration is expired a message shows at the top
of the page along with the same "Renew" and "Edit" links which appear on
the checkout page. Links are also shown next the the expiration date in
the body of the page.

This patch also corrects the capitalization of the "Edit Details" link
on circulation.tt.

To test, apply the patch and locate a patron record which is expired.

 - On the patron detail page (members/moremember.pl) you should see a
   message at the top of the page.
 - In the body of the page, next to the expiration date information, you
   should see similar message and links.
 - On the patron's checkout page the "Edit details" link in the
   expiration message should have correct capitalization.

Signed-off-by: Devinim <kohadevinim@devinim.com.tr>
Signed-off-by: Maryse Simard <maryse.simard@inlibro.com>
Comment 9 Maryse Simard 2019-01-18 19:49:34 UTC
Created attachment 84215 [details] [review]
Bug 22134: (follow-up) Simplify check for expired patron

This patch move the check for "is_expired" to the template and removes
unnecessary code from the script.

The page now correctly handles messages for patrons who are about to
expire, as defined in the NotifyBorrowerDeparture preference.

To test, apply the patch and locate a patron record which is expired.

 - On the patron detail page (members/moremember.pl) you should see a
   message at the top of the page.
 - In the body of the page, next to the expiration date information, you
   should see similar message and links.

Select a patron who will expire within the period defined in
NotifyBorrowerDeparture.

 - On the patron detail page you should see a message at the top of the page.
 - In the body of the page, next to the expiration date information, you
   should see similar message and links.

Signed-off-by: Maryse Simard <maryse.simard@inlibro.com>
Comment 10 Katrin Fischer 2019-01-20 11:31:10 UTC
Created attachment 84238 [details] [review]
k
Comment 11 Katrin Fischer 2019-01-20 11:49:43 UTC
Created attachment 84240 [details] [review]
Bug 22134: Add account expiration information to patron details

This patch modifies the patron detail template in the staff client so
that when a patron's registration is expired a message shows at the top
of the page along with the same "Renew" and "Edit" links which appear on
the checkout page. Links are also shown next the the expiration date in
the body of the page.

This patch also corrects the capitalization of the "Edit Details" link
on circulation.tt.

To test, apply the patch and locate a patron record which is expired.

 - On the patron detail page (members/moremember.pl) you should see a
   message at the top of the page.
 - In the body of the page, next to the expiration date information, you
   should see similar message and links.
 - On the patron's checkout page the "Edit details" link in the
   expiration message should have correct capitalization.

Signed-off-by: Devinim <kohadevinim@devinim.com.tr>
Signed-off-by: Maryse Simard <maryse.simard@inlibro.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 12 Katrin Fischer 2019-01-20 11:49:46 UTC
Created attachment 84241 [details] [review]
Bug 22134: (follow-up) Simplify check for expired patron

This patch move the check for "is_expired" to the template and removes
unnecessary code from the script.

The page now correctly handles messages for patrons who are about to
expire, as defined in the NotifyBorrowerDeparture preference.

To test, apply the patch and locate a patron record which is expired.

 - On the patron detail page (members/moremember.pl) you should see a
   message at the top of the page.
 - In the body of the page, next to the expiration date information, you
   should see similar message and links.

Select a patron who will expire within the period defined in
NotifyBorrowerDeparture.

 - On the patron detail page you should see a message at the top of the page.
 - In the body of the page, next to the expiration date information, you
   should see similar message and links.

Signed-off-by: Maryse Simard <maryse.simard@inlibro.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 13 Nick Clemens 2019-01-28 16:13:55 UTC
Awesome work all!

Pushed to master for 19.05
Comment 14 Martin Renvoize 2019-02-01 14:48:20 UTC
Enhancement, will not be backported.
Comment 15 David Cook 2020-04-28 01:21:38 UTC
Looks like this actually created a regression. 

Once I confirm the bug and fix I'll open up another bug report...