Bug 11486: Show renewal count on 'check out' and 'details' tabs in patron record
authorDavid Cook <dcook@prosentient.com.au>
Tue, 7 Jan 2014 04:07:53 +0000 (15:07 +1100)
committerGalen Charlton <gmc@esilibrary.com>
Thu, 23 Jan 2014 17:39:55 +0000 (17:39 +0000)
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 <nengard@bywatersolutions.com>
All tests pass

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>

circ/circulation.pl
koha-tmpl/intranet-tmpl/prog/en/css/staff-global.css
koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt
koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt
members/moremember.pl

index 9769731..7d214ea 100755 (executable)
@@ -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
     }
 }
 
index ba49c88..07c0b18 100644 (file)
@@ -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;
+}
index a522236..8a5439b 100644 (file)
@@ -766,6 +766,9 @@ No patron matched <span class="ex">[% message %]</span>
         [% ELSE %]
             <input type="checkbox" class="radio" name="items[]" value="[% todayissue.itemnumber %]" />
         [% END %]
+            [% IF ( todayissue.renewsallowed ) %]
+                <span class="renewals">([% todayissue.renewsleft %] of [% todayissue.renewsallowed %] renewals remaining)</span>
+            [% END %]
         [% ELSE %]
             [% IF ( todayissue.can_confirm ) %]<span class="renewals-allowed" style="display: none">
                 <input type="checkbox" name="all_items[]" value="[% todayissue.itemnumber %]" checked="checked" style="display: none;" />
@@ -775,6 +778,9 @@ No patron matched <span class="ex">[% message %]</span>
                     <input type="checkbox" class="radio" name="items[]" value="[% todayissue.itemnumber %]" />
                 [% END %]
                 </span>
+                [% IF ( todayissue.renewsallowed ) %]
+                    <span class="renewals">([% todayissue.renewsleft %] of [% todayissue.renewsallowed %] renewals remaining)</span>
+                [% END %]
                 <span class="renewals-disabled">
             [% END %]
                [% IF ( todayissue.renew_error_on_reserve ) %]
@@ -855,6 +861,9 @@ No patron matched <span class="ex">[% message %]</span>
         [% ELSE %]
             <input type="checkbox" class="radio" name="items[]" value="[% previssue.itemnumber %]" />
         [% END %]
+            [% IF ( previssue.renewsallowed ) %]
+                <span class="renewals">([% previssue.renewsleft %] of [% previssue.renewsallowed %] renewals remaining)</span>
+            [% END %]
         [% ELSE %]
             [% IF ( previssue.can_confirm ) %]<span class="renewals-allowed" style="display: none">
                 <input type="checkbox" name="all_items[]" value="[% previssue.itemnumber %]" checked="checked" style="display: none;" />
@@ -864,6 +873,9 @@ No patron matched <span class="ex">[% message %]</span>
                     <input type="checkbox" class="radio" name="items[]" value="[% previssue.itemnumber %]" />
                 [% END %]
                 </span>
+                [% IF ( previssue.renewsallowed ) %]
+                    <span class="renewals">([% previssue.renewsleft %] of [% previssue.renewsallowed %] renewals remaining)</span>
+                [% END %]
                 <span class="renewals-disabled">
             [% END %]
                [% IF ( previssue.renew_error_on_reserve ) %]
index 61af0d8..961436c 100644 (file)
@@ -500,6 +500,9 @@ function validate1(date) {
                         <input type="checkbox" name="items[]" value="[% issueloo.itemnumber %]" />
                     [% END %]
                     </span>
+                    [% IF ( issueloo.renewsallowed ) %]
+                        <span class="renewals">([% issueloo.renewsleft %] of [% issueloo.renewsallowed %] renewals remaining)</span>
+                    [% END %]
                     <span class="renewals-disabled">
                 [% END %]
                 [% IF ( issueloo.norenew_reason_on_reserve ) %]
@@ -518,6 +521,9 @@ function validate1(date) {
             [% ELSE %]
             <input type="checkbox" name="items[]" value="[% issueloo.itemnumber %]" onclick="uncheck_sibling(this);" />
             [% END %]
+                [% IF ( issueloo.renewsallowed ) %]
+                    <span class="renewals">([% issueloo.renewsleft %] of [% issueloo.renewsallowed %] renewals remaining)</span>
+                [% END %]
             [% END %]
             </td>
       [% END %]
index 0a2cb5f..adce9d2 100755 (executable)
@@ -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;