Bug 10769 - Simplify clearing of input fields when duplicating a patron
Summary: Simplify clearing of input fields when duplicating a patron
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Patrons (show other bugs)
Version: Main
Hardware: All All
: P5 - low enhancement (vote)
Assignee: Campbell Reid-Tait
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-08-20 13:03 UTC by Owen Leonard
Modified: 2014-12-07 20:02 UTC (History)
3 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Small patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:


Attachments
Bug 10769 - Simplify clearing of input fields when duplicating a patron (32.47 KB, patch)
2013-08-20 13:26 UTC, Owen Leonard
Details | Diff | Splinter Review
Signed Off: Bug 10769 - Simplify clearing of input fields when duplicating a patron (32.50 KB, patch)
2013-08-28 03:37 UTC, Campbell Reid-Tait
Details | Diff | Splinter Review
Bug 10769 - Simplify clearing of input fields when duplicating a patron (32.59 KB, patch)
2013-08-30 12:27 UTC, Kyle M Hall
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Owen Leonard 2013-08-20 13:03:39 UTC
Currently the patron entry template has a lot of logic handling form fields when the operation being performed is "duplicate:" 

[% IF ( opduplicate ) %]
    <input type="text" name="altcontactphone" id="altcontactphone" value="[% altcontactphone %]" onclick="this.value=''" />
[% ELSE %]
    <input type="text" name="altcontactphone" id="altcontactphone" value="[% altcontactphone %]" />
[% END %]

I propose to set a class on fields which require this behavior so that the event can be handled in the script block.
Comment 1 Owen Leonard 2013-08-20 13:26:59 UTC Comment hidden (obsolete)
Comment 2 Campbell Reid-Tait 2013-08-28 03:37:58 UTC Comment hidden (obsolete)
Comment 3 Kyle M Hall 2013-08-30 12:27:44 UTC
Created attachment 20735 [details] [review]
Bug 10769 - Simplify clearing of input fields when duplicating a patron

When duplicating a patron record an onclick event is added to many
fields in order to make then clear when focused. This patch updates the
template so that the logic for this can be simplified. A template
variable is set based on the 'opduplicate' variable, and a class added
to the relevant fields. All fields with that class are cleared on focus.

Also changed are several markup issues which were causing validation
errors.

To test, find or create a patron record which has all standard text
fields filled with data. Use the "duplicate" button on the detail view
of that patron to initiate the duplication process.

Focus on each field in the patron entry form in succession. Fields which
contain data should be cleared in the same way they were before the
patch.

Also test a regular edit operation to confirm that fields are not
cleared.

Signed-off-by: Campbell Reid-Tait <campbellreidtait@gmail.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Passes koha-qa.pl, works as advertised.
Comment 4 Galen Charlton 2013-09-08 06:32:03 UTC
Pushed to master.  Thanks, Owen!