Bugzilla – Attachment 57948 Details for
Bug 17718
Allow usage of Smartform API (Czech only)
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 17718: Smartform API allowed in patron registration
Bug-17718-Smartform-API-allowed-in-patron-registra.patch (text/plain), 13.75 KB, created by
Radek Šiman (R-Bit Technology, s.r.o.)
on 2016-12-04 18:48:50 UTC
(
hide
)
Description:
Bug 17718: Smartform API allowed in patron registration
Filename:
MIME Type:
Creator:
Radek Šiman (R-Bit Technology, s.r.o.)
Created:
2016-12-04 18:48:50 UTC
Size:
13.75 KB
patch
obsolete
>From b2e3996964c6b6ca62692608e038a893b98cc0ff Mon Sep 17 00:00:00 2001 >From: =?UTF-8?q?Radek=20=C5=A0iman?= <rbit@rbit.cz> >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 @@ > <label for="B_address"> > [% END %] > Address: </label> >- <input type="text" id="B_address" name="B_address" size="40" value="[% B_address %]" /> >+ <input type="text" id="B_address" name="B_address" size="40" value="[% B_address %]"[% IF SmartformEnable %] class="smartform-instance-alt-address smartform-street"[% END %] /> > [% IF ( mandatoryB_address ) %]<span class="required">Required</span>[% END %] > </li> > [% END %] >@@ -43,7 +43,7 @@ > <label for="B_streetnumber"> > [% END %] > Street Number: </label> >- <input type="text" id="B_streetnumber" name="B_streetnumber" size="5" value="[% B_streetnumber %]" /> >+ <input type="text" id="B_streetnumber" name="B_streetnumber" size="5" value="[% B_streetnumber %]"[% IF SmartformEnable %] class="smartform-instance-alt-address smartform-number"[% END %] /> > [% IF ( mandatoryB_streetnumber ) %]<span class="required">Required</span>[% END %] > </li> > [% END %] >@@ -68,7 +68,7 @@ > <label for="B_zipcode"> > [% END %] > ZIP/Postal code: </label> >- <input type="text" id="B_zipcode" name="B_zipcode" maxlength="10" size="10" value="[% B_zipcode %]" /> >+ <input type="text" id="B_zipcode" name="B_zipcode" maxlength="10" size="10" value="[% B_zipcode %]"[% IF SmartformEnable %] class="smartform-instance-alt-address smartform-zip"[% END %] /> > [% IF ( mandatoryB_zipcode ) %]<span class="required">Required</span>[% END %] > </li> > [% END %] >@@ -80,7 +80,7 @@ > <label for="B_city"> > [% END %] > City: </label> >- <input type="text" id="B_city" name="B_city" size="20" value="[% B_city %]" /> >+ <input type="text" id="B_city" name="B_city" size="20" value="[% B_city %]"[% IF SmartformEnable %] class="smartform-instance-alt-address smartform-city"[% END %] /> > [% IF ( mandatoryB_city ) %]<span class="required">Required</span>[% END %] > </li> > [% END %] >@@ -144,4 +144,7 @@ > </li> > [% END %] > </ol> >+ [% IF SmartformEnable %] >+ <div id="smartform-result-alt-address" style="margin-left: 110px; margin-top:6px;" class="invisible" ></div> >+ [% END %] > </fieldset> >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 @@ > <label for="altcontactaddress1"> > [% END %] > Address:</label> >- <input type="text" name="altcontactaddress1" id="altcontactaddress1" value="[% altcontactaddress1 %]" size="40" /> >+ <input type="text" name="altcontactaddress1" id="altcontactaddress1" value="[% altcontactaddress1 %]" size="40"[% IF SmartformEnable %] class="smartform-instance-alt-contact smartform-street-and-number"[% END %] /> > [% IF ( mandatoryaltcontactaddress1 ) %]<span class="required">Required</span>[% END %] > </li> > [% END %] >@@ -56,7 +56,7 @@ > <label for="altcontactzipcode"> > [% END %] > ZIP/Postal code:</label> >- <input type="text" name="altcontactzipcode" id="altcontactzipcode" value="[% altcontactzipcode %]" size="5" /> >+ <input type="text" name="altcontactzipcode" id="altcontactzipcode" value="[% altcontactzipcode %]" size="5"[% IF SmartformEnable %] class="smartform-instance-alt-contact smartform-zip"[% END %] /> > [% IF ( mandatoryaltcontactzipcode ) %]<span class="required">Required</span>[% END %] > </li> > [% END %] >@@ -68,7 +68,7 @@ > <label for="altcontactaddress3"> > [% END %] > City:</label> >- <input type="text" name="altcontactaddress3" id="altcontactaddress3" value="[% altcontactaddress3 %]" size="20" /> >+ <input type="text" name="altcontactaddress3" id="altcontactaddress3" value="[% altcontactaddress3 %]" size="20"[% IF SmartformEnable %] class="smartform-instance-alt-contact smartform-city"[% END %] /> > [% IF ( mandatoryaltcontactaddress3 ) %]<span class="required">Required</span>[% END %] > </li> > [% END %] >@@ -109,4 +109,7 @@ > </li> > [% END %] > </ol> >+ [% IF SmartformEnable %] >+ <div id="smartform-result-alt-contact" style="margin-left: 110px; margin-top:6px;" class="invisible" ></div> >+ [% END %] > </fieldset> >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 @@ > <label for="address"> > [% END %] > Address: </label> >- <input type="text" id="address" name="address" size="35" value="[% address %]" /> >+ <input type="text" id="address" name="address" size="35" value="[% address %]"[% IF SmartformEnable %] class="smartform-instance-main smartform-street"[% END %] /> > [% IF ( mandatoryaddress ) %]<span class="required">Required</span>[% END %] > </li> > [% END %] >@@ -43,7 +43,7 @@ > <label for="streetnumber"> > [% END %] > Street number: </label> >- <input type="text" id="streetnumber" name="streetnumber" size="5" value="[% streetnumber %]" /> >+ <input type="text" id="streetnumber" name="streetnumber" size="5" value="[% streetnumber %]"[% IF SmartformEnable %] class="smartform-instance-main smartform-number"[% END %] /> > [% IF ( mandatorystreetnumber ) %]<span class="required">Required</span>[% END %] > </li> > [% END %] >@@ -67,7 +67,7 @@ > <label for="zipcode"> > [% END %] > ZIP/Postal code: </label> >- <input type="text" name="zipcode" id="zipcode" size="10" value="[% zipcode %]" /> >+ <input type="text" name="zipcode" id="zipcode" size="10" value="[% zipcode %]"[% IF SmartformEnable %] class="smartform-instance-main smartform-zip"[% END %] /> > [% IF ( mandatoryzipcode ) %]<span class="required">Required</span>[% END %] > </li> > [% END %] >@@ -79,7 +79,7 @@ > <label for="city"> > [% END %] > City: </label> >- <input type="text" id="city" name="city" size="20" value="[% city %]" /> >+ <input type="text" id="city" name="city" size="20" value="[% city %]"[% IF SmartformEnable %] class="smartform-instance-main smartform-city"[% END %] /> > [% IF cities.count %]or choose > <select id="select_city" name="select_city"> > <option value="|||"></option> >@@ -122,4 +122,7 @@ > </li> > [% END %] > </ol> >+ [% IF SmartformEnable %] >+ <div id="smartform-result-main" style="margin-left: 110px; margin-top:6px;" class="invisible" ></div> >+ [% END %] > </fieldset> >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 e0e36d8..185a934 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 >@@ -212,3 +212,14 @@ Patrons: > yes: Do > no: "Don't" > - search the Norwegian national patron database after a local search result was found. >+ "Smartform service (Czech only)": >+ - >+ - pref: SmartformEnable >+ choices: >+ yes: Enable >+ no: Disable >+ - Smartform autocompletion of postal addresses. This service can be used to simplify patron registration. >+ - >+ - Communicate with the Smartform service using >+ - pref: SmartformClientID >+ - as the client ID. >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 a66826d..059b359 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt >@@ -5,6 +5,16 @@ > <title>Koha › Patrons › [% IF ( opadd ) %]Add[% ELSIF ( opduplicate ) %]Duplicate[% ELSE %] Modify[% END %] patron [% IF (firstname) %][% firstname %] [% END %][% IF (surname) %][% surname %] [% END %]([%IF ( categoryname ) %][% categoryname %][% ELSE %][% IF ( I ) %]Organization[% END %][% IF ( A ) %]Adult[% END %][% IF ( C ) %]Child[% END %][% IF ( P ) %]Professional[% END %][% IF ( S ) %]Staff[% END %][% END %])</title> > [% INCLUDE 'doc-head-close.inc' %] > <script type="text/javascript" src="[% interface %]/lib/jquery/plugins/jquery.fixFloat.js"></script> >+[% IF SmartformEnable %] >+<script type="text/javascript" src="http://smartform.cz/api/v1/smartform.js"></script> >+<script type="text/javascript"> >+//<![CDATA[ >+ smartform.beforeInit = function () { >+ smartform.setClientId('[% Koha.Preference('SmartformClientID') %]'); >+ } >+//]]> >+</script> >+[% END %] > [% INCLUDE 'calendar.inc' %] > <script type="text/javascript"> > //<![CDATA[ >diff --git a/members/memberentry.pl b/members/memberentry.pl >index 27e6687..87de51f 100755 >--- a/members/memberentry.pl >+++ b/members/memberentry.pl >@@ -720,6 +720,9 @@ if (C4::Context->preference('EnhancedMessagingPreferences')) { > $template->param(TalkingTechItivaPhone => C4::Context->preference("TalkingTechItivaPhoneNotification")); > } > >+# Smartform service >+$template->param( "SmartformEnable" => C4::Context->preference('SmartformEnable') ); >+ > $template->param( "showguarantor" => ($category_type=~/A|I|S|X/) ? 0 : 1); # associate with step to know where you are > $debug and warn "memberentry step: $step"; > $template->param(%data); >-- >2.1.4
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 17718
:
57948
|
57969
|
57994
|
57995