Bugzilla – Attachment 57995 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]
[SIGNED-OFF] Bug 17718: Smartform API allowed in patron edit form
SIGNED-OFF-Bug-17718-Smartform-API-allowed-in-patr.patch (text/plain), 16.88 KB, created by
Josef Moravec
on 2016-12-06 09:21:10 UTC
(
hide
)
Description:
[SIGNED-OFF] Bug 17718: Smartform API allowed in patron edit form
Filename:
MIME Type:
Creator:
Josef Moravec
Created:
2016-12-06 09:21:10 UTC
Size:
16.88 KB
patch
obsolete
>From 6ae0a6f224dd6cac812b4cfd35db0166202f9f94 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] [SIGNED-OFF] Bug 17718: Smartform API allowed in patron edit > form > >Test plan: >1) Apply the patch >2) Setup preferences "SmartformEnable", "SmartformClientID" > (register at smartform.cz or use "smartform" as the client ID) >3) Show/hide streetnumber as desired in BorrowerUnwantedField pref > (eg. fill in "streetnumber|B_streetnumber") >4) Edit a patron >5) Start entering street in an address field >6) Select a street from autocomplete >7) Continue entering street number and select the right address >8) ZIP and city should get values from autocomplete >9) Disable SmartformEnable and repeat steps above >10) No autocompletion should occur > >Signed-off-by: Josef Moravec <josef.moravec@gmail.com> >--- > .../bug_17718-add_smartform_syspref.sql | 2 + > installer/data/mysql/sysprefs.sql | 2 + > .../en/includes/member-alt-address-style-de.inc | 44 +++++++++++++++++----- > .../en/includes/member-alt-contact-style-de.inc | 36 +++++++++++++----- > .../en/includes/member-main-address-style-de.inc | 24 ++++++++++++ > .../prog/en/modules/admin/preferences/patrons.pref | 11 ++++++ > .../prog/en/modules/members/memberentrygen.tt | 10 +++++ > 7 files changed, 109 insertions(+), 20 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..004193e 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 >@@ -1,3 +1,4 @@ >+[% USE Koha %] > <fieldset class="rows" id="memberentry_address"> > <legend id="alt_address_lgd">Alternate address</legend><ol> > [% UNLESS noB_address %] >@@ -8,7 +9,15 @@ > <label for="B_address"> > [% END %] > Address: </label> >+ [% IF Koha.Preference('SmartformEnable') %] >+ [% IF ( noB_streetnumber ) %] >+ <input type="text" id="B_address" name="B_address" size="40" value="[% B_address %]" class="smartform-instance-alt-address smartform-street-and-number" /> >+ [% ELSE %] >+ <input type="text" id="B_address" name="B_address" size="40" value="[% B_address %]" class="smartform-instance-alt-address smartform-street" /> >+ [% END %] >+ [% ELSE %] > <input type="text" id="B_address" name="B_address" size="40" value="[% B_address %]" /> >+ [% END %] > [% IF ( mandatoryB_address ) %]<span class="required">Required</span>[% END %] > </li> > [% END %] >@@ -43,7 +52,11 @@ > <label for="B_streetnumber"> > [% END %] > Street Number: </label> >+ [% IF Koha.Preference('SmartformEnable') %] >+ <input type="text" id="B_streetnumber" name="B_streetnumber" size="5" value="[% B_streetnumber %]" class="smartform-instance-alt-address smartform-number" /> >+ [% ELSE %] > <input type="text" id="B_streetnumber" name="B_streetnumber" size="5" value="[% B_streetnumber %]" /> >+ [% END %] > [% IF ( mandatoryB_streetnumber ) %]<span class="required">Required</span>[% END %] > </li> > [% END %] >@@ -61,16 +74,20 @@ > </li> > [% END %] > [% UNLESS noB_zipcode %] >- <li> >- [% IF ( mandatoryB_zipcode ) %] >- <label for="B_zipcode" class="required"> >- [% ELSE %] >- <label for="B_zipcode"> >- [% END %] >- ZIP/Postal code: </label> >+ <li> >+ [% IF ( mandatoryB_zipcode ) %] >+ <label for="B_zipcode" class="required"> >+ [% ELSE %] >+ <label for="B_zipcode"> >+ [% END %] >+ ZIP/Postal code: </label> >+ [% IF Koha.Preference('SmartformEnable') %] >+ <input type="text" id="B_zipcode" name="B_zipcode" maxlength="10" size="10" value="[% B_zipcode %]" class="smartform-instance-alt-address smartform-zip" /> >+ [% ELSE %] > <input type="text" id="B_zipcode" name="B_zipcode" maxlength="10" size="10" value="[% B_zipcode %]" /> >- [% IF ( mandatoryB_zipcode ) %]<span class="required">Required</span>[% END %] >- </li> >+ [% END %] >+ [% IF ( mandatoryB_zipcode ) %]<span class="required">Required</span>[% END %] >+ </li> > [% END %] > [% UNLESS noB_city %] > <li> >@@ -80,7 +97,11 @@ > <label for="B_city"> > [% END %] > City: </label> >- <input type="text" id="B_city" name="B_city" size="20" value="[% B_city %]" /> >+ [% IF Koha.Preference('SmartformEnable') %] >+ <input type="text" id="B_city" name="B_city" size="20" value="[% B_city %]" class="smartform-instance-alt-address smartform-city" /> >+ [% ELSE %] >+ <input type="text" id="B_city" name="B_city" size="20" value="[% B_city %]" /> >+ [% END %] > [% IF ( mandatoryB_city ) %]<span class="required">Required</span>[% END %] > </li> > [% END %] >@@ -144,4 +165,7 @@ > </li> > [% END %] > </ol> >+ [% IF Koha.Preference('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..d1fbb70 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 >@@ -1,3 +1,4 @@ >+[% USE Koha %] > <fieldset class="rows" id="memberentry_altaddress"> > <legend id="alt_contact_lgd">Alternate contact</legend><ol> > [% UNLESS noaltcontactsurname %] >@@ -32,7 +33,11 @@ > <label for="altcontactaddress1"> > [% END %] > Address:</label> >+ [% IF Koha.Preference('SmartformEnable') %] >+ <input type="text" name="altcontactaddress1" id="altcontactaddress1" value="[% altcontactaddress1 %]" size="40" class="smartform-instance-alt-contact smartform-street-and-number" /> >+ [% ELSE %] > <input type="text" name="altcontactaddress1" id="altcontactaddress1" value="[% altcontactaddress1 %]" size="40" /> >+ [% END %] > [% IF ( mandatoryaltcontactaddress1 ) %]<span class="required">Required</span>[% END %] > </li> > [% END %] >@@ -49,16 +54,20 @@ > </li> > [% END %] > [% UNLESS noaltcontactzipcode %] >- <li> >- [% IF ( mandatoryaltcontactzipcode ) %] >- <label for="altcontactzipcode" class="required"> >- [% ELSE %] >- <label for="altcontactzipcode"> >- [% END %] >- ZIP/Postal code:</label> >+ <li> >+ [% IF ( mandatoryaltcontactzipcode ) %] >+ <label for="altcontactzipcode" class="required"> >+ [% ELSE %] >+ <label for="altcontactzipcode"> >+ [% END %] >+ ZIP/Postal code:</label> >+ [% IF Koha.Preference('SmartformEnable') %] >+ <input type="text" name="altcontactzipcode" id="altcontactzipcode" value="[% altcontactzipcode %]" size="5" class="smartform-instance-alt-contact smartform-zip" /> >+ [% ELSE %] > <input type="text" name="altcontactzipcode" id="altcontactzipcode" value="[% altcontactzipcode %]" size="5" /> >- [% IF ( mandatoryaltcontactzipcode ) %]<span class="required">Required</span>[% END %] >- </li> >+ [% END %] >+ [% IF ( mandatoryaltcontactzipcode ) %]<span class="required">Required</span>[% END %] >+ </li> > [% END %] > [% UNLESS noaltcontactaddress3 %] > <li> >@@ -68,7 +77,11 @@ > <label for="altcontactaddress3"> > [% END %] > City:</label> >- <input type="text" name="altcontactaddress3" id="altcontactaddress3" value="[% altcontactaddress3 %]" size="20" /> >+ [% IF Koha.Preference('SmartformEnable') %] >+ <input type="text" name="altcontactaddress3" id="altcontactaddress3" value="[% altcontactaddress3 %]" size="20" class="smartform-instance-alt-contact smartform-city" /> >+ [% ELSE %] >+ <input type="text" name="altcontactaddress3" id="altcontactaddress3" value="[% altcontactaddress3 %]" size="20" /> >+ [% END %] > [% IF ( mandatoryaltcontactaddress3 ) %]<span class="required">Required</span>[% END %] > </li> > [% END %] >@@ -109,4 +122,7 @@ > </li> > [% END %] > </ol> >+ [% IF Koha.Preference('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..bb43dc2 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 >@@ -1,3 +1,4 @@ >+[% USE Koha %] > <fieldset class="rows" id="memberentry_mainaddress"> > <legend id="main_address_lgd">Main address</legend><ol> > [% UNLESS nostreettype %] >@@ -31,7 +32,15 @@ > <label for="address"> > [% END %] > Address: </label> >+ [% IF Koha.Preference('SmartformEnable') %] >+ [% IF ( nostreetnumber ) %] >+ <input type="text" id="address" name="address" size="35" value="[% address %]" class="smartform-instance-main smartform-street-and-number" /> >+ [% ELSE %] >+ <input type="text" id="address" name="address" size="35" value="[% address %]" class="smartform-instance-main smartform-street" /> >+ [% END %] >+ [% ELSE %] > <input type="text" id="address" name="address" size="35" value="[% address %]" /> >+ [% END %] > [% IF ( mandatoryaddress ) %]<span class="required">Required</span>[% END %] > </li> > [% END %] >@@ -43,7 +52,11 @@ > <label for="streetnumber"> > [% END %] > Street number: </label> >+ [% IF Koha.Preference('SmartformEnable') %] >+ <input type="text" id="streetnumber" name="streetnumber" size="5" value="[% streetnumber %]" class="smartform-instance-main smartform-number" /> >+ [% ELSE %] > <input type="text" id="streetnumber" name="streetnumber" size="5" value="[% streetnumber %]" /> >+ [% END %] > [% IF ( mandatorystreetnumber ) %]<span class="required">Required</span>[% END %] > </li> > [% END %] >@@ -67,7 +80,11 @@ > <label for="zipcode"> > [% END %] > ZIP/Postal code: </label> >+ [% IF Koha.Preference('SmartformEnable') %] >+ <input type="text" name="zipcode" id="zipcode" size="10" value="[% zipcode %]" class="smartform-instance-main smartform-zip" /> >+ [% ELSE %] > <input type="text" name="zipcode" id="zipcode" size="10" value="[% zipcode %]" /> >+ [% END %] > [% IF ( mandatoryzipcode ) %]<span class="required">Required</span>[% END %] > </li> > [% END %] >@@ -79,7 +96,11 @@ > <label for="city"> > [% END %] > City: </label> >+ [% IF Koha.Preference('SmartformEnable') %] >+ <input type="text" id="city" name="city" size="20" value="[% city %]" class="smartform-instance-main smartform-city" /> >+ [% ELSE %] > <input type="text" id="city" name="city" size="20" value="[% city %]" /> >+ [% END %] > [% IF cities.count %]or choose > <select id="select_city" name="select_city"> > <option value="|||"></option> >@@ -122,4 +143,7 @@ > </li> > [% END %] > </ol> >+ [% IF Koha.Preference('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..da5777d 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..ce8470f 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 Koha.Preference('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[ >-- >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