From b2e3996964c6b6ca62692608e038a893b98cc0ff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Radek=20=C5=A0iman?= Date: Fri, 2 Dec 2016 01:23:06 +0100 Subject: [PATCH] Bug 17718: Smartform API allowed in patron registration Test plan: 1) Apply the patch 2) Setup preferences "SmartformEnable", "SmartformClientID" 3) Edit a patron 4) Start entering street in an address 5) Select a street from autocomplete 6) Continue entering street number and select the right address 7) ZIP and city should get values from autocomplete 8) Disable SmartformEnable and repeat steps above 9) No autocompletion should occur --- .../mysql/atomicupdate/bug_17718-add_smartform_syspref.sql | 2 ++ installer/data/mysql/sysprefs.sql | 2 ++ .../prog/en/includes/member-alt-address-style-de.inc | 11 +++++++---- .../prog/en/includes/member-alt-contact-style-de.inc | 9 ++++++--- .../prog/en/includes/member-main-address-style-de.inc | 11 +++++++---- .../prog/en/modules/admin/preferences/patrons.pref | 11 +++++++++++ .../intranet-tmpl/prog/en/modules/members/memberentrygen.tt | 10 ++++++++++ members/memberentry.pl | 3 +++ 8 files changed, 48 insertions(+), 11 deletions(-) create mode 100644 installer/data/mysql/atomicupdate/bug_17718-add_smartform_syspref.sql diff --git a/installer/data/mysql/atomicupdate/bug_17718-add_smartform_syspref.sql b/installer/data/mysql/atomicupdate/bug_17718-add_smartform_syspref.sql new file mode 100644 index 0000000..512688f --- /dev/null +++ b/installer/data/mysql/atomicupdate/bug_17718-add_smartform_syspref.sql @@ -0,0 +1,2 @@ +INSERT IGNORE INTO systempreferences (variable,value,explanation,options,type) VALUES ('SmartformEnable', '0', 'If ON, enable Smartform to simplify address entering during patron registration.', NULL, 'YesNo'); +INSERT IGNORE INTO systempreferences (variable,value,explanation,options,type) VALUES ('SmartformClientID', '', 'Smartform service client ID', '', 'Free'); diff --git a/installer/data/mysql/sysprefs.sql b/installer/data/mysql/sysprefs.sql index ef83c3d..064e729 100644 --- a/installer/data/mysql/sysprefs.sql +++ b/installer/data/mysql/sysprefs.sql @@ -466,6 +466,8 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` ('ShowReviewer','full','none|full|first|surname|firstandinitial|username','Choose how a commenter\'s identity is presented alongside comments in the OPAC','Choice'), ('ShowReviewerPhoto','1','','If ON, photo of reviewer will be shown beside comments in OPAC','YesNo'), ('SlipCSS','',NULL,'Slips CSS url.','free'), +('SmartformEnable', '0', NULL, 'If ON, enable Smartform service to simplify address entering during patron registration.', 'YesNo'), +('SmartformClientID', '', '', 'Smartform service client ID', 'Free'), ('SMSSendDriver','','','Sets which SMS::Send driver is used to send SMS messages.','free'), ('SMSSendPassword', '', '', 'Password used to send SMS messages', 'free'), ('SMSSendUsername', '', '', 'Username/Login used to send SMS messages', 'free'), diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/member-alt-address-style-de.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/member-alt-address-style-de.inc index dba4222..080dd37 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/member-alt-address-style-de.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/member-alt-address-style-de.inc @@ -8,7 +8,7 @@ - + [% IF ( mandatoryB_address ) %]Required[% END %] [% END %] @@ -43,7 +43,7 @@ - + [% IF ( mandatoryB_streetnumber ) %]Required[% END %] [% END %] @@ -68,7 +68,7 @@ - + [% IF ( mandatoryB_zipcode ) %]Required[% END %] [% END %] @@ -80,7 +80,7 @@ - + [% IF ( mandatoryB_city ) %]Required[% END %] [% END %] @@ -144,4 +144,7 @@ [% END %] + [% IF SmartformEnable %] + + [% END %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/member-alt-contact-style-de.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/member-alt-contact-style-de.inc index 2b9fb71..b36ee16 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/member-alt-contact-style-de.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/member-alt-contact-style-de.inc @@ -32,7 +32,7 @@ - + [% IF ( mandatoryaltcontactaddress1 ) %]Required[% END %] [% END %] @@ -56,7 +56,7 @@ - + [% IF ( mandatoryaltcontactzipcode ) %]Required[% END %] [% END %] @@ -68,7 +68,7 @@ - + [% IF ( mandatoryaltcontactaddress3 ) %]Required[% END %] [% END %] @@ -109,4 +109,7 @@ [% END %] + [% IF SmartformEnable %] + + [% END %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/member-main-address-style-de.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/member-main-address-style-de.inc index d047400..be080c4 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/member-main-address-style-de.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/member-main-address-style-de.inc @@ -31,7 +31,7 @@ - + [% IF ( mandatoryaddress ) %]Required[% END %] [% END %] @@ -43,7 +43,7 @@ - + [% IF ( mandatorystreetnumber ) %]Required[% END %] [% END %] @@ -67,7 +67,7 @@ - + [% IF ( mandatoryzipcode ) %]Required[% END %] [% END %] @@ -79,7 +79,7 @@ - + [% IF cities.count %]or choose