Bugzilla – Attachment 57969 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: Used Koha.preference instead of passing params to templates from module memberentry.pl
Bug-17718-Used-Kohapreference-instead-of-passing-p.patch (text/plain), 12.80 KB, created by
Radek Šiman (R-Bit Technology, s.r.o.)
on 2016-12-05 14:33:30 UTC
(
hide
)
Description:
Bug 17718: Used Koha.preference instead of passing params to templates from module memberentry.pl
Filename:
MIME Type:
Creator:
Radek Šiman (R-Bit Technology, s.r.o.)
Created:
2016-12-05 14:33:30 UTC
Size:
12.80 KB
patch
obsolete
>From e93c95f4705f0043092edce7e7129d7cd56edb11 Mon Sep 17 00:00:00 2001 >From: =?UTF-8?q?Radek=20=C5=A0iman?= <rbit@rbit.cz> >Date: Mon, 5 Dec 2016 14:34:02 +0100 >Subject: [PATCH] Bug 17718: Used Koha.preference instead of passing params to > templates from module memberentry.pl > >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 >--- > .../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 ++++++----- > .../intranet-tmpl/prog/en/modules/members/memberentrygen.tt | 2 +- > members/memberentry.pl | 3 --- > 5 files changed, 18 insertions(+), 18 deletions(-) > >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 080dd37..8aa17f4 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,7 @@ > <label for="B_address"> > [% END %] > Address: </label> >- <input type="text" id="B_address" name="B_address" size="40" value="[% B_address %]"[% IF SmartformEnable %] class="smartform-instance-alt-address smartform-street"[% END %] /> >+ <input type="text" id="B_address" name="B_address" size="40" value="[% B_address %]"[% IF Koha.Preference('SmartformEnable') %] class="smartform-instance-alt-address smartform-street[% IF ( noB_streetnumber ) %]-and-number[% END %]"[% END %] /> > [% IF ( mandatoryB_address ) %]<span class="required">Required</span>[% END %] > </li> > [% END %] >@@ -43,7 +44,7 @@ > <label for="B_streetnumber"> > [% END %] > Street Number: </label> >- <input type="text" id="B_streetnumber" name="B_streetnumber" size="5" value="[% B_streetnumber %]"[% IF SmartformEnable %] class="smartform-instance-alt-address smartform-number"[% END %] /> >+ <input type="text" id="B_streetnumber" name="B_streetnumber" size="5" value="[% B_streetnumber %]"[% IF Koha.Preference('SmartformEnable') %] class="smartform-instance-alt-address smartform-number"[% END %] /> > [% IF ( mandatoryB_streetnumber ) %]<span class="required">Required</span>[% END %] > </li> > [% END %] >@@ -68,7 +69,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 %]"[% IF SmartformEnable %] class="smartform-instance-alt-address smartform-zip"[% END %] /> >+ <input type="text" id="B_zipcode" name="B_zipcode" maxlength="10" size="10" value="[% B_zipcode %]"[% IF Koha.Preference('SmartformEnable') %] class="smartform-instance-alt-address smartform-zip"[% END %] /> > [% IF ( mandatoryB_zipcode ) %]<span class="required">Required</span>[% END %] > </li> > [% END %] >@@ -80,7 +81,7 @@ > <label for="B_city"> > [% END %] > City: </label> >- <input type="text" id="B_city" name="B_city" size="20" value="[% B_city %]"[% IF SmartformEnable %] class="smartform-instance-alt-address smartform-city"[% END %] /> >+ <input type="text" id="B_city" name="B_city" size="20" value="[% B_city %]"[% IF Koha.Preference('SmartformEnable') %] class="smartform-instance-alt-address smartform-city"[% END %] /> > [% IF ( mandatoryB_city ) %]<span class="required">Required</span>[% END %] > </li> > [% END %] >@@ -144,7 +145,7 @@ > </li> > [% END %] > </ol> >- [% IF SmartformEnable %] >+ [% 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 b36ee16..36ed944 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,7 @@ > <label for="altcontactaddress1"> > [% END %] > Address:</label> >- <input type="text" name="altcontactaddress1" id="altcontactaddress1" value="[% altcontactaddress1 %]" size="40"[% IF SmartformEnable %] class="smartform-instance-alt-contact smartform-street-and-number"[% END %] /> >+ <input type="text" name="altcontactaddress1" id="altcontactaddress1" value="[% altcontactaddress1 %]" size="40"[% IF Koha.Preference('SmartformEnable') %] class="smartform-instance-alt-contact smartform-street-and-number"[% END %] /> > [% IF ( mandatoryaltcontactaddress1 ) %]<span class="required">Required</span>[% END %] > </li> > [% END %] >@@ -56,7 +57,7 @@ > <label for="altcontactzipcode"> > [% END %] > ZIP/Postal code:</label> >- <input type="text" name="altcontactzipcode" id="altcontactzipcode" value="[% altcontactzipcode %]" size="5"[% IF SmartformEnable %] class="smartform-instance-alt-contact smartform-zip"[% END %] /> >+ <input type="text" name="altcontactzipcode" id="altcontactzipcode" value="[% altcontactzipcode %]" size="5"[% IF Koha.Preference('SmartformEnable') %] class="smartform-instance-alt-contact smartform-zip"[% END %] /> > [% IF ( mandatoryaltcontactzipcode ) %]<span class="required">Required</span>[% END %] > </li> > [% END %] >@@ -68,7 +69,7 @@ > <label for="altcontactaddress3"> > [% END %] > City:</label> >- <input type="text" name="altcontactaddress3" id="altcontactaddress3" value="[% altcontactaddress3 %]" size="20"[% IF SmartformEnable %] class="smartform-instance-alt-contact smartform-city"[% END %] /> >+ <input type="text" name="altcontactaddress3" id="altcontactaddress3" value="[% altcontactaddress3 %]" size="20"[% IF Koha.Preference('SmartformEnable') %] class="smartform-instance-alt-contact smartform-city"[% END %] /> > [% IF ( mandatoryaltcontactaddress3 ) %]<span class="required">Required</span>[% END %] > </li> > [% END %] >@@ -109,7 +110,7 @@ > </li> > [% END %] > </ol> >- [% IF SmartformEnable %] >+ [% 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 be080c4..27097cf 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,7 @@ > <label for="address"> > [% END %] > Address: </label> >- <input type="text" id="address" name="address" size="35" value="[% address %]"[% IF SmartformEnable %] class="smartform-instance-main smartform-street"[% END %] /> >+ <input type="text" id="address" name="address" size="35" value="[% address %]"[% IF Koha.Preference('SmartformEnable') %] class="smartform-instance-main smartform-street[% IF ( nostreetnumber ) %]-and-number[% END %]"[% END %] /> > [% IF ( mandatoryaddress ) %]<span class="required">Required</span>[% END %] > </li> > [% END %] >@@ -43,7 +44,7 @@ > <label for="streetnumber"> > [% END %] > Street number: </label> >- <input type="text" id="streetnumber" name="streetnumber" size="5" value="[% streetnumber %]"[% IF SmartformEnable %] class="smartform-instance-main smartform-number"[% END %] /> >+ <input type="text" id="streetnumber" name="streetnumber" size="5" value="[% streetnumber %]"[% IF Koha.Preference('SmartformEnable') %] class="smartform-instance-main smartform-number"[% END %] /> > [% IF ( mandatorystreetnumber ) %]<span class="required">Required</span>[% END %] > </li> > [% END %] >@@ -67,7 +68,7 @@ > <label for="zipcode"> > [% END %] > ZIP/Postal code: </label> >- <input type="text" name="zipcode" id="zipcode" size="10" value="[% zipcode %]"[% IF SmartformEnable %] class="smartform-instance-main smartform-zip"[% END %] /> >+ <input type="text" name="zipcode" id="zipcode" size="10" value="[% zipcode %]"[% IF Koha.Preference('SmartformEnable') %] class="smartform-instance-main smartform-zip"[% END %] /> > [% IF ( mandatoryzipcode ) %]<span class="required">Required</span>[% END %] > </li> > [% END %] >@@ -79,7 +80,7 @@ > <label for="city"> > [% END %] > City: </label> >- <input type="text" id="city" name="city" size="20" value="[% city %]"[% IF SmartformEnable %] class="smartform-instance-main smartform-city"[% END %] /> >+ <input type="text" id="city" name="city" size="20" value="[% city %]"[% IF Koha.Preference('SmartformEnable') %] class="smartform-instance-main smartform-city"[% END %] /> > [% IF cities.count %]or choose > <select id="select_city" name="select_city"> > <option value="|||"></option> >@@ -122,7 +123,7 @@ > </li> > [% END %] > </ol> >- [% IF SmartformEnable %] >+ [% 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/members/memberentrygen.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt >index 059b359..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,7 +5,7 @@ > <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 %] >+[% IF Koha.Preference('SmartformEnable') %] > <script type="text/javascript" src="http://smartform.cz/api/v1/smartform.js"></script> > <script type="text/javascript"> > //<![CDATA[ >diff --git a/members/memberentry.pl b/members/memberentry.pl >index 87de51f..27e6687 100755 >--- a/members/memberentry.pl >+++ b/members/memberentry.pl >@@ -720,9 +720,6 @@ 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