From 831b9cb9b555d64865c9eb02162fbbd63b2f81a0 Mon Sep 17 00:00:00 2001 From: radiuscz Date: Sat, 29 Oct 2016 03:24:39 +0200 Subject: [PATCH] Bug 17492: Removed extra IFs This patch removes unnecessary "if" conditions from html template files. Removed 'flagged' template parameter in circ/circulation.pl. Test plan: 1) Apply patch 2) Create a patron and assign him a category having age limits set 3) Change patron's age to be older/younger than category's limits 4) At "Check out" and "Details" tabs you should see a warning with a button allowing to change the category, eg.: - http://prntscr.com/cz7ch3 - http://prntscr.com/cz7em4 - http://prntscr.com/cz7dj1 5) Set a valid category according to patron's age 6) Warning should disappear 7) Perform similar test again, but instead of changing the age change the limits of a category 8) During tests verify "Change category" button everytime opens "Modify patron" page: http://prntscr.com/cz7g5q --- circ/circulation.pl | 1 - .../prog/en/includes/category-out-of-age-limit.inc | 2 -- .../intranet-tmpl/prog/en/modules/circ/circulation.tt | 17 ++++++++--------- 3 files changed, 8 insertions(+), 12 deletions(-) diff --git a/circ/circulation.pl b/circ/circulation.pl index 6399d42..6cd2f0c 100755 --- a/circ/circulation.pl +++ b/circ/circulation.pl @@ -317,7 +317,6 @@ if ($borrowernumber) { my $borrowercategory = Koha::Patron::Categories->find($borrower->{ 'categorycode' }); my ($low,$high) = ($borrowercategory->dateofbirthrequired, $borrowercategory->upperagelimit); if (($high && ($age > $high)) or ($age < $low)) { - $template->param( flagged => 1 ); $template->param( age_limitations => 1 ); $template->param( age_low => $low ); $template->param( age_high => $high ); diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/category-out-of-age-limit.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/category-out-of-age-limit.inc index 825e8b7..982df7b 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/category-out-of-age-limit.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/category-out-of-age-limit.inc @@ -1,6 +1,4 @@ -[% IF age_limitations %]
  • Patron's age is incorrect for their category. Ages allowed are [% age_low %]-[% age_high %]. Change category
  • -[% END %] 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 ac8ede3..2ff191f 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt @@ -790,15 +790,14 @@ No patron matched [% message | html %] [% IF ( odues ) %]
  • [% IF ( nonreturns ) %]Overdues: Patron has ITEMS OVERDUE. See highlighted items below[% END %]
  • [% END %] - [% IF ( charges || age_limitations ) %] - [% IF charges %] - [% INCLUDE 'blocked-fines.inc' - fines = chargesamount - %] - [% END %] - [% IF age_limitations %] - [% INCLUDE 'category-out-of-age-limit.inc' %] - [% END %] + [% IF charges %] + [% INCLUDE 'blocked-fines.inc' + fines = chargesamount + %] + [% END %] + + [% IF age_limitations %] + [% INCLUDE 'category-out-of-age-limit.inc' %] [% END %] [% IF ( charges_guarantees ) %] -- 2.1.4