Bug 6739: (follow-up) fix more issues

* Hide renewal column, buttons and links
* Fixes minor bug where upper-right table links would show even if
  renewal impossible
* Cleans up some of the template formatting ( whitespace changes only )

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
This commit is contained in:
Kyle M Hall 2014-01-15 11:08:48 +01:00 committed by Galen Charlton
parent 42c829837c
commit 6ae5a267bc
2 changed files with 22 additions and 13 deletions

View File

@ -11,8 +11,9 @@ var MSG_CONFIRM_DELETE_HOLD = _("Are you sure you want to cancel this hold?");
var MSG_CONFIRM_SUSPEND_HOLDS = _("Are you sure you want to suspend all holds?");
var MSG_CONFIRM_RESUME_HOLDS = _("Are you sure you want to resume all suspended holds?");
$(function() {
$('#opac-user-views').tabs();
$(document).ready(function(){
$('#opac-user-views').tabs();
var dTables = $("#checkoutst,#holdst,#overduest");
dTables.each(function(){
@ -27,8 +28,10 @@ var MSG_CONFIRM_RESUME_HOLDS = _("Are you sure you want to resume all suspended
}));
});
[% IF ( GoogleJackets ) %]KOHA.Google.GetCoverFromIsbn();[% END %]
[% IF ( OpacRenewalAllowed && canrenew && !userdebarred ) %]$("#renewselected").submit(function(){
[% IF ( GoogleJackets ) %]KOHA.Google.GetCoverFromIsbn();[% END %]
[% IF ( OpacRenewalAllowed && canrenew && !userdebarred ) %]
$("#renewselected").submit(function(){
valid = false;
$("input[type=checkbox]").each(function(){
if($(this).is(':checked')){
@ -46,9 +49,14 @@ var MSG_CONFIRM_RESUME_HOLDS = _("Are you sure you want to resume all suspended
$("body").on("click","#renewall_link",function(){
$("#renewall").submit();
});
$("#checkoutst caption").append("<div id=\"renewcontrols\"><a id=\"renewselected_link\" href=\"#\">"+_("Renew selected")+"</a> <a id=\"renewall_link\" href=\"#\">"+_("Renew all")+"</a></div>");[% END %]
$( ".suspend-until" ).datepicker({ minDate: 1 }); // Require that "until date" be in the future
});
[% IF ( canrenew && !userdebarred && OpacRenewalAllowed && !( borrower.is_expired && borrower.BlockExpiredPatronOpacActions ) ) %]
$("#checkoutst caption").append("<div id=\"renewcontrols\"><a id=\"renewselected_link\" href=\"#\">"+_("Renew selected")+"</a> <a id=\"renewall_link\" href=\"#\">"+_("Renew all")+"</a></div>");
[% END %]
[% END %]
$( ".suspend-until" ).datepicker({ minDate: 1 }); // Require that "until date" be in the future
});
//]]>
</script>
</head>
@ -105,7 +113,7 @@ var MSG_CONFIRM_RESUME_HOLDS = _("Are you sure you want to resume all suspended
<string>Please note:</string>
<span>
Your account renewal failed because of the following:
[% FOREACH error IN RENEW_ERROR.split('|') %]
[% FOREACH error IN RENEW_ERROR.split('\|') %]
[% IF error == 'card_expired' %]
Your account has expired. Please contact the library for more information.
[% ELSIF error == 'too_many' %]
@ -165,7 +173,7 @@ var MSG_CONFIRM_RESUME_HOLDS = _("Are you sure you want to resume all suspended
[% UNLESS ( item_level_itypes ) %]<th>Item type</th> [% END %]
[% IF ( show_barcode ) %]<th>Barcode</th>[% END %]
<th>Call No.</th>
[% IF ( OpacRenewalAllowed ) %]
[% IF ( OpacRenewalAllowed && !( borrower.is_expired && borrower.BlockExpiredPatronOpacActions ) ) %]
<th class="nosort">Renew</th>
[% END %]
[% IF ( OPACFinesTab ) %]
@ -213,7 +221,7 @@ var MSG_CONFIRM_RESUME_HOLDS = _("Are you sure you want to resume all suspended
[% UNLESS ( item_level_itypes ) %]<td class="itype">[% IF ( ISSUE.imageurl ) %]<img src="[% ISSUE.imageurl %]" title="[% ISSUE.description %]" alt="[% ISSUE.description %]" />[% END %] [% ISSUE.description %]</td>[% END %]
[% IF ( show_barcode ) %]<td class="barcode">[% ISSUE.barcode %]</td>[% END %]
<td class="call_no">[% ISSUE.itemcallnumber %]</td>
[% IF ( OpacRenewalAllowed ) %]
[% IF ( OpacRenewalAllowed && !( borrower.is_expired && borrower.BlockExpiredPatronOpacActions ) ) %]
<td class="renew">
[% IF ( ISSUE.status ) %]
[% IF ( canrenew ) %]
@ -239,11 +247,11 @@ var MSG_CONFIRM_RESUME_HOLDS = _("Are you sure you want to resume all suspended
</tr>
[% END %]</tbody>
</table>
[% IF ( canrenew && !userdebarred && OpacRenewalAllowed ) %]
<input type="submit" value="Renew selected" />
[% IF ( canrenew && !userdebarred && OpacRenewalAllowed && !( borrower.is_expired && borrower.BlockExpiredPatronOpacActions ) ) %]
<input type="submit" value="Renew Selected" />
[% END %]
</form>
[% IF ( canrenew && !userdebarred && OpacRenewalAllowed ) %]
[% IF ( canrenew && !userdebarred && OpacRenewalAllowed && !( borrower.is_expired && borrower.BlockExpiredPatronOpacActions ) ) %]
<form id="renewall" action="/cgi-bin/koha/opac-renew.pl" method="post">
<input type="hidden" name="from" value="opac_user" />
<input type="hidden" name="borrowernumber" value="[% borrowernumber %]" />

View File

@ -144,6 +144,7 @@ $template->param( BORROWER_INFO => \@bordat,
surname => $borr->{surname},
showname => $borr->{showname},
RENEW_ERROR => $renew_error,
borrower => $borr,
);
#get issued items ....