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

(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/patron-search.inc (-15 / +1 lines)
Lines 58-78 Link Here
58
                        </li>
58
                        </li>
59
                    [% CASE 'search_field' %]
59
                    [% CASE 'search_field' %]
60
                        <li>
60
                        <li>
61
                            <label for="searchfieldstype_filter">Search field:</label>
61
                            [% INCLUDE patron_fields_dropdown %]
62
                            <select name="searchfieldstype" id="searchfieldstype_filter">
63
                                [% SET standard = Koha.Preference('DefaultPatronSearchFields') || 'firstname,surname,othernames,cardnumber,userid' %]
64
                                [% default_fields = [ standard, 'surname', 'cardnumber', 'email', 'borrowernumber', 'userid', 'phone', 'address', 'dateofbirth', 'sort1', 'sort2' ] %]
65
                                [% search_options = default_fields.merge(standard.split(',')).unique %]
66
                                [% FOREACH s_o IN search_options %]
67
                                    [% display_name = PROCESS patron_fields name=s_o %]
68
                                    [% NEXT IF !display_name %]
69
                                    [% IF searchfieldstype == s_o %]
70
                                        <option selected="selected" value=[% s_o | html %]>[% display_name | $raw %]</option>
71
                                    [% ELSE %]
72
                                        <option value=[% s_o | html %]>[% display_name | $raw %]</option>
73
                                    [% END %]
74
                                [% END %]
75
                            </select>
76
                        </li>
62
                        </li>
77
                    [% CASE 'search_type' %]
63
                    [% CASE 'search_type' %]
78
                        <li>
64
                        <li>
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/patronfields.inc (-1 / +28 lines)
Lines 1-6 Link Here
1
[%- BLOCK patron_fields -%]
1
[%- BLOCK patron_fields -%]
2
     [%- SWITCH name -%]
2
     [%- SWITCH name -%]
3
     [%- CASE standard -%]<span>Standard</span>
3
     [%- CASE standard -%]<span>Standard</span>
4
     [%- CASE full_address -%]<span>Full address</span>
5
     [%- CASE all_emails -%]<span>All emails</span>
6
     [%- CASE all_phones -%]<span>All phones</span>
4
     [%- CASE 'borrowernumber' -%]<span>Borrowernumber</span>
7
     [%- CASE 'borrowernumber' -%]<span>Borrowernumber</span>
5
     [%- CASE 'cardnumber' -%]<span>Card number</span>
8
     [%- CASE 'cardnumber' -%]<span>Card number</span>
6
     [%- CASE 'surname' -%]<span>Surname</span>
9
     [%- CASE 'surname' -%]<span>Surname</span>
Lines 73-75 Link Here
73
     [%- CASE DEFAULT -%]
76
     [%- CASE DEFAULT -%]
74
     [%- END -%]
77
     [%- END -%]
75
[%- END -%]
78
[%- END -%]
76
- 
79
[%- BLOCK patron_fields_dropdown -%]
80
    [% IF search_box %]
81
        <label for="searchfieldstype" class="control-label">Search field:</label>
82
        <select name="searchfieldstype" id="searchfieldstype" class="form-control">
83
    [% ELSE %]
84
        <label for="searchfieldstype_filter">Search field:</label>
85
        <select name="searchfieldstype" id="searchfieldstype_filter">
86
    [% END %]
87
        [% SET standard = Koha.Preference('DefaultPatronSearchFields') || 'firstname,middle_name,surname,othernames,cardnumber,userid' %]
88
        [% SET full_address = 'streetnumber,streettype,address,address2,city,state,zipcode,country' %]
89
        [% SET all_emails = 'email,emailpro,B_email' %]
90
        [% SET all_phones = 'phone,phonepro,B_phone,altcontactphone,mobile' %]
91
        [% default_fields = [ standard, 'surname', 'cardnumber', all_emails, 'borrowernumber', 'userid', all_phones, full_address, 'dateofbirth', 'sort1', 'sort2' ] %]
92
        [% search_options = default_fields.merge(standard.split(',')).unique %]
93
        [% FOREACH s_o IN search_options %]
94
            [% display_name = PROCESS patron_fields name=s_o %]
95
            [% NEXT IF !display_name %]
96
            [% IF searchfieldstype == s_o %]
97
                <option selected="selected" value=[% s_o | html %]>[% display_name | $raw %]</option>
98
            [% ELSE %]
99
                <option value=[% s_o | html %]>[% display_name | $raw %]</option>
100
            [% END %]
101
        [% END %]
102
    </select>
103
[%- END -%]

Return to bug 32770