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

(-)a/installer/data/mysql/sysprefs.sql (+1 lines)
Lines 441-443 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
441
('z3950AuthorAuthFields','701,702,700',NULL,'Define the MARC biblio fields for Personal Name Authorities to fill biblio.author','free'),
441
('z3950AuthorAuthFields','701,702,700',NULL,'Define the MARC biblio fields for Personal Name Authorities to fill biblio.author','free'),
442
('z3950NormalizeAuthor','0','','If ON, Personal Name Authorities will replace authors in biblio.author','YesNo')
442
('z3950NormalizeAuthor','0','','If ON, Personal Name Authorities will replace authors in biblio.author','YesNo')
443
;
443
;
444
INSERT INTO systempreferences (variable,value) VALUES('OpacCustomSearch','');
(-)a/installer/data/mysql/updatedatabase.pl (+12 lines)
Lines 8483-8488 if ( CheckVersion($DBversion) ) { Link Here
8483
    SetVersion ($DBversion);
8483
    SetVersion ($DBversion);
8484
}
8484
}
8485
8485
8486
$DBversion = "XXX";
8487
if ( CheckVersion($DBversion) ) {
8488
    $dbh->do(
8489
        q{
8490
INSERT INTO systempreferences (variable,value) VALUES('OpacCustomSearch','');
8491
}
8492
    );
8493
    print
8494
"Upgrade to $DBversion done (Bug 12296 - search box replaceable with a system preference)\n";
8495
    SetVersion($DBversion);
8496
}
8497
8486
=head1 FUNCTIONS
8498
=head1 FUNCTIONS
8487
8499
8488
=head2 TableExists($table)
8500
=head2 TableExists($table)
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref (+5 lines)
Lines 300-305 OPAC: Link Here
300
            - pref: NoLoginInstructions
300
            - pref: NoLoginInstructions
301
              type: textarea
301
              type: textarea
302
              class: code
302
              class: code
303
        -
304
            - "Replace the search box at the top of OPAC pages with the following HTML:"
305
            - pref: OpacCustomSearch
306
              type: textarea
307
              class: code
303
    Features:
308
    Features:
304
        -
309
        -
305
            - pref: opacuserlogin
310
            - pref: opacuserlogin
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/includes/masthead.inc (-96 / +101 lines)
Lines 1-3 Link Here
1
[% USE Koha %]
1
<div id="wrap">
2
<div id="wrap">
2
    <div id="header-region">
3
    <div id="header-region">
3
        <div class="navbar navbar-inverse navbar-static-top">
4
        <div class="navbar navbar-inverse navbar-static-top">
Lines 132-243 Link Here
132
                        [% ELSE %]
133
                        [% ELSE %]
133
                            <div class="mastheadsearch">
134
                            <div class="mastheadsearch">
134
                        [% END %]
135
                        [% END %]
135
                        <form name="searchform" method="get" action="/cgi-bin/koha/opac-search.pl" id="searchform" class="form-inline">
136
                        [% IF Koha.Preference('OpacCustomSearch') == '' %]
136
                            <label for="masthead_search"> Search
137
                            <form name="searchform" method="get" action="/cgi-bin/koha/opac-search.pl" id="searchform" class="form-inline">
137
                                [% UNLESS ( Koha.Preference( 'OpacAddMastheadLibraryPulldown' ) == 1 ) %]
138
                                <label for="masthead_search"> Search
138
                                    [% IF ( mylibraryfirst ) %]
139
                                    [% UNLESS ( Koha.Preference( 'OpacAddMastheadLibraryPulldown' ) == 1 ) %]
139
                                        (in [% mylibraryfirst %] only)
140
                                        [% IF ( mylibraryfirst ) %]
141
                                            (in [% mylibraryfirst %] only)
142
                                        [% END %]
140
                                    [% END %]
143
                                    [% END %]
141
                                [% END %]
144
                                </label>
142
                            </label>
143
145
144
                            <select name="idx" id="masthead_search">
146
                                <select name="idx" id="masthead_search">
145
                            [% IF ( ms_kw ) %]
147
                                [% IF ( ms_kw ) %]
146
                                <option selected="selected" value="">Library catalog</option>
148
                                    <option selected="selected" value="">Library catalog</option>
147
                            [% ELSE %]
148
                                <option value="">Library catalog</option>
149
                            [% END # /ms_kw %]
150
                            [% IF ( ms_ti ) %]
151
                                <option selected="selected" value="ti">Title</option>
152
                            [% ELSE %]
153
                                <option value="ti">Title</option>
154
                            [% END # /ms_ti %]
155
                            [% IF ( ms_au ) %]
156
                                <option selected="selected" value="au">Author</option>
157
                            [% ELSE %]
158
                                <option value="au">Author</option>
159
                            [% END # /ms_au%]
160
                            [% IF ( ms_su ) %]
161
                                <option selected="selected" value="su">Subject</option>
162
                            [% ELSE %]
163
                                <option value="su">Subject</option>
164
                            [% END # /ms_su %]
165
                            [% IF ( ms_nb ) %]
166
                                <option selected="selected" value="nb">ISBN</option>
167
                            [% ELSE %]
168
                                <option value="nb">ISBN</option>
169
                            [% END # /ms_nb%]
170
                            [% IF ( ms_se ) %]
171
                                <option selected="selected" value="se">Series</option>
172
                            [% ELSE %]
173
                                <option value="se">Series</option>
174
                            [% END # /ms_se %]
175
                            [% IF ( numbersphr ) %]
176
                                [% IF ( ms_callnum ) %]
177
                                        <option selected="selected" value="callnum,phr">Call number</option>
178
                                [% ELSE %]
149
                                [% ELSE %]
179
                                    <option value="callnum,phr">Call number</option>
150
                                    <option value="">Library catalog</option>
180
                                [% END #/ms_callnum %]
151
                                [% END # /ms_kw %]
181
                            [% ELSE %]
152
                                [% IF ( ms_ti ) %]
182
                                [% IF ( ms_callnum ) %]
153
                                    <option selected="selected" value="ti">Title</option>
183
                                    <option selected="selected" value="callnum">Call number</option>
154
                                [% ELSE %]
155
                                    <option value="ti">Title</option>
156
                                [% END # /ms_ti %]
157
                                [% IF ( ms_au ) %]
158
                                    <option selected="selected" value="au">Author</option>
159
                                [% ELSE %]
160
                                    <option value="au">Author</option>
161
                                [% END # /ms_au%]
162
                                [% IF ( ms_su ) %]
163
                                    <option selected="selected" value="su">Subject</option>
164
                                [% ELSE %]
165
                                    <option value="su">Subject</option>
166
                                [% END # /ms_su %]
167
                                [% IF ( ms_nb ) %]
168
                                    <option selected="selected" value="nb">ISBN</option>
184
                                [% ELSE %]
169
                                [% ELSE %]
185
                                    <option value="callnum">Call number</option>
170
                                    <option value="nb">ISBN</option>
186
                                [% END # /ms_callnum %]
171
                                [% END # /ms_nb%]
187
                            [% END # /numbersphr %]
172
                                [% IF ( ms_se ) %]
188
                            </select>
173
                                    <option selected="selected" value="se">Series</option>
174
                                [% ELSE %]
175
                                    <option value="se">Series</option>
176
                                [% END # /ms_se %]
177
                                [% IF ( numbersphr ) %]
178
                                    [% IF ( ms_callnum ) %]
179
                                            <option selected="selected" value="callnum,phr">Call number</option>
180
                                    [% ELSE %]
181
                                        <option value="callnum,phr">Call number</option>
182
                                    [% END #/ms_callnum %]
183
                                [% ELSE %]
184
                                    [% IF ( ms_callnum ) %]
185
                                        <option selected="selected" value="callnum">Call number</option>
186
                                    [% ELSE %]
187
                                        <option value="callnum">Call number</option>
188
                                    [% END # /ms_callnum %]
189
                                [% END # /numbersphr %]
190
                                </select>
189
191
190
                            [% UNLESS ( Koha.Preference( 'OpacAddMastheadLibraryPulldown' ) == 1 ) %]
192
                                [% UNLESS ( Koha.Preference( 'OpacAddMastheadLibraryPulldown' ) == 1 ) %]
191
                                <div class="input-append nolibrarypulldown">
193
                                    <div class="input-append nolibrarypulldown">
192
                            [% END %]
194
                                [% END %]
193
                            [% IF ( ms_value ) %]
195
                                [% IF ( ms_value ) %]
194
                                <input type="text" title="Type search term" class="transl1" name="q" value="[% ms_value |html %]" /><span id="translControl"></span>
196
                                    <input type="text" title="Type search term" class="transl1" name="q" value="[% ms_value |html %]" /><span id="translControl"></span>
195
                            [% ELSE %]
197
                                [% ELSE %]
196
                                <input type="text" title="Type search term" class="transl1" name="q" /><span id="translControl"></span>
198
                                    <input type="text" title="Type search term" class="transl1" name="q" /><span id="translControl"></span>
197
                            [% END # /ms_value %]
199
                                [% END # /ms_value %]
198
200
199
                            [% UNLESS ( Koha.Preference( 'OpacAddMastheadLibraryPulldown' ) == 1 ) %]
201
                                [% UNLESS ( Koha.Preference( 'OpacAddMastheadLibraryPulldown' ) == 1 ) %]
200
                                <button type="submit" id="searchsubmit" class="btn btn-primary">Go</button>
202
                                    <button type="submit" id="searchsubmit" class="btn btn-primary">Go</button>
201
                                </div>
203
                                    </div>
202
                            [% END %]
204
                                [% END %]
203
205
204
                            [% IF ( Koha.Preference( 'OpacAddMastheadLibraryPulldown' ) == 1 ) %]
206
                                [% IF ( Koha.Preference( 'OpacAddMastheadLibraryPulldown' ) == 1 ) %]
205
                                <div class="input-append">
207
                                    <div class="input-append">
206
                                    <select name="branch_group_limit" id="select_library">
208
                                        <select name="branch_group_limit" id="select_library">
207
                                        <option value="">All libraries</option>
209
                                            <option value="">All libraries</option>
208
                                        [% IF BranchCategoriesLoop %]<optgroup label="Libraries">[% END %]
210
                                            [% IF BranchCategoriesLoop %]<optgroup label="Libraries">[% END %]
209
                                            [% FOREACH BranchesLoo IN BranchesLoop %]
211
                                                [% FOREACH BranchesLoo IN BranchesLoop %]
210
                                                [% IF ( BranchesLoo.selected ) %]<option selected="selected" value="branch:[% BranchesLoo.value %]">[% BranchesLoo.branchname %]</option>
212
                                                    [% IF ( BranchesLoo.selected ) %]<option selected="selected" value="branch:[% BranchesLoo.value %]">[% BranchesLoo.branchname %]</option>
211
                                                [% ELSE %]<option value="branch:[% BranchesLoo.value %]">[% BranchesLoo.branchname %]</option>[% END %]
213
                                                    [% ELSE %]<option value="branch:[% BranchesLoo.value %]">[% BranchesLoo.branchname %]</option>[% END %]
212
                                            [% END %]
213
                                        [% IF BranchCategoriesLoop %]
214
                                            </optgroup>
215
                                            <optgroup label="Groups">
216
                                                [% FOREACH bc IN BranchCategoriesLoop %]
217
                                                    [% IF ( bc.selected ) %]
218
                                                        <option selected="selected" value="multibranchlimit-[% bc.categorycode %]">[% bc.categoryname %]</option>
219
                                                    [% ELSE %]
220
                                                        <option value="multibranchlimit-[% bc.categorycode %]">[% bc.categoryname %]</option>
221
                                                    [% END # / bc.selected %]
222
                                                [% END %]
214
                                                [% END %]
223
                                            </optgroup>
215
                                            [% IF BranchCategoriesLoop %]
224
                                        [% END # / BranchCategoriesLoop %]
216
                                                </optgroup>
225
                                    </select>
217
                                                <optgroup label="Groups">
226
                                    <button type="submit" id="searchsubmit" class="btn btn-primary">Go</button>
218
                                                    [% FOREACH bc IN BranchCategoriesLoop %]
227
                                </div>
219
                                                        [% IF ( bc.selected ) %]
228
                            [% ELSE %]
220
                                                            <option selected="selected" value="multibranchlimit-[% bc.categorycode %]">[% bc.categoryname %]</option>
229
                                [% IF ( opac_limit_override ) %]
221
                                                        [% ELSE %]
230
                                    [% IF ( opac_search_limit ) %]
222
                                                            <option value="multibranchlimit-[% bc.categorycode %]">[% bc.categoryname %]</option>
231
                                        <input name="limit" value="[% opac_search_limit %]" type="hidden" />
223
                                                        [% END # / bc.selected %]
232
                                    [% END %]
224
                                                    [% END %]
225
                                                </optgroup>
226
                                            [% END # / BranchCategoriesLoop %]
227
                                        </select>
228
                                        <button type="submit" id="searchsubmit" class="btn btn-primary">Go</button>
229
                                    </div>
233
                                [% ELSE %]
230
                                [% ELSE %]
234
                                    [% IF ( mylibraryfirst ) %]
231
                                    [% IF ( opac_limit_override ) %]
235
                                        <input name="limit" value="branch:[% mylibraryfirst %]" type="hidden" />
232
                                        [% IF ( opac_search_limit ) %]
236
                                    [% END %]
233
                                            <input name="limit" value="[% opac_search_limit %]" type="hidden" />
237
                                [% END # / opac_limit_override %]
234
                                        [% END %]
238
                            [% END # / OpacAddMastheadLibraryPulldown %]
235
                                    [% ELSE %]
236
                                        [% IF ( mylibraryfirst ) %]
237
                                            <input name="limit" value="branch:[% mylibraryfirst %]" type="hidden" />
238
                                        [% END %]
239
                                    [% END # / opac_limit_override %]
240
                                [% END # / OpacAddMastheadLibraryPulldown %]
239
241
240
                        </form>
242
                            </form>
243
                        [% ELSE # / Koha.Preference('OpacCustomSearch') == '' %]
244
                            [% Koha.Preference('OpacCustomSearch') %]
245
                        [% END # / Koha.Preference('OpacCustomSearch') == '' %]
241
                        </div> <!-- / .mastheadsearch -->
246
                        </div> <!-- / .mastheadsearch -->
242
                    [% END # / UNLESS advsearch %]
247
                    [% END # / UNLESS advsearch %]
243
248
(-)a/koha-tmpl/opac-tmpl/prog/en/includes/masthead.inc (-2 / +6 lines)
Lines 28-34 Link Here
28
28
29
[% IF ( OpacPublic ) %]
29
[% IF ( OpacPublic ) %]
30
<div id="fluid-offset">
30
<div id="fluid-offset">
31
[% UNLESS ( advsearch ) %]<form name="searchform" method="get" action="/cgi-bin/koha/opac-search.pl" id="searchform">
31
[% UNLESS ( advsearch ) %]
32
[% IF Koha.Preference('OpacCustomSearch') == '' %]
33
<form name="searchform" method="get" action="/cgi-bin/koha/opac-search.pl" id="searchform">
32
    <label for="masthead_search" class="left"> Search 
34
    <label for="masthead_search" class="left"> Search 
33
  [% UNLESS Koha.Preference( 'OpacAddMastheadLibraryPulldown' ) == 1 %]
35
  [% UNLESS Koha.Preference( 'OpacAddMastheadLibraryPulldown' ) == 1 %]
34
            [% IF ( mylibraryfirst ) %] (in [% mylibraryfirst %] only)[% END %]
36
            [% IF ( mylibraryfirst ) %] (in [% mylibraryfirst %] only)[% END %]
Lines 124-129 Link Here
124
[% IF ( virtualshelves ) %]<a href="/cgi-bin/koha/opac-shelves.pl" id="listsmenulink">Lists</a>[% END %]
126
[% IF ( virtualshelves ) %]<a href="/cgi-bin/koha/opac-shelves.pl" id="listsmenulink">Lists</a>[% END %]
125
    </form>
127
    </form>
126
[% ELSE %]
128
[% ELSE %]
129
    [% Koha.Preference('OpacCustomSearch') %]
130
[% END %]
131
[% ELSE %]
127
<div style="width:80%;*margin-bottom:-30px;">
132
<div style="width:80%;*margin-bottom:-30px;">
128
[% IF ( virtualshelves ) %]<a href="/cgi-bin/koha/opac-shelves.pl" id="listsmenulink">Lists</a>[% END %][% IF ( opacbookbag ) %]<span id="cmspan"></span>[% END %]
133
[% IF ( virtualshelves ) %]<a href="/cgi-bin/koha/opac-shelves.pl" id="listsmenulink">Lists</a>[% END %][% IF ( opacbookbag ) %]<span id="cmspan"></span>[% END %]
129
</div>
134
</div>
130
- 

Return to bug 12296