Bugzilla – Attachment 27584 Details for
Bug 12133
Guarantor requirements when registering a patron
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Guarantor requirements when registering a patron
0001-Bug-12133-Guarantor-requirements-when-registering-a-.patch (text/plain), 5.89 KB, created by
paxed
on 2014-04-25 09:41:50 UTC
(
hide
)
Description:
Guarantor requirements when registering a patron
Filename:
MIME Type:
Creator:
paxed
Created:
2014-04-25 09:41:50 UTC
Size:
5.89 KB
patch
obsolete
>From 7faf0a158f7e43731a56d113b7162c6c441bfc27 Mon Sep 17 00:00:00 2001 >From: Pasi Kallinen <pasi.kallinen@pttk.fi> >Date: Thu, 24 Apr 2014 09:02:51 +0300 >Subject: [PATCH] Bug 12133: Guarantor requirements when registering a patron > >Add two requirements when registering a new patron: > >- A child patron must have a guarantor. This is controlled by > a new syspref ChildNeedsGuarantor. >- A guarantor cannot be a guarantee. >--- > installer/data/mysql/sysprefs.sql | 1 + > installer/data/mysql/updatedatabase.pl | 12 ++++++++++++ > .../prog/en/modules/admin/preferences/patrons.pref | 7 +++++++ > .../intranet-tmpl/prog/en/modules/members/memberentrygen.tt | 7 +++++++ > members/memberentry.pl | 7 +++++++ > 5 files changed, 34 insertions(+) > >diff --git a/installer/data/mysql/sysprefs.sql b/installer/data/mysql/sysprefs.sql >index 05a0031..5300645 100644 >--- a/installer/data/mysql/sysprefs.sql >+++ b/installer/data/mysql/sysprefs.sql >@@ -79,6 +79,7 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` > ('CatalogModuleRelink','0',NULL,'If OFF the linker will never replace the authids that are set in the cataloging module.','YesNo'), > ('CataloguingLog','1',NULL,'If ON, log edit/create/delete actions on bibliographic data. WARNING: this feature is very resource consuming.','YesNo'), > ('checkdigit','none','none|katipo','If ON, enable checks on patron cardnumber: none or \"Katipo\" style checks','Choice'), >+('ChildNeedsGuarantor', '0', NULL, 'If ON, a child patron must have a guarantor when adding the patron.', 'YesNo'), > ('CircAutocompl','1',NULL,'If ON, autocompletion is enabled for the Circulation input','YesNo'), > ('CircAutoPrintQuickSlip','qslip',NULL,'Choose what should happen when an empty barcode field is submitted in circulation: Display a print quick slip window, Display a print slip window or Clear the screen.','Choice'), > ('CircControl','ItemHomeLibrary','PickupLibrary|PatronLibrary|ItemHomeLibrary','Specify the agency that controls the circulation and fines policy','Choice'), >diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl >index 8917081..bbff6b6 100755 >--- a/installer/data/mysql/updatedatabase.pl >+++ b/installer/data/mysql/updatedatabase.pl >@@ -8202,6 +8202,18 @@ if ( CheckVersion($DBversion) ) { > SetVersion($DBversion); > } > >+$DBversion = "3.15.00.XXX"; >+if ( CheckVersion($DBversion) ) { >+ $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') >+ }); >+ >+ print "Upgrade to $DBversion done (Bug 12133 - Guarantor requirements when registering a patron)\n"; >+ SetVersion($DBversion); >+} >+ >+ > =head1 FUNCTIONS > > =head2 TableExists($table) >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/patrons.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/patrons.pref >index 9732d1a..2991bf8 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/patrons.pref >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/patrons.pref >@@ -56,6 +56,13 @@ Patrons: > katipo: Do > - check and construct borrower card numbers in the Katipo style. This overrides <code>autoMemberNum</code> if on. > - >+ - "A child patron" >+ - pref: "ChildNeedsGuarantor" >+ choices: >+ yes: "must have" >+ no: "doesn't need" >+ - a guarantor when adding the patron. >+ - > - pref: EnhancedMessagingPreferences > choices: > yes: Allow >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt >index 694432e..fddbdac 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt >@@ -175,6 +175,12 @@ > <div class="dialog alert"> > <p>The following fields are wrong. Please fix them.</p> > <ul> >+ [% IF ( ERROR_child_no_guarantor ) %] >+ <li id="ERROR_child_no_guarantor">A child patron needs a guarantor.</li> >+ [% END %] >+ [% IF ( ERROR_guarantor_is_guarantee ) %] >+ <li id="ERROR_guarantor_is_guarantee">A guarantor cannot be a guarantee.</li> >+ [% END %] > [% IF ( ERROR_login_exist ) %] > <li id="ERROR_login_exist">Username/password already exists.</li> > [% END %] >@@ -384,6 +390,7 @@ > </li> > [% ELSE %] > [% IF ( C ) %] >+ [% IF ( Koha.Preference('ChildNeedsGuarantor') ) %]<li id="guarantor_required"><span class="required">Required</span></li>[% END %] > [% IF ( guarantorid ) %] > <li id="contact-details"> > [% ELSE %] >diff --git a/members/memberentry.pl b/members/memberentry.pl >index ff92447..774e8e7 100755 >--- a/members/memberentry.pl >+++ b/members/memberentry.pl >@@ -262,9 +262,16 @@ if ( $guarantorid and ( $category_type eq 'C' || $category_type eq 'P' )) { > $newdata{$_} = $guarantordata->{$_}; > } > } >+ >+ push @errors, 'ERROR_guarantor_is_guarantee' if ( $guarantordata->{'guarantorid'} && >+ ($op eq 'save' || $op eq 'insert') ); > } > } > >+push @errors, 'ERROR_child_no_guarantor' if ( $category_type eq 'C' && !$guarantorid && >+ ($op eq 'save' || $op eq 'insert') && >+ C4::Context->preference('ChildNeedsGuarantor') ); >+ > ###############test to take the right zipcode, country and city name ############## > # set only if parameter was passed from the form > $newdata{'city'} = $input->param('city') if defined($input->param('city')); >-- >1.8.3.2 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 12133
:
27517
|
27584
|
33459
|
91482
|
94371
|
94538
|
94544
|
99629
|
113099
|
113100
|
134013
|
134014
|
134015
|
146827
|
147440
|
148058
|
148070
|
152706
|
153082
|
153154
|
154300
|
154316
|
156387
|
156446
|
156447
|
158344
|
158345
|
158346
|
158919
|
158979