@@ -, +, @@ patron - A child patron must have a guarantor. This is controlled by a new syspref ChildNeedsGuarantor. - A guarantor doesn't have to be a patron. This is controlled by a new syspref GuarantorHasToBePatron. - A guarantor cannot be a guarantee. - Add a child patron without a guarantor. Saving the patron - Add a child patron with a guarantor who has a guarantor. Saving is - Apply this patch. - Turn syspref "ChildNeedsGuarantor" ON. - Add a child patron with a guarantor who has a guarantor. Error - Add a child patron without a guarantor and error "Child needs a - Add the guarantor info (only surname is needed) and saving the patron should be succesful. - Turn syspref "GuarantorNeedsToBePatron" ON. - Add a child patron this time with guarantor info and error - Add existing patron as guarantor and now saving the patron - Add a child patron with a guarantor who is also a guarantee. - Turn syspref "ChildNeedsGuarantor" OFF. - Add a child patron without a guarantor. Saving patron should --- installer/data/mysql/atomicupdate/bug_12133.perl | 16 ++++++++++++++++ .../en/modules/admin/preferences/patrons.pref | 15 ++++++++++++++- .../prog/en/modules/members/memberentrygen.tt | 11 +++++++++++ members/memberentry.pl | 13 +++++++++++++ 4 files changed, 54 insertions(+), 1 deletion(-) create mode 100644 installer/data/mysql/atomicupdate/bug_12133.perl --- a/installer/data/mysql/atomicupdate/bug_12133.perl +++ a/installer/data/mysql/atomicupdate/bug_12133.perl @@ -0,0 +1,16 @@ +$DBversion = 'XXX'; # will be replaced by the RM +if( CheckVersion( $DBversion ) ) { + # you can use $dbh here like: + $dbh->do( q{ + INSERT IGNORE INTO systempreferences (variable,value,explanation,options,type) + VALUES('ChildNeedsGuarantor', 0, 'If ON, a child patron must have a guarantor when adding the patron.', '', 'YesNo')} ); + + # or perform some test and warn + # if( !column_exists( 'biblio', 'biblionumber' ) ) { + # warn "There is something wrong"; + # } + + # Always end with this (adjust the bug info) + SetVersion( $DBversion ); + print "Upgrade to $DBversion done (Bug 12133 - Guarantor requirements when registering a patron)\n"; +} --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/patrons.pref +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/patrons.pref @@ -66,6 +66,13 @@ Patrons: softno: "Unless overridden by patron category, do not" hardno: "Do not" - " check borrower checkout history to see if the current item has been checked out before." + - + - "A child patron" + - pref: "ChildNeedsGuarantor" + choices: + yes: "must have" + no: "doesn't need" + - a guarantor when adding the patron. - - pref: EnhancedMessagingPreferences choices: @@ -227,7 +234,13 @@ Patrons: no: Allow all permitted users - "to access/change superlibrarian privileges." - "
NOTE: A permitted user needs to have the 'permissions' flag (if no superlibrarian)." - + - + - "The guarantor" + - pref: "GuarantorHasToBePatron" + choices: + yes: "has to be" + no: "doesn't have to be" + - a patron. Privacy: - - Use the following URL --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt @@ -78,6 +78,15 @@

The following fields are wrong. Please fix them.