From c189145a6e3cb912e2aae8c2a482655055e7d8bd Mon Sep 17 00:00:00 2001 From: Kyle M Hall Date: Wed, 15 Jan 2014 11:08:48 +0100 Subject: [PATCH] Bug 6739 - expired patrons not blocked from opac actions - Followup 2 * 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 Signed-off-by: Katrin Fischer --- koha-tmpl/opac-tmpl/prog/en/modules/opac-user.tt | 34 +++++++++++++--------- opac/opac-user.pl | 1 + 2 files changed, 22 insertions(+), 13 deletions(-) diff --git a/koha-tmpl/opac-tmpl/prog/en/modules/opac-user.tt b/koha-tmpl/opac-tmpl/prog/en/modules/opac-user.tt index 492ae94..e465559 100644 --- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-user.tt +++ b/koha-tmpl/opac-tmpl/prog/en/modules/opac-user.tt @@ -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 $("#renewall_link").live('click',function(){ $("#renewall").submit(); }); - $("#checkoutst caption").append("");[% 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(""); + [% END %] + [% END %] + + $( ".suspend-until" ).datepicker({ minDate: 1 }); // Require that "until date" be in the future + + }); //]]> @@ -105,7 +113,7 @@ var MSG_CONFIRM_RESUME_HOLDS = _("Are you sure you want to resume all suspended Please note: 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' %] @@ -162,7 +170,7 @@ var MSG_CONFIRM_RESUME_HOLDS = _("Are you sure you want to resume all suspended [% UNLESS ( item_level_itypes ) %]Item type [% END %] [% IF ( show_barcode ) %]Barcode[% END %] Call No. - [% IF ( OpacRenewalAllowed ) %] + [% IF ( OpacRenewalAllowed && !( borrower.is_expired && borrower.BlockExpiredPatronOpacActions ) ) %] Renew [% END %] [% IF ( OPACFinesTab ) %] @@ -210,7 +218,7 @@ var MSG_CONFIRM_RESUME_HOLDS = _("Are you sure you want to resume all suspended [% UNLESS ( item_level_itypes ) %][% IF ( ISSUE.imageurl ) %][% ISSUE.description %][% END %] [% ISSUE.description %][% END %] [% IF ( show_barcode ) %][% ISSUE.barcode %][% END %] [% ISSUE.itemcallnumber %] - [% IF ( OpacRenewalAllowed ) %] + [% IF ( OpacRenewalAllowed && !( borrower.is_expired && borrower.BlockExpiredPatronOpacActions ) ) %] [% IF ( ISSUE.status ) %][% IF ( canrenew ) %] Renew[% END %] ([% ISSUE.renewsleft %] of [% ISSUE.renewsallowed %] renewals remaining) [% ELSE %] Not renewable[% IF ( ISSUE.too_many ) %] ([% ISSUE.renewsleft %] of [% ISSUE.renewsallowed %] renewals remaining)[% ELSE %][% IF ( ISSUE.on_reserve ) %] (On hold)[% END %][% END %] @@ -225,11 +233,11 @@ var MSG_CONFIRM_RESUME_HOLDS = _("Are you sure you want to resume all suspended [% END %] - [% IF ( canrenew && !userdebarred && OpacRenewalAllowed ) %] - + [% IF ( canrenew && !userdebarred && OpacRenewalAllowed && !( borrower.is_expired && borrower.BlockExpiredPatronOpacActions ) ) %] + [% END %] - [% IF ( canrenew && !userdebarred && OpacRenewalAllowed ) %] + [% IF ( canrenew && !userdebarred && OpacRenewalAllowed && !( borrower.is_expired && borrower.BlockExpiredPatronOpacActions ) ) %]
diff --git a/opac/opac-user.pl b/opac/opac-user.pl index 1a588e7..b06ad9b 100755 --- a/opac/opac-user.pl +++ b/opac/opac-user.pl @@ -144,6 +144,7 @@ $template->param( BORROWER_INFO => \@bordat, surname => $borr->{surname}, showname => $borr->{showname}, RENEW_ERROR => $renew_error, + borrower => $borr, ); #get issued items .... -- 1.7.10.4