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

(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/search_indexes.inc (-157 / +13 lines)
Lines 1-189 Link Here
1
[% USE Koha %]
1
[% USE Koha %]
2
[% USE AdditionalContents %]
3
[% USE raw %]
4
2
[% IF refiner %]
5
[% IF refiner %]
3
    <select class="advsearch" name="idx" id="refiner_idx">
6
    <select class="advsearch" name="idx" id="refiner_idx_[% index | html %]" data-preselect="[% preselect | html %]">
4
[% ELSE %]
7
[% ELSE %]
5
    <select class="advsearch" name="idx" id="idx">
8
    <select class="advsearch" name="idx" id="idx_[% index | html %]" data-preselect="[% preselect | html %]">
6
[% END %]
9
[% END %]
7
    [% IF ms_kw %]
10
    [% SET StaffAdvancedSearchList = AdditionalContents.get( location => "StaffAdvancedSearchList", lang => lang, library => logged_in_user.branchcode ) -%]
8
        <option selected="selected" value="kw">Keyword</option>
11
    [% IF StaffAdvancedSearchList.content %]
12
        [% FOREACH block IN StaffAdvancedSearchList.content %]
13
            [%- block.content | $raw -%]
14
        [% END %]
9
    [% ELSE %]
15
    [% ELSE %]
10
        <option value="kw">Keyword</option>
16
        <option value="kw">Keyword</option>
11
    [% END %]
12
    [% IF ms_kwcommaphr %]
13
        <option selected="selected" value="kw,phr">&nbsp;&nbsp;&nbsp;&nbsp; Keyword as phrase</option>
14
    [% ELSE %]
15
        <option value="kw,phr">&nbsp;&nbsp;&nbsp;&nbsp; Keyword as phrase</option>
17
        <option value="kw,phr">&nbsp;&nbsp;&nbsp;&nbsp; Keyword as phrase</option>
16
    [% END %]
17
    [% IF ms_au %]
18
        <option selected="selected" value="au">Author</option>
19
    [% ELSE %]
20
        <option value="au">Author</option>
18
        <option value="au">Author</option>
21
    [% END %]
22
    [% IF ms_aucommaphr %]
23
        <option selected="selected" value="au,phr">&nbsp;&nbsp;&nbsp;&nbsp; Author as phrase</option>
24
    [% ELSE %]
25
        <option value="au,phr">&nbsp;&nbsp;&nbsp;&nbsp; Author as phrase</option>
19
        <option value="au,phr">&nbsp;&nbsp;&nbsp;&nbsp; Author as phrase</option>
26
    [% END %]
27
    [% IF ms_cpn %]
28
        <option selected="selected" value="cpn">&nbsp;&nbsp;&nbsp;&nbsp; Corporate name</option>
29
    [% ELSE %]
30
        <option value="cpn">&nbsp;&nbsp;&nbsp;&nbsp; Corporate name</option>
20
        <option value="cpn">&nbsp;&nbsp;&nbsp;&nbsp; Corporate name</option>
31
    [% END %]
32
    [% IF ms_cfn %]
33
        <option selected="selected" value="cfn">&nbsp;&nbsp;&nbsp;&nbsp; Conference name</option>
34
    [% ELSE %]
35
        <option value="cfn">&nbsp;&nbsp;&nbsp;&nbsp; Conference name</option>
21
        <option value="cfn">&nbsp;&nbsp;&nbsp;&nbsp; Conference name</option>
36
    [% END %]
37
    [% IF ms_cpncommaphr %]
38
        <option selected="selected" value="cpn,phr">&nbsp;&nbsp;&nbsp;&nbsp; Corporate name as phrase</option>
39
    [% ELSE %]
40
        <option value="cpn,phr">&nbsp;&nbsp;&nbsp;&nbsp; Corporate name as phrase</option>
22
        <option value="cpn,phr">&nbsp;&nbsp;&nbsp;&nbsp; Corporate name as phrase</option>
41
    [% END %]
42
    [% IF ms_cfncommaphr %]
43
        <option selected="selected" value="cfn,phr">&nbsp;&nbsp;&nbsp;&nbsp; Conference name as phrase</option>
44
    [% ELSE %]
45
        <option value="cfn,phr">&nbsp;&nbsp;&nbsp;&nbsp; Conference name as phrase</option>
23
        <option value="cfn,phr">&nbsp;&nbsp;&nbsp;&nbsp; Conference name as phrase</option>
46
    [% END %]
47
    [% IF ms_pn %]
48
        <option selected="selected" value="pn">&nbsp;&nbsp;&nbsp;&nbsp; Personal name</option>
49
    [% ELSE %]
50
        <option value="pn">&nbsp;&nbsp;&nbsp;&nbsp; Personal name</option>
24
        <option value="pn">&nbsp;&nbsp;&nbsp;&nbsp; Personal name</option>
51
    [% END %]
52
    [% IF ms_pncommaphr %]
53
        <option selected="selected" value="pn,phr">&nbsp;&nbsp;&nbsp;&nbsp; Personal name as phrase</option>
54
    [% ELSE %]
55
        <option value="pn,phr">&nbsp;&nbsp;&nbsp;&nbsp; Personal name as phrase</option>
25
        <option value="pn,phr">&nbsp;&nbsp;&nbsp;&nbsp; Personal name as phrase</option>
56
    [% END %]
57
    [% IF ms_ti %]
58
        <option selected="selected" value="ti">Title</option>
59
    [% ELSE %]
60
        <option value="ti">Title</option>
26
        <option value="ti">Title</option>
61
    [% END %]
62
    [% IF ms_ticommaphr %]
63
        <option selected="selected" value="ti,phr">&nbsp;&nbsp;&nbsp;&nbsp; Title as phrase</option>
64
    [% ELSE %]
65
        <option value="ti,phr">&nbsp;&nbsp;&nbsp;&nbsp; Title as phrase</option>
27
        <option value="ti,phr">&nbsp;&nbsp;&nbsp;&nbsp; Title as phrase</option>
66
    [% END %]
67
    [% IF ms_se %]
68
        <option selected="seleced" value="se">&nbsp;&nbsp;&nbsp;&nbsp; Series title</option>
69
    [% ELSE %]
70
        <option value="se">&nbsp;&nbsp;&nbsp;&nbsp; Series title</option>
28
        <option value="se">&nbsp;&nbsp;&nbsp;&nbsp; Series title</option>
71
    [% END %]
72
    [% IF ms_su %]
73
        <option selected="selected" value="su">Subject</option>
74
    [% ELSE %]
75
        <option value="su">Subject</option>
29
        <option value="su">Subject</option>
76
    [% END %]
77
    [% IF ms_sucommaphr %]
78
        <option selected="selected" value="su,phr">&nbsp;&nbsp;&nbsp;&nbsp; Subject as phrase</option>
79
    [% ELSE %]
80
        <option value="su,phr">&nbsp;&nbsp;&nbsp;&nbsp; Subject as phrase</option>
30
        <option value="su,phr">&nbsp;&nbsp;&nbsp;&nbsp; Subject as phrase</option>
81
    [% END %]
82
    [% IF ( expanded_options ) %]
83
        [% IF ms_sudashbr %]
84
            <option selected="selected" value="su-br">&nbsp;&nbsp;&nbsp;&nbsp; Subject and broader terms</option>
85
        [% ELSE %]
86
            <option value="su-br">&nbsp;&nbsp;&nbsp;&nbsp; Subject and broader terms</option>
87
        [% END %]
88
        [% IF ms_sudashna %]
89
            <option selected="selected" value="su-na">&nbsp;&nbsp;&nbsp;&nbsp; Subject and narrower terms</option>
90
        [% ELSE %]
91
            <option value="su-na">&nbsp;&nbsp;&nbsp;&nbsp; Subject and narrower terms</option>
92
        [% END %]
93
        [% IF ms_sudashrl %]
94
            <option selected="selected" value="su-rl">&nbsp;&nbsp;&nbsp;&nbsp; Subject and related terms</option>
95
        [% ELSE %]
96
            <option value="su-rl">&nbsp;&nbsp;&nbsp;&nbsp; Subject and related terms</option>
97
        [% END %]
98
    [% END %]
99
    [% IF ms_bc %]
100
        <option selected="selected" value="bc">Barcode</option>
101
    [% ELSE %]
102
        <option value="bc">Barcode</option>
31
        <option value="bc">Barcode</option>
103
    [% END %]
104
    [% IF ms_locationcommawrdl %]
105
        <option selected="selected" value="location,wrdl" title="Enter location code value for search">Shelving location (code)</option>
106
    [% ELSE %]
107
        <option value="location,wrdl" title="Enter location code value for search">Shelving location (code)</option>
32
        <option value="location,wrdl" title="Enter location code value for search">Shelving location (code)</option>
108
    [% END %]
33
        <option value="ident">Standard number</option>
109
    [% IF ( Koha.Preference('IntranetNumbersPreferPhrase') ) %]
110
        [% IF ms_identcommaphr %]
111
            <option selected="selected" value="ident,phr">Standard number</option>
112
        [% ELSE %]
113
            <option value="ident,phr">Standard number</option>
114
        [% END %]
115
    [% ELSE %]
116
        [% IF ms_ident %]
117
            <option selected="selected" value="ident">Standard number</option>
118
        [% ELSE %]
119
            <option value="ident">Standard number</option>
120
        [% END %]
121
    [% END %]
122
    [% IF ms_nb %]
123
        <option selected="selected" value="nb">&nbsp;&nbsp;&nbsp;&nbsp; ISBN</option>
124
    [% ELSE %]
125
        <option value="nb">&nbsp;&nbsp;&nbsp;&nbsp; ISBN</option>
34
        <option value="nb">&nbsp;&nbsp;&nbsp;&nbsp; ISBN</option>
126
    [% END %]
127
    [% IF ms_ns %]
128
        <option selected="selected" value="ns">&nbsp;&nbsp;&nbsp;&nbsp; ISSN</option>
129
    [% ELSE %]
130
        <option value="ns">&nbsp;&nbsp;&nbsp;&nbsp; ISSN</option>
35
        <option value="ns">&nbsp;&nbsp;&nbsp;&nbsp; ISSN</option>
131
    [% END %]
36
        <option value="callnum">&nbsp;&nbsp;&nbsp;&nbsp; Call number</option>
132
    [% IF ( Koha.Preference('IntranetNumbersPreferPhrase') ) %]
133
        [% IF ms_callnumcommaphr %]
134
            <option selected="selected" value="callnum,phr">&nbsp;&nbsp;&nbsp;&nbsp; Call number</option>
135
        [% ELSE %]
136
            <option value="callnum,phr">&nbsp;&nbsp;&nbsp;&nbsp; Call number</option>
137
        [% END %]
138
    [% ELSE %]
139
        [% IF ms_callnum %]
140
            <option selected="selected" value="callnum">&nbsp;&nbsp;&nbsp;&nbsp; Call number</option>
141
        [% ELSE %]
142
            <option value="callnum">&nbsp;&nbsp;&nbsp;&nbsp; Call number</option>
143
        [% END %]
144
    [% END %]
145
    [% IF ms_lncommartrn %]
146
        <option selected="selected" value="ln,rtrn">Language</option>
147
    [% ELSE %]
148
        <option value="ln,rtrn">Language</option>
37
        <option value="ln,rtrn">Language</option>
149
    [% END %]
150
    [% IF ms_nt %]
151
        <option selected="selected" value="nt">Notes/Comments</option>
152
    [% ELSE %]
153
        <option value="nt">Notes/Comments</option>
38
        <option value="nt">Notes/Comments</option>
154
    [% END %]
39
        <option value="curriculum">Curriculum</option>
155
    [% IF (marcflavour != 'UNIMARC' ) %]
156
        [% IF ms_curriculum %]
157
            <option selected="selected" value="curriculum">Curriculum</option>
158
        [% ELSE %]
159
            <option value="curriculum">Curriculum</option>
160
        [% END %]
161
    [% END %]
162
    [% IF ms_pb %]
163
        <option selected="selected" value="pb">Publisher</option>
164
    [% ELSE %]
165
        <option value="pb">Publisher</option>
40
        <option value="pb">Publisher</option>
166
    [% END %]
167
    [% IF ms_pl %]
168
        <option selected="selected" value="pl">Publisher location</option>
169
    [% ELSE %]
170
        <option value="pl">Publisher location</option>
41
        <option value="pl">Publisher location</option>
171
    [% END %]
172
173
    [%# Use non-normalized st-year instead of st-numeric, %]
174
    [%# since pubdate can include 'u' to signify unknown %]
175
    [%# dates. See "Legal Characters" at: %]
176
    [%# http://www.loc.gov/marc/bibliographic/bd008a.html %]
177
    [%# This search is also for date ranges due to the %]
178
    [%# special Zebra r=r CCL mapping for 'yr' %]
179
    [% IF ms_yrcommastdashyear %]
180
        <option selected="selected" value="yr,st-year">Publication date (yyyy-yyyy)</option>
181
    [% ELSE %]
182
        <option value="yr,st-year">Publication date (yyyy-yyyy)</option>
42
        <option value="yr,st-year">Publication date (yyyy-yyyy)</option>
183
    [% END %]
184
    [% IF ms_acqdatecommastdashdatedashnormalized %]
185
        <option selected="selected" value="acqdate,st-date-normalized">Acquisition date (yyyy-mm-dd)</option>
186
    [% ELSE %]
187
        <option value="acqdate,st-date-normalized">Acquisition date (yyyy-mm-dd)</option>
43
        <option value="acqdate,st-date-normalized">Acquisition date (yyyy-mm-dd)</option>
188
    [% END %]
44
    [% END %]
189
</select>
45
</select>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/advsearch.tt (-2 / +18 lines)
Lines 174-181 Link Here
174
                        [% ELSE %]
174
                        [% ELSE %]
175
                        <div>
175
                        <div>
176
                        [% END %]
176
                        [% END %]
177
                        [% SET preselect = 'ms_' _ indexes.${loop.index}.replace(',','comma') %]
177
                        [% SET preselect = indexes.${loop.index} %]
178
                        [% INCLUDE 'search_indexes.inc' ${preselect} = 1 %]
178
                        [% INCLUDE 'search_indexes.inc' ${preselect} = preselect index = loop.index %]
179
                        <input type="text" size="30" name="q" title="Enter search terms" value="[% query | html %]" />
179
                        <input type="text" size="30" name="q" title="Enter search terms" value="[% query | html %]" />
180
                        [% IF ( expanded_options ) %]
180
                        [% IF ( expanded_options ) %]
181
                          [% IF ( loop.last ) %]
181
                          [% IF ( loop.last ) %]
Lines 516-521 Link Here
516
            });
516
            });
517
            [% END %]
517
            [% END %]
518
518
519
            function preselectOptions() {
520
                const dropdowns = document.querySelectorAll('.advsearch');
521
                dropdowns.forEach(dropdown => {
522
                    const preselectValue = dropdown.dataset.preselect;
523
                    if (preselectValue) {
524
                        const options = dropdown.querySelectorAll('option');
525
                        for (let i = 0; i < options.length; i++) {
526
                            if (options[i].value === preselectValue) {
527
                                options[i].selected = true;
528
                                break;
529
                            }
530
                        }
531
                    }
532
                });
533
            }
534
            preselectOptions();
519
535
520
        });
536
        });
521
    </script>
537
    </script>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/additional-contents.tt (-2 / +1 lines)
Lines 536-542 Link Here
536
                [% END %]
536
                [% END %]
537
            [% END %]
537
            [% END %]
538
        </optgroup>
538
        </optgroup>
539
        [% SET staff_available_options = [ 'IntranetmainUserblock', 'StaffAcquisitionsHome', 'StaffAuthoritiesHome', 'StaffCataloguingHome', 'StaffListsHome', 'StaffPatronsHome', 'StaffPOSHome', 'StaffSerialsHome' ] %]
539
        [% SET staff_available_options = [ 'IntranetmainUserblock', 'StaffAcquisitionsHome', 'StaffAdvancedSearchList', 'StaffAuthoritiesHome', 'StaffCataloguingHome', 'StaffListsHome', 'StaffPatronsHome', 'StaffPOSHome', 'StaffSerialsHome' ] %]
540
        <optgroup label="Staff">
540
        <optgroup label="Staff">
541
            [% FOREACH l IN staff_available_options.sort %]
541
            [% FOREACH l IN staff_available_options.sort %]
542
                [% IF l == location %]
542
                [% IF l == location %]
543
- 

Return to bug 37442