Bug 7068 - autobarcode not working when duplicating patrons

Fixed by blanking cardnumber in the code and showing it in the template,
instead of just not showing it in the template

Autobarcode now correctly fills in on a duplicated patron.

Signed-off-by: Melia Meggs <melia@test.bywatersolutions.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>

Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
This commit is contained in:
MJ Ray 2012-09-07 17:40:26 +01:00 committed by Jared Camins-Esakov
parent 3f16c2a18e
commit 5a4a50f9b4
2 changed files with 3 additions and 6 deletions

View File

@ -872,11 +872,7 @@
<label for="cardnumber">
[% END %]
Card number: </label>
[% IF ( opduplicate ) %]
<input type="text" id="cardnumber" name="cardnumber" size="20" />
[% ELSE %]
<input type="text" id="cardnumber" name="cardnumber" size="20" value="[% cardnumber %]" />
[% END %]
<input type="text" id="cardnumber" name="cardnumber" size="20" value="[% cardnumber %]" />
[% IF ( mandatorycardnumber ) %]<span class="required">Required</span>[% END %]</li>
<li>
[% IF ( mandatorybranchcode ) %]

View File

@ -400,9 +400,10 @@ if ($op eq "modify") {
if ( $op eq "duplicate" ) {
$template->param( updtype => 'I' );
$template->param( step_1 => 1, step_2 => 1, step_3 => 1, step_4 => 1, step_5 => 1, step_6 => 1 ) unless $step;
$data{'cardnumber'} = "";
}
$data{'cardnumber'}=fixup_cardnumber($data{'cardnumber'}) if $op eq 'add';
$data{'cardnumber'}=fixup_cardnumber($data{'cardnumber'}) if ( ( $op eq 'add' ) or ( $op eq 'duplicate' ) );
if(!defined($data{'sex'})){
$template->param( none => 1);
} elsif($data{'sex'} eq 'F'){