[Koha-bugs] [Bug 13106] Encapsulate Circulation::GetAgeRestriction() and modify it to check borrowers age as well.

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Wed Oct 29 11:33:49 CET 2014


http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13106

Marc Véron <veron at veron.ch> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #32883|0                           |1
        is obsolete|                            |

--- Comment #14 from Marc Véron <veron at veron.ch> ---
Created attachment 32887
  -->
http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=32887&action=edit
Bug 13106 - Encapsulate Circulation::GetAgeRestriction() and modify it to check
borrowers age as well.

This patch moves the logic of deciding whether or not a borrower is old enough
to access this material
to its own function GetAgeRestriction.

This makes it easier to use AgeRestriction elsewhere, like with placing holds.

This feature adds a new function C4::Members::SetAge() to make testing ages a
lot easier.
A ton of Unit tests included.

C4::Circulate::CanBookBeIssued() fixed and issue with undefined
$daysToAgeRestriction per Marc Véron's
suggestion.

Test plan:
(See comment #10 for screenshots about using age restriction)

1) Without patch

Configure Age Restricition (see Syspref AgeRestrictionMarker) and have a biblio
record with e.g. PEGI 99 in age restriction field
Try to check out to a patron with age < 99
Check out should be blocked
Change entry in age restriction field to PEGI99
Check out schould now be blocked

2) With patch
Try checkouts again, behaviour should be th same.

Signed-off-by: Marc Véron <veron at veron.ch>

-- 
You are receiving this mail because:
You are watching all bug changes.


More information about the Koha-bugs mailing list