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

(-)a/C4/Utils/DataTables/Members.pm (-1 / +1 lines)
Lines 113-119 sub search { Link Here
113
    }
113
    }
114
114
115
    my $searchfields = {
115
    my $searchfields = {
116
        standard => C4::Context->preference('DefaultPatronSearchFields') || 'surname,firstname,othernames,cardnumber,userid',
116
        standard => C4::Context->preference('DefaultPatronSearchFields') || 'surname,firstname,preferredname,othernames,cardnumber,userid',
117
        email => 'email,emailpro,B_email',
117
        email => 'email,emailpro,B_email',
118
        borrowernumber => 'borrowernumber',
118
        borrowernumber => 'borrowernumber',
119
        phone => 'phone,phonepro,B_phone,altcontactphone,mobile',
119
        phone => 'phone,phonepro,B_phone,altcontactphone,mobile',
(-)a/circ/ysearch.pl (-1 / +1 lines)
Lines 84-90 while ( my $b = $borrowers_rs->next ) { Link Here
84
    push @borrowers,
84
    push @borrowers,
85
      { borrowernumber => $b->borrowernumber,
85
      { borrowernumber => $b->borrowernumber,
86
        surname        => $b->surname    // '',
86
        surname        => $b->surname    // '',
87
        firstname      => $b->firstname  // '',
87
        firstname      => $b->effective_name  // '',
88
        cardnumber     => $b->cardnumber // '',
88
        cardnumber     => $b->cardnumber // '',
89
        dateofbirth    => format_sqldatetime($b->dateofbirth, undef, undef, 1) // '',
89
        dateofbirth    => format_sqldatetime($b->dateofbirth, undef, undef, 1) // '',
90
        age            => $b->get_age    // '',
90
        age            => $b->get_age    // '',
(-)a/installer/data/mysql/atomicupdate/bug_28633.perl (-5 / +13 lines)
Lines 13-19 return { Link Here
13
                COMMENT "patron/borrower's preferred name"
13
                COMMENT "patron/borrower's preferred name"
14
                AFTER firstname
14
                AFTER firstname
15
            });
15
            });
16
            say $out "Add preferred name column to borrowers table";
16
            say $out "Added preferred name column to borrowers table";
17
        }
17
        }
18
        if( !column_exists( 'deletedborrowers', 'preferredname' ) ) {
18
        if( !column_exists( 'deletedborrowers', 'preferredname' ) ) {
19
            $dbh->do(q{
19
            $dbh->do(q{
Lines 22-28 return { Link Here
22
                COMMENT "patron/borrower's preferred name"
22
                COMMENT "patron/borrower's preferred name"
23
                AFTER firstname
23
                AFTER firstname
24
            });
24
            });
25
            say $out "Add preferred name column to deletedborrowers table";
25
            say $out "Added preferred name column to deletedborrowers table";
26
        }
26
        }
27
        if( !column_exists( 'borrower_modifications', 'preferredname' ) ) {
27
        if( !column_exists( 'borrower_modifications', 'preferredname' ) ) {
28
            $dbh->do(q{
28
            $dbh->do(q{
Lines 31-39 return { Link Here
31
                COMMENT "patron/borrower's preferred name"
31
                COMMENT "patron/borrower's preferred name"
32
                AFTER firstname
32
                AFTER firstname
33
            });
33
            });
34
            say $out "Add preferred name column to borrower_modifications table";
34
            say $out "Added preferred name column to borrower_modifications table";
35
        }
36
        my @default_patron_search_fields = split(',',C4::Context->preference('DefaultPatronSearchFields'));
37
        unless( grep /preferredname/, @default_patron_search_fields ){
38
            if( grep /firstname/, @default_patron_search_fields ){
39
                push @default_patron_search_fields,'preferredname';
40
                C4::Context->set_preference('DefaultPatronSearchFields', join(',',@default_patron_search_fields) );
41
                say $out "Added preferred name to DefaultPatronSearchFields";
42
            } else { 
43
                say $out "Please add 'preferredname' to DefaultPatronSearchFields if you want it searched by default";
44
            }
35
        }
45
        }
36
        $dbh->do(q{});
37
        # Print useful stuff here
38
    },
46
    },
39
}
47
}
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/patronfields.inc (-1 / +1 lines)
Lines 5-11 Link Here
5
     [%- CASE 'cardnumber' -%]<span>Card number</span>
5
     [%- CASE 'cardnumber' -%]<span>Card number</span>
6
     [%- CASE 'surname' -%]<span>Surname</span>
6
     [%- CASE 'surname' -%]<span>Surname</span>
7
     [%- CASE 'firstname' -%]<span>First name</span>
7
     [%- CASE 'firstname' -%]<span>First name</span>
8
     [%- CASE 'firstname' -%]<span>Preferred name</span>
8
     [%- CASE 'preferredname' -%]<span>Preferred name</span>
9
     [%- CASE 'title' -%]<span>Salutation</span>
9
     [%- CASE 'title' -%]<span>Salutation</span>
10
     [%- CASE 'othernames' -%]<span>Other name</span>
10
     [%- CASE 'othernames' -%]<span>Other name</span>
11
     [%- CASE 'initials' -%]<span>Initials</span>
11
     [%- CASE 'initials' -%]<span>Initials</span>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/patrons.pref (-1 / +1 lines)
Lines 48-54 Patrons: Link Here
48
         - "Comma separated list defining the default fields to be used during a patron search using the \"standard\" option:"
48
         - "Comma separated list defining the default fields to be used during a patron search using the \"standard\" option:"
49
         - pref: DefaultPatronSearchFields
49
         - pref: DefaultPatronSearchFields
50
           class: multi
50
           class: multi
51
         - "If empty Koha will default to \"surname,firstname,othernames,cardnumber,userid\". Additional fields added to this preference will be added as search options in the dropdown menu on the patron search page."
51
         - "If empty Koha will default to \"surname,firstname,preferredname,othernames,cardnumber,userid\". Additional fields added to this preference will be added as search options in the dropdown menu on the patron search page."
52
     -
52
     -
53
         - "Show the following fields from the items database table as columns on the statistics tab on the patron record: "
53
         - "Show the following fields from the items database table as columns on the statistics tab on the patron record: "
54
         - pref: StatisticsFields
54
         - pref: StatisticsFields
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt (-1 / +6 lines)
Lines 124-129 Link Here
124
124
125
                                <div class="rows">
125
                                <div class="rows">
126
                                    <ol>
126
                                    <ol>
127
                                        [% IF ( patron.preferredname && patron.firstname ) %]
128
                                            <li id="patron_legal_name">
129
                                                <span class="label patron_legal_name">Legal name: </span>
130
                                                [% patron.firstname | html %]
131
                                            </li>
132
                                        [% END %]
127
                                        [% IF ( patron.phone ) %]
133
                                        [% IF ( patron.phone ) %]
128
                                            <li>
134
                                            <li>
129
                                                <span class="label">Primary phone: </span>
135
                                                <span class="label">Primary phone: </span>
130
- 

Return to bug 28633