Bugzilla – Attachment 33459 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]
[SIGNED-OFF] Bug 12133: Guarantor requirements when registering a patron
SIGNED-OFF-Bug-12133-Guarantor-requirements-when-r.patch (text/plain), 5.90 KB, created by
Pierre-Paul Paquin
on 2014-11-11 16:08:17 UTC
(
hide
)
Description:
[SIGNED-OFF] Bug 12133: Guarantor requirements when registering a patron
Filename:
MIME Type:
Creator:
Pierre-Paul Paquin
Created:
2014-11-11 16:08:17 UTC
Size:
5.90 KB
patch
obsolete
>From a6d054dd517248d1597ebc658fe3c40e75b41bbb 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] [SIGNED-OFF] 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. > >Signed-off-by: ppp <ppp@inlibro.com> >--- > installer/data/mysql/sysprefs.sql | 1 + > installer/data/mysql/updatedatabase.pl | 11 +++++++++++ > .../prog/en/modules/admin/preferences/patrons.pref | 7 +++++++ > .../prog/en/modules/members/memberentrygen.tt | 7 +++++++ > members/memberentry.pl | 7 +++++++ > 5 files changed, 33 insertions(+) > >diff --git a/installer/data/mysql/sysprefs.sql b/installer/data/mysql/sysprefs.sql >index ff27608..2394650 100644 >--- a/installer/data/mysql/sysprefs.sql >+++ b/installer/data/mysql/sysprefs.sql >@@ -83,6 +83,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 5ada385..1cd39ce 100755 >--- a/installer/data/mysql/updatedatabase.pl >+++ b/installer/data/mysql/updatedatabase.pl >@@ -9438,6 +9438,17 @@ 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 2469431..513b172 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 56cc570..4f0f30f 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 %] >@@ -383,6 +389,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 3c7f648..373ae6d 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.7.9.5
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