From 6ae5a267bc011a0fbecb91f98192582ed868ffd2 Mon Sep 17 00:00:00 2001 From: Kyle M Hall Date: Wed, 15 Jan 2014 11:08:48 +0100 Subject: [PATCH] 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 Signed-off-by: Katrin Fischer Signed-off-by: Galen Charlton --- .../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 882a9ba892..c8f0a3af61 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 $("body").on("click","#renewall_link",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' %] @@ -165,7 +173,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 ) %] @@ -213,7 +221,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 ) %] @@ -239,11 +247,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 935850e513..9deada58dd 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 .... -- 2.39.5