From b464eda7c39392143c4448c505312c7bb310ae92 Mon Sep 17 00:00:00 2001 From: David Cook Date: Tue, 7 Jan 2014 15:07:53 +1100 Subject: [PATCH] Bug 11486: Show renewal count on 'check out' and 'details' tabs in patron record This patch adds the renewal count to the 'Check out' and "Details' tabs of the patron record. This information already exists in the OPAC view of the patron record. Since librarians might be serving patrons in person who want to know this information without looking it up online, it makes sense to show it in the staff client. There may also be times where librarians want to see how many renewals a patron has left, how many they've used already, etc. when making other decisions. _TEST PLAN_ Before applying: 1) Go to "Check out" with a patron that has some check outs before today 2) Add some check outs for today *Ensure that all issues are for items that can be renewed* 3) Note that the Renew column just says '0' followed by a check box 4) Check the 'Detail' tab. It should say the same. Apply the patch. 5) View the "Details" and "Check out" tabs again 6) Note that the renewal count now appears in the form resembling: 5 of 5 renewals remaining Signed-off-by: Nicole C. Engard All tests pass Signed-off-by: Jonathan Druart Signed-off-by: Galen Charlton --- circ/circulation.pl | 1 + koha-tmpl/intranet-tmpl/prog/en/css/staff-global.css | 6 ++++++ .../prog/en/modules/circ/circulation.tt | 12 ++++++++++++ .../prog/en/modules/members/moremember.tt | 6 ++++++ members/moremember.pl | 1 + 5 files changed, 26 insertions(+) diff --git a/circ/circulation.pl b/circ/circulation.pl index 9769731ad7..7d214ea7ea 100755 --- a/circ/circulation.pl +++ b/circ/circulation.pl @@ -513,6 +513,7 @@ sub build_issue_data { } else { (!$relatives) ? push @previousissues, $it : push @relprevissues, $it; } + ($it->{'renewcount'},$it->{'renewsallowed'},$it->{'renewsleft'}) = C4::Circulation::GetRenewCount($it->{'borrowernumber'},$it->{'itemnumber'}); #Add renewal count to item data display } } diff --git a/koha-tmpl/intranet-tmpl/prog/en/css/staff-global.css b/koha-tmpl/intranet-tmpl/prog/en/css/staff-global.css index ba49c8861d..07c0b18e20 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/css/staff-global.css +++ b/koha-tmpl/intranet-tmpl/prog/en/css/staff-global.css @@ -2721,3 +2721,9 @@ span.browse-button { #merge_table tr.active td { background-color: #FFFFCC; } + +.renewals { + display:block; + font-size:0.8em; + padding:0.5em; +} diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt index a522236281..8a5439be1e 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt @@ -766,6 +766,9 @@ No patron matched [% message %] [% ELSE %] [% END %] + [% IF ( todayissue.renewsallowed ) %] + ([% todayissue.renewsleft %] of [% todayissue.renewsallowed %] renewals remaining) + [% END %] [% ELSE %] [% IF ( todayissue.can_confirm ) %] + [% IF ( todayissue.renewsallowed ) %] + ([% todayissue.renewsleft %] of [% todayissue.renewsallowed %] renewals remaining) + [% END %] [% END %] [% IF ( todayissue.renew_error_on_reserve ) %] @@ -855,6 +861,9 @@ No patron matched [% message %] [% ELSE %] [% END %] + [% IF ( previssue.renewsallowed ) %] + ([% previssue.renewsleft %] of [% previssue.renewsallowed %] renewals remaining) + [% END %] [% ELSE %] [% IF ( previssue.can_confirm ) %] + [% IF ( previssue.renewsallowed ) %] + ([% previssue.renewsleft %] of [% previssue.renewsallowed %] renewals remaining) + [% END %] [% END %] [% IF ( previssue.renew_error_on_reserve ) %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt index 61af0d8d23..961436cb09 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt @@ -500,6 +500,9 @@ function validate1(date) { [% END %] + [% IF ( issueloo.renewsallowed ) %] + ([% issueloo.renewsleft %] of [% issueloo.renewsallowed %] renewals remaining) + [% END %] [% END %] [% IF ( issueloo.norenew_reason_on_reserve ) %] @@ -518,6 +521,9 @@ function validate1(date) { [% ELSE %] [% END %] + [% IF ( issueloo.renewsallowed ) %] + ([% issueloo.renewsleft %] of [% issueloo.renewsallowed %] renewals remaining) + [% END %] [% END %] [% END %] diff --git a/members/moremember.pl b/members/moremember.pl index 0a2cb5f69e..adce9d255f 100755 --- a/members/moremember.pl +++ b/members/moremember.pl @@ -520,6 +520,7 @@ sub build_issue_data { $row{"norenew_reason_$renewerror"} = 1 if $renewerror; $row{renew_failed} = $renew_failed{ $issue->{itemnumber} }; $row{return_failed} = $return_failed{ $issue->{barcode} }; + ($row{'renewcount'},$row{'renewsallowed'},$row{'renewsleft'}) = C4::Circulation::GetRenewCount($issue->{'borrowernumber'},$issue->{'itemnumber'}); #Add renewal count to item data display push( @{$localissue}, \%row ); } return $localissue; -- 2.39.5