View | Details | Raw Unified | Return to bug 6782
Collapse All | Expand All

(-)a/C4/Members.pm (+6 lines)
Lines 659-664 sub AddMember { Link Here
659
        $data{'dateenrolled'} = output_pref( { dt => dt_from_string, dateonly => 1, dateformat => 'iso' } );
659
        $data{'dateenrolled'} = output_pref( { dt => dt_from_string, dateonly => 1, dateformat => 'iso' } );
660
    }
660
    }
661
661
662
    if ( C4::Context->preference("autoMemberNum") ) {
663
        if ( not exists $data{cardnumber} or not defined $data{cardnumber} or $data{cardnumber} eq '' ) {
664
            $data{cardnumber} = fixup_cardnumber( $data{cardnumber}, C4::Context->userenv->{'branch'}, $data{categorycode} );
665
        }
666
    }
667
662
    my $patron_category = $schema->resultset('Category')->find( $data{'categorycode'} );
668
    my $patron_category = $schema->resultset('Category')->find( $data{'categorycode'} );
663
    $data{'privacy'} =
669
    $data{'privacy'} =
664
        $patron_category->default_privacy() eq 'default' ? 1
670
        $patron_category->default_privacy() eq 'default' ? 1
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt (-6 / +10 lines)
Lines 600-626 $(document).ready(function() { Link Here
600
    <legend id="library_management_lgd">Library management</legend><ol>
600
    <legend id="library_management_lgd">Library management</legend><ol>
601
      [% UNLESS nocardnumber %]
601
      [% UNLESS nocardnumber %]
602
        <li>
602
        <li>
603
          [% IF ( mandatorycardnumber ) %]
603
          [% IF mandatorycardnumber and not Koha.Preference('autoMemberNum') %]
604
            <label for="cardnumber" class="required">
604
            <label for="cardnumber" class="required">
605
          [% ELSE %]
605
          [% ELSE %]
606
            <label for="cardnumber" class="validated">
606
            <label for="cardnumber" class="validated">
607
          [% END %]
607
          [% END %]
608
          Card number: </label>
608
          [% IF Koha.Preference('autoMemberNum') %]
609
              Card number<br>(<u>leave blank for auto calc during registration</u>): </label>
610
          [% ELSE %]
611
              Card number: </label>
612
          [% END %]
609
          [% IF minlength_cardnumber == maxlength_cardnumber %]
613
          [% IF minlength_cardnumber == maxlength_cardnumber %]
610
                <input type="text" id="cardnumber" name="cardnumber" size="20" value="[% cardnumber %]" minlength="[% minlength_cardnumber %]" maxlength="[% maxlength_cardnumber %]" />
614
                <input type="text" id="cardnumber" name="cardnumber" size="20" value="[% cardnumber %]" minlength="[% minlength_cardnumber %]" maxlength="[% maxlength_cardnumber %]" />
611
                [% IF ( mandatorycardnumber ) %]<span class="required">Required</span>[% END %]
615
                [% IF mandatorycardnumber and not Koha.Preference('autoMemberNum') %]<span class="required">Required</span>[% END %]
612
                <div class="hint">Card number must be exactly [% minlength_cardnumber %] characters.</div>
616
                <div class="hint">Card number must be exactly [% minlength_cardnumber %] characters.</div>
613
          [% ELSIF minlength_cardnumber && maxlength_cardnumber %]
617
          [% ELSIF minlength_cardnumber && maxlength_cardnumber %]
614
                <input type="text" id="cardnumber" name="cardnumber" size="20" value="[% cardnumber %]" minlength="[% minlength_cardnumber %]" maxlength="[% maxlength_cardnumber %]" />
618
                <input type="text" id="cardnumber" name="cardnumber" size="20" value="[% cardnumber %]" minlength="[% minlength_cardnumber %]" maxlength="[% maxlength_cardnumber %]" />
615
                [% IF ( mandatorycardnumber ) %]<span class="required">Required</span>[% END %]
619
                [% IF mandatorycardnumber and not Koha.Preference('autoMemberNum') %]<span class="required">Required</span>[% END %]
616
                <div class="hint">Card number must be between [% minlength_cardnumber %] and [% maxlength_cardnumber %] characters.</div>
620
                <div class="hint">Card number must be between [% minlength_cardnumber %] and [% maxlength_cardnumber %] characters.</div>
617
          [% ELSIF maxlength_cardnumber %]
621
          [% ELSIF maxlength_cardnumber %]
618
                <input type="text" id="cardnumber" name="cardnumber" size="20" value="[% cardnumber %]" maxlength="[% maxlength_cardnumber %]" />
622
                <input type="text" id="cardnumber" name="cardnumber" size="20" value="[% cardnumber %]" maxlength="[% maxlength_cardnumber %]" />
619
                [% IF ( mandatorycardnumber ) %]<span class="required">Required</span>[% END %]
623
                [% IF mandatorycardnumber and not Koha.Preference('autoMemberNum') %]<span class="required">Required</span>[% END %]
620
                <div class="hint">Card number can be up to [% maxlength_cardnumber %] characters.</div>
624
                <div class="hint">Card number can be up to [% maxlength_cardnumber %] characters.</div>
621
          [% ELSE %]
625
          [% ELSE %]
622
                <input type="text" id="cardnumber" name="cardnumber" size="20" value="[% cardnumber %]" />
626
                <input type="text" id="cardnumber" name="cardnumber" size="20" value="[% cardnumber %]" />
623
                [% IF ( mandatorycardnumber ) %]<span class="required">Required</span>[% END %]
627
                [% IF mandatorycardnumber and not Koha.Preference('autoMemberNum') %]<span class="required">Required</span>[% END %]
624
                <div class="hint">There is no minimum or maximum character length.</div>
628
                <div class="hint">There is no minimum or maximum character length.</div>
625
          [% END %]
629
          [% END %]
626
        </li>
630
        </li>
(-)a/members/memberentry.pl (-2 / +6 lines)
Lines 505-511 if ( $op eq "duplicate" ) { Link Here
505
    $data{'cardnumber'} = "";
505
    $data{'cardnumber'} = "";
506
}
506
}
507
507
508
$data{'cardnumber'}=fixup_cardnumber($data{'cardnumber'}) if ( ( $op eq 'add' ) or ( $op eq 'duplicate' ) );
508
if (C4::Context->preference("autoMemberNum")) {
509
    $template->param( autoMemberNum => 1);
510
} else {
511
    $template->param( autoMemberNum => 0);
512
}
513
509
if(!defined($data{'sex'})){
514
if(!defined($data{'sex'})){
510
    $template->param( none => 1);
515
    $template->param( none => 1);
511
} elsif($data{'sex'} eq 'F'){
516
} elsif($data{'sex'} eq 'F'){
512
- 

Return to bug 6782