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

(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt (-3 / +17 lines)
Lines 4-10 Link Here
4
[% USE Branches %]
4
[% USE Branches %]
5
[% SET footerjs = 1 %]
5
[% SET footerjs = 1 %]
6
[% INCLUDE 'doc-head-open.inc' %]
6
[% INCLUDE 'doc-head-open.inc' %]
7
<title>Koha &rsaquo; Patrons &rsaquo; [% 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>
7
<title>Koha &rsaquo; Patrons &rsaquo;
8
    [% UNLESS blocking_error %]
9
        [% IF ( opadd ) %]Add
10
        [% ELSIF ( opduplicate ) %]Duplicate
11
        [% ELSE %] Modify
12
        [% END %] patron
13
        [% IF (firstname) %][% firstname %] [% END %]
14
        [% IF (surname) %][% surname %] [% END %]
15
        ([%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 %])
16
    [% END %]
17
</title>
8
[% INCLUDE 'doc-head-close.inc' %]
18
[% INCLUDE 'doc-head-close.inc' %]
9
</head>
19
</head>
10
20
Lines 12-26 Link Here
12
[% INCLUDE 'header.inc' %]
22
[% INCLUDE 'header.inc' %]
13
[% INCLUDE 'patron-search.inc' %]
23
[% INCLUDE 'patron-search.inc' %]
14
24
15
<div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo; <a href="/cgi-bin/koha/members/members-home.pl">Patrons</a>  &rsaquo;
25
<div id="breadcrumbs">
16
[% IF (firstname || surname ) %] <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% borrowernumber %]">[% IF (firstname) %][% firstname | html %] [% END %][% IF (surname) %][% surname | html %] [% END %]</a>  &rsaquo;[% END %]
26
    <a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo; <a href="/cgi-bin/koha/members/members-home.pl">Patrons</a>
27
    [% UNLESS blocking_error %]
28
    &rsaquo;[% IF (firstname || surname ) %] <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% borrowernumber %]">[% IF (firstname) %][% firstname | html %] [% END %][% IF (surname) %][% surname | html %] [% END %]</a>  &rsaquo;[% END %]
17
<strong>[% IF ( opadd ) %]Add[% ELSIF ( opduplicate ) %]Duplicate[% ELSE %] Modify[% END %] patron ([%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 %])</strong>
29
<strong>[% IF ( opadd ) %]Add[% ELSIF ( opduplicate ) %]Duplicate[% ELSE %] Modify[% END %] patron ([%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 %])</strong>
30
    [% END %]
18
</div>
31
</div>
19
[% IF ( opadd ) %]<div id="doc" class="yui-t7">[% ELSE %]<div id="doc3" class="yui-t2">[% END %]
32
[% IF ( opadd ) %]<div id="doc" class="yui-t7">[% ELSE %]<div id="doc3" class="yui-t2">[% END %]
20
33
21
   <div id="bd">
34
   <div id="bd">
22
	<div id="yui-main">
35
	<div id="yui-main">
23
	<div class="yui-b">
36
	<div class="yui-b">
37
    [% INCLUDE 'blocking_errors.inc' %]
24
    [% IF error_alert %]
38
    [% IF error_alert %]
25
        [% IF ( error_alert == "no_email" ) %]
39
        [% IF ( error_alert == "no_email" ) %]
26
            <div class="error">This member has no email</div>
40
            <div class="error">This member has no email</div>
(-)a/members/memberentry.pl (-11 / +11 lines)
Lines 160-168 if ( $op eq 'modify' or $op eq 'save' or $op eq 'duplicate' ) { Link Here
160
160
161
    $borrower_data = $patron->unblessed;
161
    $borrower_data = $patron->unblessed;
162
    $borrower_data->{category_type} = $patron->category->category_type;
162
    $borrower_data->{category_type} = $patron->category->category_type;
163
} else {
164
    $patron = Koha::Patron->new;
165
}
163
}
164
166
my $categorycode  = $input->param('categorycode') || $borrower_data->{'categorycode'};
165
my $categorycode  = $input->param('categorycode') || $borrower_data->{'categorycode'};
167
my $category_type = $input->param('category_type') || '';
166
my $category_type = $input->param('category_type') || '';
168
unless ($category_type or !($categorycode)){
167
unless ($category_type or !($categorycode)){
Lines 285-305 $newdata{'lang'} = $input->param('lang') if defined($input->param('lang')) Link Here
285
# builds default userid
284
# builds default userid
286
# userid input text may be empty or missing because of syspref BorrowerUnwantedField
285
# userid input text may be empty or missing because of syspref BorrowerUnwantedField
287
if ( ( defined $newdata{'userid'} && $newdata{'userid'} eq '' ) || $check_BorrowerUnwantedField =~ /userid/ && !defined $data{'userid'} ) {
286
if ( ( defined $newdata{'userid'} && $newdata{'userid'} eq '' ) || $check_BorrowerUnwantedField =~ /userid/ && !defined $data{'userid'} ) {
287
    my $fake_patron = Koha::Patron->new;
288
    $fake_patron->userid($patron->userid) if $patron; # editing
288
    if ( ( defined $newdata{'firstname'} || $category_type eq 'I' ) && ( defined $newdata{'surname'} ) ) {
289
    if ( ( defined $newdata{'firstname'} || $category_type eq 'I' ) && ( defined $newdata{'surname'} ) ) {
289
        # Full page edit, firstname and surname input zones are present
290
        # Full page edit, firstname and surname input zones are present
290
        $patron->firstname($newdata{firstname});
291
        $fake_patron->firstname($newdata{firstname});
291
        $patron->surname($newdata{surname});
292
        $fake_patron->surname($newdata{surname});
292
        $patron->generate_userid;
293
        $fake_patron->generate_userid;
293
        $newdata{'userid'} = $patron->userid;
294
        $newdata{'userid'} = $fake_patron->userid;
294
    }
295
    }
295
    elsif ( ( defined $data{'firstname'} || $category_type eq 'I' ) && ( defined $data{'surname'} ) ) {
296
    elsif ( ( defined $data{'firstname'} || $category_type eq 'I' ) && ( defined $data{'surname'} ) ) {
296
        # Partial page edit (access through "Details"/"Library details" tab), firstname and surname input zones are not used
297
        # Partial page edit (access through "Details"/"Library details" tab), firstname and surname input zones are not used
297
        # Still, if the userid field is erased, we can create a new userid with available firstname and surname
298
        # Still, if the userid field is erased, we can create a new userid with available firstname and surname
298
        # FIXME clean thiscode newdata vs data is very confusing
299
        # FIXME clean thiscode newdata vs data is very confusing
299
        $patron->firstname($data{firstname});
300
        $fake_patron->firstname($data{firstname});
300
        $patron->surname($data{surname});
301
        $fake_patron->surname($data{surname});
301
        $patron->generate_userid;
302
        $fake_patron->generate_userid;
302
        $newdata{'userid'} = $patron->userid;
303
        $newdata{'userid'} = $fake_patron->userid;
303
    }
304
    }
304
    else {
305
    else {
305
        $newdata{'userid'} = $data{'userid'};
306
        $newdata{'userid'} = $data{'userid'};
306
- 

Return to bug 21222