From 710e6755285790795af84f37fc3139b93275ebf8 Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Tue, 11 Nov 2014 11:09:17 -0500 Subject: [PATCH] Bug 9177 - Duplicate patron: Prepopulated fields ar cleared when setting cursor Content-Type: text/plain; charset="utf-8" When adding a duplicated patron record some fields are prepopulated from the original patron record. Focusing your cursor on these fields automatically clears them. This works well if you assume that the user only focuses on fields which should be changed. This works badly if you consider that a user might want to tab between all fields. I think the disadvantages outweigh the minor benefit of not having to delete the contents of a field. This patch removes the clearing action. To test, apply the patch and duplicate an existing patron record. Tabbing through the entry fields should not result in the contents of those fields being cleared. --- .../prog/en/modules/members/memberentrygen.tt | 84 ++++++++++---------- 1 file changed, 40 insertions(+), 44 deletions(-) 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..39e5e88 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt @@ -1,4 +1,3 @@ -[% IF ( opduplicate ) %][% SET focusAction = "clearDupe" %][% END %] [% USE KohaDates %] [% INCLUDE 'doc-head-open.inc' %] Koha › Patrons › @@ -25,9 +24,6 @@ document.form.state.value=RegExp.$3; document.form.country.value=RegExp.$4; }); - $(".clearDupe").on("focus",function(){ - $(this).val(""); - }) [% IF categorycode %] update_category_code( "[% categorycode %]" ); @@ -268,9 +264,9 @@ [% END %] Surname: </label> [% IF ( uppercasesurnames ) %] - <input style="text-transform:uppercase;" type="text" id="surname" name="surname" size="20" value="[% surname %]" class="[% focusAction %]" /> + <input style="text-transform:uppercase;" type="text" id="surname" name="surname" size="20" value="[% surname %]" /> [% ELSE %] - <input type="text" id="surname" name="surname" size="20" value="[% surname %]" class="[% focusAction %]" /> + <input type="text" id="surname" name="surname" size="20" value="[% surname %]" /> [% END %] [% IF ( mandatorysurname ) %]<span class="required">Required</span>[% END %] </li> @@ -316,7 +312,7 @@ <label for="initials"> [% END %] Initials: </label> - <input type="text" id="initials" name="initials" size="20" value="[% initials %]" class="[% focusAction %]" /> + <input type="text" id="initials" name="initials" size="20" value="[% initials %]" /> [% IF ( mandatoryinitials ) %]<span class="required">Required</span>[% END %] </li> [% END %] @@ -329,7 +325,7 @@ <label for="othernames"> [% END %] Other name: </label> - <input type="text" id="othernames" name="othernames" size="20" value="[% othernames %]" class="[% focusAction %]" /> + <input type="text" id="othernames" name="othernames" size="20" value="[% othernames %]" /> [% IF ( mandatoryothernames ) %]<span class="required">Required</span>[% END %] [% IF ( I ) %]<input type="hidden" name="sex" value="N" />[% END %] </li> @@ -378,7 +374,7 @@ <span>[% contactname %]</span> <input name="contactname" id="contactname" type="hidden" size="20" value="[% contactname %]" /> [% ELSE %] - <input name="contactname" id="contactname" type="text" size="20" value="[% contactname %]" class="[% focusAction %]" /> + <input name="contactname" id="contactname" type="text" size="20" value="[% contactname %]" /> [% END %] </li> [% ELSE %] @@ -397,7 +393,7 @@ <span>[% contactname %]</span> <input name="contactname" id="contactname" type="hidden" size="20" value="[% contactname %]" /> [% ELSE %] - <input name="contactname" id="contactname" type="text" size="20" value="[% contactname %]" class="[% focusAction %]" /> + <input name="contactname" id="contactname" type="text" size="20" value="[% contactname %]" /> [% END %] </li> [% END %] @@ -408,7 +404,7 @@ <span>[% contactfirstname %]</span> <input name="contactfirstname" id="contactfirstname" type="hidden" size="20" value="[% contactfirstname %]" /> [% ELSE %] - <input name="contactfirstname" id="contactfirstname" type="text" size="20" value="[% contactfirstname %]" class="[% focusAction %]" /> + <input name="contactfirstname" id="contactfirstname" type="text" size="20" value="[% contactfirstname %]" /> [% END %] </li> [% END %] @@ -452,7 +448,7 @@ <label for="streetnumber"> [% END %] Street number: </label> - <input type="text" id="streetnumber" name="streetnumber" size="5" value="[% streetnumber %]" class="[% focusAction %]" /> + <input type="text" id="streetnumber" name="streetnumber" size="5" value="[% streetnumber %]" /> [% IF ( mandatorystreetnumber ) %]<span class="required">Required</span>[% END %] </li> [% END %] @@ -487,7 +483,7 @@ <label for="address"> [% END %] Address: </label> - <input type="text" id="address" name="address" size="35" value="[% address %]" class="[% focusAction %]" /> + <input type="text" id="address" name="address" size="35" value="[% address %]" /> [% IF ( mandatoryaddress ) %]<span class="required">Required</span>[% END %] </li> [% END %] @@ -499,7 +495,7 @@ <label for="address2"> [% END %] Address 2: </label> - <input type="text" id="address2" name="address2" size="35" value="[% address2 %]" class="[% focusAction %]" /> + <input type="text" id="address2" name="address2" size="35" value="[% address2 %]" /> [% IF ( mandatoryaddress2 ) %]<span class="required">Required</span>[% END %] </li> [% END %] @@ -511,7 +507,7 @@ <label for="city"> [% END %] City: </label> - <input type="text" id="city" name="city" size="20" value="[% city %]" class="[% focusAction %]" /> + <input type="text" id="city" name="city" size="20" value="[% city %]" /> [% IF ( city_cgipopup ) %]or <strong>choose</strong> <select id="select_city" name="select_city"> [% FOREACH city_loo IN city_loop %] @@ -536,7 +532,7 @@ <label for="state"> [% END %] State: </label> - <input type="text" name="state" id="state" size="20" value="[% state %]" class="[% focusAction %]" /> + <input type="text" name="state" id="state" size="20" value="[% state %]" /> [% IF ( mandatorystate ) %]<span class="required">Required</span>[% END %] </li> [% END %] @@ -548,7 +544,7 @@ <label for="zipcode"> [% END %] Zip/Postal code: </label> - <input type="text" name="zipcode" id="zipcode" size="10" value="[% zipcode %]" class="[% focusAction %]" /> + <input type="text" name="zipcode" id="zipcode" size="10" value="[% zipcode %]" /> [% IF ( mandatoryzipcode ) %]<span class="required">Required</span>[% END %] </li> [% END %] @@ -560,7 +556,7 @@ <label for="country"> [% END %] Country: </label> - <input type="text" name="country" id="country" size="20" value="[% country %]" class="[% focusAction %]" /> + <input type="text" name="country" id="country" size="20" value="[% country %]" /> [% IF ( mandatorycountry ) %]<span class="required">Required</span>[% END %] </li> [% END %] @@ -579,7 +575,7 @@ <label for="phone"> [% END %] Primary phone: </label> - <input type="text" id="phone" name="phone" value="[% phone %]" class="[% focusAction %]" /> + <input type="text" id="phone" name="phone" value="[% phone %]" /> [% IF ( mandatoryphone ) %]<span class="required">Required</span>[% END %]<div class="hint">Shows on transit slips</div> </li> @@ -592,7 +588,7 @@ <label for="phonepro"> [% END %] Secondary phone: </label> - <input type="text" id="phonepro" name="phonepro" value="[% phonepro %]" class="[% focusAction %]" /> + <input type="text" id="phonepro" name="phonepro" value="[% phonepro %]" /> [% IF ( mandatoryphonepro ) %]<span class="required">Required</span>[% END %] </li> [% END %] @@ -604,7 +600,7 @@ <label for="mobile"> [% END %] Mobile phone: </label> - <input type="text" id="mobile" name="mobile" value="[% mobile %]" class="[% focusAction %]" /> + <input type="text" id="mobile" name="mobile" value="[% mobile %]" /> [% IF ( mandatorymobile ) %]<span class="required">Required</span>[% END %] </li> [% END %] @@ -616,7 +612,7 @@ <label for="email"> [% END %] Primary email: </label> - <input type="text" id="email" name="email" size="45" value="[% email %]" class="[% focusAction %]" /> + <input type="text" id="email" name="email" size="45" value="[% email %]" /> [% IF ( mandatoryemail ) %]<span class="required">Required</span>[% END %]<div class="hint">Shows on transit slips</div> </li> @@ -629,7 +625,7 @@ <label for="emailpro"> [% END %] Secondary email: </label> - <input type="text" id="emailpro" name="emailpro" size="45" value="[% emailpro %]" class="[% focusAction %]" /> + <input type="text" id="emailpro" name="emailpro" size="45" value="[% emailpro %]" /> [% IF ( mandatoryemailpro ) %]<span class="required">Required</span>[% END %] </li> [% END %] @@ -641,7 +637,7 @@ <label for="fax"> [% END %] Fax: </label> - <input type="text" id="fax" name="fax" value="[% fax %]" class="[% focusAction %]" /> + <input type="text" id="fax" name="fax" value="[% fax %]" /> [% IF ( mandatoryfax ) %]<span class="required">Required</span>[% END %] </li> [% END %] @@ -664,7 +660,7 @@ <label for="B_address"> [% END %] Address: </label> - <input type="text" id="B_address" name="B_address" size="40" value="[% B_address %]" class="[% focusAction %]" /> + <input type="text" id="B_address" name="B_address" size="40" value="[% B_address %]" /> [% IF ( mandatoryB_address ) %]<span class="required">Required</span>[% END %] </li> [% END %] @@ -676,7 +672,7 @@ <label for="B_address2"> [% END %] Address 2: </label> - <input type="text" id="B_address2" name="B_address2" size="40" value="[% B_address2 %]" class="[% focusAction %]" /> + <input type="text" id="B_address2" name="B_address2" size="40" value="[% B_address2 %]" /> [% IF ( mandatoryB_address2 ) %]<span class="required">Required</span>[% END %] </li> [% END %] @@ -688,7 +684,7 @@ <label for="B_city"> [% END %] City: </label> - <input type="text" id="B_city" name="B_city" size="20" value="[% B_city %]" class="[% focusAction %]" /> + <input type="text" id="B_city" name="B_city" size="20" value="[% B_city %]" /> [% IF ( mandatoryB_city ) %]<span class="required">Required</span>[% END %] </li> [% END %] @@ -700,7 +696,7 @@ <label for="B_state"> [% END %] State: </label> - <input type="text" id="B_state" name="B_state" size="20" value="[% B_state %]" class="[% focusAction %]" /> + <input type="text" id="B_state" name="B_state" size="20" value="[% B_state %]" /> [% IF ( mandatoryB_state ) %]<span class="required">Required</span>[% END %] </li> [% END %] @@ -712,7 +708,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 %]" class="[% focusAction %]" /> + <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 %] @@ -724,7 +720,7 @@ <label for="B_country"> [% END %] Country: </label> - <input type="text" id="B_country" name="B_country" size="20" value="[% B_country %]" class="[% focusAction %]" /> + <input type="text" id="B_country" name="B_country" size="20" value="[% B_country %]" /> [% IF ( mandatoryB_country ) %]<span class="required">Required</span>[% END %] </li> [% END %] @@ -736,7 +732,7 @@ <label for="B_phone"> [% END %] Phone: </label> - <input type="text" id="B_phone" name="B_phone" value="[% B_phone %]" class="[% focusAction %]" /> + <input type="text" id="B_phone" name="B_phone" value="[% B_phone %]" /> [% IF ( mandatoryB_phone ) %]<span class="required">Required</span>[% END %] </li> [% END %] @@ -748,7 +744,7 @@ <label for="B_email"> [% END %] Email: </label> - <input type="text" id="B_email" name="B_email" size="45" value="[% B_email %]" class="[% focusAction %]" /> + <input type="text" id="B_email" name="B_email" size="45" value="[% B_email %]" /> [% IF ( mandatoryB_email ) %]<span class="required">Required</span>[% END %] </li> [% END %] [% UNLESS nocontactnote %] @@ -779,7 +775,7 @@ <label for="altcontactsurname"> [% END %] Surname:</label> - <input type="text" name="altcontactsurname" id="altcontactsurname" value="[% altcontactsurname %]" class="[% focusAction %]" /> + <input type="text" name="altcontactsurname" id="altcontactsurname" value="[% altcontactsurname %]" /> [% IF ( mandatoryaltcontactsurname ) %]<span class="required">Required</span>[% END %] </li> [% END %] @@ -791,7 +787,7 @@ <label for="altcontactfirstname"> [% END %] First name:</label> - <input type="text" name="altcontactfirstname" id="altcontactfirstname" value="[% altcontactfirstname %]" class="[% focusAction %]" /> + <input type="text" name="altcontactfirstname" id="altcontactfirstname" value="[% altcontactfirstname %]" /> [% IF ( mandatoryaltcontactfirstname ) %]<span class="required">Required</span>[% END %] </li> [% END %] @@ -803,7 +799,7 @@ <label for="altcontactaddress1"> [% END %] Address:</label> - <input type="text" name="altcontactaddress1" id="altcontactaddress1" value="[% altcontactaddress1 %]" size="40" class="[% focusAction %]" /> + <input type="text" name="altcontactaddress1" id="altcontactaddress1" value="[% altcontactaddress1 %]" size="40" /> [% IF ( mandatoryaltcontactaddress1 ) %]<span class="required">Required</span>[% END %] </li> [% END %] @@ -815,7 +811,7 @@ <label for="altcontactaddress2"> [% END %] Address 2:</label> - <input type="text" name="altcontactaddress2" id="altcontactaddress2" value="[% altcontactaddress2 %]" size="40" class="[% focusAction %]" /> + <input type="text" name="altcontactaddress2" id="altcontactaddress2" value="[% altcontactaddress2 %]" size="40" /> [% IF ( mandatoryaltcontactaddress2 ) %]<span class="required">Required</span>[% END %] </li> [% END %] @@ -827,7 +823,7 @@ <label for="altcontactaddress3"> [% END %] City:</label> - <input type="text" name="altcontactaddress3" id="altcontactaddress3" value="[% altcontactaddress3 %]" size="20" class="[% focusAction %]" /> + <input type="text" name="altcontactaddress3" id="altcontactaddress3" value="[% altcontactaddress3 %]" size="20" /> [% IF ( mandatoryaltcontactaddress3 ) %]<span class="required">Required</span>[% END %] </li> [% END %] @@ -839,7 +835,7 @@ <label for="altcontactstate"> [% END %] State:</label> - <input type="text" name="altcontactstate" id="altcontactstate" value="[% altcontactstate %]" size="20" class="[% focusAction %]" /> + <input type="text" name="altcontactstate" id="altcontactstate" value="[% altcontactstate %]" size="20" /> [% IF ( mandatoryaltcontactstate ) %]<span class="required">Required</span>[% END %] </li> [% END %] @@ -851,7 +847,7 @@ <label for="altcontactzipcode"> [% END %] Zip/Postal code:</label> - <input type="text" name="altcontactzipcode" id="altcontactzipcode" value="[% altcontactzipcode %]" size="5" class="[% focusAction %]" /> + <input type="text" name="altcontactzipcode" id="altcontactzipcode" value="[% altcontactzipcode %]" size="5" /> [% IF ( mandatoryaltcontactzipcode ) %]<span class="required">Required</span>[% END %] </li> [% END %] @@ -863,7 +859,7 @@ <label for="altcontactcountry"> [% END %] Country:</label> - <input type="text" name="altcontactcountry" id="altcontactcountry" value="[% altcontactcountry %]" size="20" class="[% focusAction %]" /> + <input type="text" name="altcontactcountry" id="altcontactcountry" value="[% altcontactcountry %]" size="20" /> [% IF ( mandatoryaltcontactcountry ) %]<span class="required">Required</span>[% END %] </li> [% END %] @@ -875,7 +871,7 @@ <label for="altcontactphone"> [% END %] Phone:</label> - <input type="text" name="altcontactphone" id="altcontactphone" value="[% altcontactphone %]" class="[% focusAction %]" /> + <input type="text" name="altcontactphone" id="altcontactphone" value="[% altcontactphone %]" /> [% IF ( mandatoryaltcontactphone ) %]<span class="required">Required</span>[% END %] </li> [% END %] @@ -957,7 +953,7 @@ <label for="sort1"> [% END %] Sort 1: </label> - [% PROCESS 'av-build-dropbox.inc' name="sort1", category="Bsort1", default=sort1, class=focusAction, size = 20 %] + [% PROCESS 'av-build-dropbox.inc' name="sort1", category="Bsort1", default=sort1, size = 20 %] [% IF ( mandatorysort1 ) %]<span class="required">Required</span>[% END %] </li> [% END %] @@ -969,7 +965,7 @@ <label for="sort2"> [% END %] Sort 2: </label> - [% PROCESS 'av-build-dropbox.inc' name="sort2", category="Bsort2", default=sort2, class=focusAction, size = 20 %] + [% PROCESS 'av-build-dropbox.inc' name="sort2", category="Bsort2", default=sort2, size = 20 %] [% IF ( mandatorysort2 ) %]<span class="required">Required</span>[% END %] </li> [% END %] @@ -1364,7 +1360,7 @@ [% INCLUDE 'messaging-preference-form.inc' %] [% IF ( SMSSendDriver ) %] <p><label for="SMSnumber">SMS number:</label> - <input type="text" id="SMSnumber" name="SMSnumber" value="[% SMSnumber %]" class="[% focusAction %]" /> + <input type="text" id="SMSnumber" name="SMSnumber" value="[% SMSnumber %]" /> </p> [% END %] </fieldset> -- 1.7.9.5