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

(-)a/installer/data/mysql/atomicupdate/bug_14715-add_resultsperpagedropdown_sysprefs.perl (+11 lines)
Line 0 Link Here
1
$DBversion = 'XXX';
2
if( CheckVersion( $DBversion ) ) {
3
    $dbh->do(q{
4
        INSERT IGNORE INTO systempreferences (`variable`, `value`, `options`, `explanation`,`type`) VALUES
5
        ('OPACnumSearchResultsDropdown', 0, NULL, 'Enable option list of number of results per page to show in OPAC search results','YesNo'),
6
        ('numSearchResultsDropdown', 0, NULL, 'Enable option list of number of results per page to show in staff client search results','YesNo')
7
    });
8
9
    SetVersion( $DBversion );
10
    print "Upgrade to $DBversion done (Bug 14715 - Add sysprefs numSearchResultsDropdown and OPACnumSearchResultsDropdown)\n";
11
}
(-)a/installer/data/mysql/sysprefs.sql (+2 lines)
Lines 343-348 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
343
('numReturnedItemsToShow','20',NULL,'Number of returned items to show on the check-in page','Integer'),
343
('numReturnedItemsToShow','20',NULL,'Number of returned items to show on the check-in page','Integer'),
344
('NumSavedReports', '20', NULL, 'By default, show this number of saved reports.', 'Integer'),
344
('NumSavedReports', '20', NULL, 'By default, show this number of saved reports.', 'Integer'),
345
('numSearchResults','20',NULL,'Specify the maximum number of results to display on a page of results','Integer'),
345
('numSearchResults','20',NULL,'Specify the maximum number of results to display on a page of results','Integer'),
346
('numSearchResultsDropdown', 0, NULL, 'Enable option list of number of results per page to show in staff client search results','YesNo'),
346
('numSearchRSSResults','50',NULL,'Specify the maximum number of results to display on a RSS page of results','Integer'),
347
('numSearchRSSResults','50',NULL,'Specify the maximum number of results to display on a RSS page of results','Integer'),
347
('OAI-PMH','0',NULL,'if ON, OAI-PMH server is enabled','YesNo'),
348
('OAI-PMH','0',NULL,'if ON, OAI-PMH server is enabled','YesNo'),
348
('OAI-PMH:archiveID','KOHA-OAI-TEST',NULL,'OAI-PMH archive identification','Free'),
349
('OAI-PMH:archiveID','KOHA-OAI-TEST',NULL,'OAI-PMH archive identification','Free'),
Lines 413-418 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
413
('OPACNoResultsFound','','70|10','Display this HTML when no results are found for a search in the OPAC','Textarea'),
414
('OPACNoResultsFound','','70|10','Display this HTML when no results are found for a search in the OPAC','Textarea'),
414
('OPACNumbersPreferPhrase','0',NULL,'Control the use of phr operator in callnumber and standard number OPAC searches','YesNo'),
415
('OPACNumbersPreferPhrase','0',NULL,'Control the use of phr operator in callnumber and standard number OPAC searches','YesNo'),
415
('OPACnumSearchResults','20',NULL,'Specify the maximum number of results to display on a page of results','Integer'),
416
('OPACnumSearchResults','20',NULL,'Specify the maximum number of results to display on a page of results','Integer'),
417
('OPACnumSearchResultsDropdown', 0, NULL, 'Enable option list of number of results per page to show in OPAC search results','YesNo'),
416
('OpacPasswordChange','1',NULL,'If ON, enables patron-initiated password change in OPAC (disable it when using LDAP auth)','YesNo'),
418
('OpacPasswordChange','1',NULL,'If ON, enables patron-initiated password change in OPAC (disable it when using LDAP auth)','YesNo'),
417
('OPACPatronDetails','1','','If OFF the patron details tab in the OPAC is disabled.','YesNo'),
419
('OPACPatronDetails','1','','If OFF the patron details tab in the OPAC is disabled.','YesNo'),
418
('OPACpatronimages','0',NULL,'Enable patron images in the OPAC','YesNo'),
420
('OPACpatronimages','0',NULL,'Enable patron images in the OPAC','YesNo'),
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/page-numbers.inc (-5 / +5 lines)
Lines 1-19 Link Here
1
[% IF ( PAGE_NUMBERS ) %]<nav><ul class="pagination">
1
[% IF ( PAGE_NUMBERS ) %]<nav><ul class="pagination">
2
 [% IF hits_to_paginate < total %]<h6>[% hits_to_paginate | html %] of [% total | html %] results loaded, refine your search to view other records</h6>[% END %]
2
 [% IF hits_to_paginate < total %]<h6>[% hits_to_paginate | html %] of [% total | html %] results loaded, refine your search to view other records</h6>[% END %]
3
    [% IF ( previous_page_offset.defined ) %]
3
    [% IF ( previous_page_offset.defined ) %]
4
        <li><a class="nav" href="/cgi-bin/koha/catalogue/search.pl?[% query_cgi | $raw %][% limit_cgi | $raw %][% IF ( sort_by ) %]&amp;sort_by=[% sort_by |url %][% END %]"><i class="fa fa-fw fa-angle-double-left"></i> First</a></li>
4
        <li><a class="nav" href="/cgi-bin/koha/catalogue/search.pl?[% query_cgi | $raw %][% limit_cgi | $raw %][% IF ( sort_by ) %]&amp;sort_by=[% sort_by |url %][% END %][% IF results_per_page %]&amp;count=[% results_per_page %][% END %]"><i class="fa fa-fw fa-angle-double-left"></i> First</a></li>
5
        <!-- Row of numbers corresponding to search result pages -->
5
        <!-- Row of numbers corresponding to search result pages -->
6
        <li><a class="nav" href="/cgi-bin/koha/catalogue/search.pl?[% query_cgi | $raw %][% limit_cgi | $raw %]&amp;offset=[% previous_page_offset | html %][% IF ( sort_by ) %]&amp;sort_by=[% sort_by |url %][% END %]"><i class="fa fa-fw fa-angle-left"></i> Previous</a></li>
6
        <li><a class="nav" href="/cgi-bin/koha/catalogue/search.pl?[% query_cgi | $raw %][% limit_cgi | $raw %]&amp;offset=[% previous_page_offset | html %][% IF ( sort_by ) %]&amp;sort_by=[% sort_by |url %][% END %][% IF results_per_page %]&amp;count=[% results_per_page %][% END %]"><i class="fa fa-fw fa-angle-left"></i> Previous</a></li>
7
    [% END %]
7
    [% END %]
8
    [% FOREACH PAGE_NUMBER IN PAGE_NUMBERS %]
8
    [% FOREACH PAGE_NUMBER IN PAGE_NUMBERS %]
9
        [% IF ( PAGE_NUMBER.highlight ) %]
9
        [% IF ( PAGE_NUMBER.highlight ) %]
10
            <li class="active"><span>[% PAGE_NUMBER.pg | html %]</span></li>
10
            <li class="active"><span>[% PAGE_NUMBER.pg | html %]</span></li>
11
        [% ELSE %]
11
        [% ELSE %]
12
            <li><a class="nav" href="/cgi-bin/koha/catalogue/search.pl?[% query_cgi | $raw %][% limit_cgi | $raw %]&amp;offset=[% PAGE_NUMBER.offset | html %][% IF ( sort_by ) %]&amp;sort_by=[% sort_by |url %][% END %]">[% PAGE_NUMBER.pg | html %]</a></li>
12
            <li><a class="nav" href="/cgi-bin/koha/catalogue/search.pl?[% query_cgi | $raw %][% limit_cgi | $raw %]&amp;offset=[% PAGE_NUMBER.offset | html %][% IF ( sort_by ) %]&amp;sort_by=[% sort_by |url %][% END %][% IF results_per_page %]&amp;count=[% results_per_page %][% END %]">[% PAGE_NUMBER.pg | html %]</a></li>
13
        [% END %]
13
        [% END %]
14
    [% END %]
14
    [% END %]
15
    [% IF ( next_page_offset ) %]
15
    [% IF ( next_page_offset ) %]
16
        <li><a class="nav" href="/cgi-bin/koha/catalogue/search.pl?[% query_cgi | $raw %][% limit_cgi | $raw %]&amp;offset=[% next_page_offset | html %][% IF ( sort_by ) %]&amp;sort_by=[% sort_by |url %][% END %]">Next <i class="fa fa-fw fa-angle-right"></i></a></li>
16
        <li><a class="nav" href="/cgi-bin/koha/catalogue/search.pl?[% query_cgi | $raw %][% limit_cgi | $raw %]&amp;offset=[% next_page_offset | html %][% IF ( sort_by ) %]&amp;sort_by=[% sort_by |url %][% END %][% IF results_per_page %]&amp;count=[% results_per_page %][% END %]">Next <i class="fa fa-fw fa-angle-right"></i></a></li>
17
        <li><a class="nav" href="/cgi-bin/koha/catalogue/search.pl?[% query_cgi | $raw %][% limit_cgi | $raw %]&amp;offset=[% last_page_offset | html %][% IF ( sort_by ) %]&amp;sort_by=[% sort_by |url %][% END %]">Last <i class="fa fa-fw fa-angle-double-right"></i></a></li>
17
        <li><a class="nav" href="/cgi-bin/koha/catalogue/search.pl?[% query_cgi | $raw %][% limit_cgi | $raw %]&amp;offset=[% last_page_offset | html %][% IF ( sort_by ) %]&amp;sort_by=[% sort_by |url %][% END %][% IF results_per_page %]&amp;count=[% results_per_page %][% END %]">Last <i class="fa fa-fw fa-angle-double-right"></i></a></li>
18
    [% END %]
18
    [% END %]
19
</ul></nav>[% END %]
19
</ul></nav>[% END %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/searching.pref (+18 lines)
Lines 140-145 Searching: Link Here
140
            - 'the operator "phr" in the callnumber and standard number staff client searches'
140
            - 'the operator "phr" in the callnumber and standard number staff client searches'
141
    Results Display:
141
    Results Display:
142
        -
142
        -
143
            - pref: numSearchResultsDropdown
144
              type: boolean
145
              default: no
146
              choices:
147
                  yes: Show
148
                  no: "Don't show"
149
            - results per page dropdown on staff client search results.
150
            - "Note: This does not work if ElasticSearch is activated."
151
        -
152
            - pref: OPACnumSearchResultsDropdown
153
              type: boolean
154
              default: no
155
              choices:
156
                  yes: Show
157
                  no: "Don't show"
158
            - results per page dropdown on OPAC search results.
159
            - "Note: This does not work if ElasticSearch is activated."
160
        -
143
            - By default, sort search results in the staff client by
161
            - By default, sort search results in the staff client by
144
            - pref: defaultSortField
162
            - pref: defaultSortField
145
              default: relevance
163
              default: relevance
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/results.tt (+23 lines)
Lines 267-272 Link Here
267
                                    [% END %]
267
                                    [% END %]
268
                                </ul>
268
                                </ul>
269
                            </div> <!-- /.btn-group -->
269
                            </div> <!-- /.btn-group -->
270
271
                            [% IF Koha.Preference('numSearchResultsDropdown') && Koha.Preference('SearchEngine') == "Zebra" %]
272
                                <div class="btn-group">
273
                                    <button type="button" class="btn btn-default btn-xs dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
274
                                        Results per page: [% results_per_page %] <span class="caret"></span>
275
                                    </button>
276
                                    <ul class="dropdown-menu">
277
                                        [% IF Koha.Preference('numSearchResults') %]
278
                                            <li><a href="#" id="resultsperpage-default">
279
                                                [% IF results_per_page == Koha.Preference('numSearchResults') %]
280
                                                    <i class="fa fa-check"></i>
281
                                                [% END %] Library default: [% Koha.Preference('numSearchResults') %]
282
                                            </a></li>
283
                                        [% END %]
284
                                        <li><a href="/cgi-bin/koha/catalogue/search.pl?count=20[% PROCESS sort_search_query %]">[% IF results_per_page == '20' %]<i class="fa fa-check"></i>[% END %] 20</a></li>
285
                                        <li><a href="/cgi-bin/koha/catalogue/search.pl?count=40[% PROCESS sort_search_query %]" id="resultsperpage-40">[% IF results_per_page == '40' %]<i class="fa fa-check"></i>[% END %] 40</a></li>
286
                                        <li><a href="/cgi-bin/koha/catalogue/search.pl?count=60[% PROCESS sort_search_query %]" id="resultsperpage-60">[% IF results_per_page == '60' %]<i class="fa fa-check"></i>[% END %] 60</a></li>
287
                                        <li><a href="/cgi-bin/koha/catalogue/search.pl?count=80[% PROCESS sort_search_query %]" id="resultsperpage-80">[% IF results_per_page == '80' %]<i class="fa fa-check"></i>[% END %] 80</a></li>
288
                                        <li><a href="/cgi-bin/koha/catalogue/search.pl?count=100[% PROCESS sort_search_query %]" id="resultsperpage-100">[% IF results_per_page == '100' %]<i class="fa fa-check"></i>[% END %] 100</a></li>
289
                                    </ul>
290
                                </div> <!-- /.btn-group -->
291
                            [% END %]
292
270
                        </div> <!-- /#selection_ops -->
293
                        </div> <!-- /#selection_ops -->
271
                    </div> <!-- /#searchheader -->
294
                    </div> <!-- /#searchheader -->
272
295
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/includes/page-numbers.inc (-5 / +5 lines)
Lines 3-21 Link Here
3
     [% IF hits_to_paginate < total %]<h6>[% hits_to_paginate | html %] of [% total | html %] results loaded, refine your search to view other records</h6>[% END %]
3
     [% IF hits_to_paginate < total %]<h6>[% hits_to_paginate | html %] of [% total | html %] results loaded, refine your search to view other records</h6>[% END %]
4
        <ul>
4
        <ul>
5
            [% IF ( previous_page_offset.defined ) %]
5
            [% IF ( previous_page_offset.defined ) %]
6
                <li class="page-first"><a href="/cgi-bin/koha/opac-search.pl?[% query_cgi | $raw %][% limit_cgi | $raw %][% IF ( sort_by ) %]&amp;sort_by=[% sort_by | uri %][% END %]"><i class="fa fa-fw fa-angle-double-left"></i>  First</a></li>
6
                <li class="page-first"><a href="/cgi-bin/koha/opac-search.pl?[% query_cgi | $raw %][% limit_cgi | $raw %][% IF ( sort_by ) %]&amp;sort_by=[% sort_by | uri %][% END %][% IF results_per_page %]&amp;count=[% results_per_page %][% END %]"><i class="fa fa-fw fa-angle-double-left"></i>  First</a></li>
7
                <li class="page-prev"><a href="/cgi-bin/koha/opac-search.pl?[% query_cgi | $raw %][% limit_cgi | $raw %]&amp;offset=[% previous_page_offset | uri %][% IF ( sort_by ) %]&amp;sort_by=[% sort_by | uri %][% END %]"> <i class="fa fa-fw fa-angle-left"></i>  Previous</a></li>
7
                <li class="page-prev"><a href="/cgi-bin/koha/opac-search.pl?[% query_cgi | $raw %][% limit_cgi | $raw %]&amp;offset=[% previous_page_offset | uri %][% IF ( sort_by ) %]&amp;sort_by=[% sort_by | uri %][% END %][% IF results_per_page %]&amp;count=[% results_per_page %][% END %]"> <i class="fa fa-fw fa-angle-left"></i>  Previous</a></li>
8
            [% END %]
8
            [% END %]
9
            [% FOREACH PAGE_NUMBER IN PAGE_NUMBERS %]
9
            [% FOREACH PAGE_NUMBER IN PAGE_NUMBERS %]
10
                [% IF ( PAGE_NUMBER.highlight ) %]
10
                [% IF ( PAGE_NUMBER.highlight ) %]
11
                    <li class="active"><a clas="page-num current" href="#">[% PAGE_NUMBER.pg | html %]</a></li>
11
                    <li class="active"><a clas="page-num current" href="#">[% PAGE_NUMBER.pg | html %]</a></li>
12
                [% ELSE %]
12
                [% ELSE %]
13
                    <li class="page-num"><a href="/cgi-bin/koha/opac-search.pl?[% query_cgi | $raw %][% limit_cgi | $raw %]&amp;offset=[% PAGE_NUMBER.offset | uri %][% IF ( sort_by ) %]&amp;sort_by=[% sort_by | uri %][% END %]">[% PAGE_NUMBER.pg | html %]</a></li>
13
                    <li class="page-num"><a href="/cgi-bin/koha/opac-search.pl?[% query_cgi | $raw %][% limit_cgi | $raw %]&amp;offset=[% PAGE_NUMBER.offset | uri %][% IF ( sort_by ) %]&amp;sort_by=[% sort_by | uri %][% END %][% IF results_per_page %]&amp;count=[% results_per_page %][% END %]">[% PAGE_NUMBER.pg | html %]</a></li>
14
                [% END %]
14
                [% END %]
15
            [% END %]
15
            [% END %]
16
            [% IF ( next_page_offset ) %]
16
            [% IF ( next_page_offset ) %]
17
                <li class="page-next"><a href="/cgi-bin/koha/opac-search.pl?[% query_cgi | $raw %][% limit_cgi | $raw %]&amp;offset=[% next_page_offset | uri %][% IF ( sort_by ) %]&amp;sort_by=[% sort_by | uri %][% END %]">Next <i class="fa fa-fw fa-angle-double-right"></i></a></li>
17
                <li class="page-next"><a href="/cgi-bin/koha/opac-search.pl?[% query_cgi | $raw %][% limit_cgi | $raw %]&amp;offset=[% next_page_offset | uri %][% IF ( sort_by ) %]&amp;sort_by=[% sort_by | uri %][% END %][% IF results_per_page %]&amp;count=[% results_per_page %][% END %]">Next <i class="fa fa-fw fa-angle-double-right"></i></a></li>
18
                <li class="page-last"><a href="/cgi-bin/koha/opac-search.pl?[% query_cgi | $raw %][% limit_cgi | $raw %]&amp;offset=[% last_page_offset | uri %][% IF ( sort_by ) %]&amp;sort_by=[% sort_by | uri %][% END %]">Last <i class="fa fa-fw fa-angle-double-right"></i></a></li>
18
                <li class="page-last"><a href="/cgi-bin/koha/opac-search.pl?[% query_cgi | $raw %][% limit_cgi | $raw %]&amp;offset=[% last_page_offset | uri %][% IF ( sort_by ) %]&amp;sort_by=[% sort_by | uri %][% END %][% IF results_per_page %]&amp;count=[% results_per_page %][% END %]">Last <i class="fa fa-fw fa-angle-double-right"></i></a></li>
19
            [% END %]
19
            [% END %]
20
        </ul>
20
        </ul>
21
    </div>
21
    </div>
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-results.tt (-1 / +25 lines)
Lines 163-171 Link Here
163
                                        [% UNLESS tag %]
163
                                        [% UNLESS tag %]
164
                                            <div class="sort_by pull-right">
164
                                            <div class="sort_by pull-right">
165
                                                <select id="sort_by" class="resort" name="sort_by"> [% INCLUDE 'resort_form.inc' %] </select>
165
                                                <select id="sort_by" class="resort" name="sort_by"> [% INCLUDE 'resort_form.inc' %] </select>
166
167
                                                [% IF Koha.Preference('OPACnumSearchResultsDropdown') && Koha.Preference('SearchEngine') == "Zebra" %]
168
                                                    <label for="results_per_page">Results per page: </label>
169
                                                    <select id="results_per_page" name="count">
170
                                                        [% IF Koha.Preference('OPACnumSearchResults') %]
171
                                                            [% IF results_per_page == Koha.Preference('OPACnumSearchResults') %]
172
                                                                <option value="[% Koha.Preference('OPACnumSearchResults') %]" selected="selected">Library default: [% Koha.Preference('OPACnumSearchResults') %]</option>
173
                                                            [% ELSE %]
174
                                                                <option value="[% Koha.Preference('OPACnumSearchResults') %]">Library default: [% Koha.Preference('OPACnumSearchResults') %]</option>
175
                                                            [% END %]
176
                                                        [% END %]
177
                                                        [% IF results_per_page == '20' %]<option value="20" selected="selected">20</option>[% ELSE %]<option value="20">20</option>[% END %]
178
                                                        [% IF results_per_page == '40' %]<option value="40" selected="selected">40</option>[% ELSE %]<option value="40">40</option>[% END %]
179
                                                        [% IF results_per_page == '60' %]<option value="60" selected="selected">60</option>[% ELSE %]<option value="60">60</option>[% END %]
180
                                                        [% IF results_per_page == '80' %]<option value="80" selected="selected">80</option>[% ELSE %]<option value="80">80</option>[% END %]
181
                                                        [% IF results_per_page == '100' %]<option value="100" selected="selected">100</option>[% ELSE %]<option value="100">100</option>[% END %]
182
                                                    </select>
183
                                                [% END %]
184
166
                                                <input type="submit" class="btn btn-sm clearfix" id="sortsubmit" value="Go" />
185
                                                <input type="submit" class="btn btn-sm clearfix" id="sortsubmit" value="Go" />
167
                                            </div>
186
                                            </div>
168
                                        [% END %]
187
                                        [% END %]
188
                                        </div>
169
                                    </div> <!-- / #toolbar -->
189
                                    </div> <!-- / #toolbar -->
170
190
171
                                    <div id="selections-toolbar" class="toolbar noprint">
191
                                    <div id="selections-toolbar" class="toolbar noprint">
Lines 802-807 $(document).ready(function(){ Link Here
802
    $('.resort').change(function() {
822
    $('.resort').change(function() {
803
        $('#bookbag_form').submit();
823
        $('#bookbag_form').submit();
804
    });
824
    });
825
826
    $('#results_per_page').change(function() {
827
        $('#bookbag_form').submit();
828
    });
829
805
    $("span.clearall").html("<a id=\"CheckNone\" href=\"#\">"+_("Clear all")+"<\/a>");
830
    $("span.clearall").html("<a id=\"CheckNone\" href=\"#\">"+_("Clear all")+"<\/a>");
806
    $("span.checkall").html("<a id=\"CheckAll\" href=\"#\">"+_("Select all")+"<\/a>");
831
    $("span.checkall").html("<a id=\"CheckAll\" href=\"#\">"+_("Select all")+"<\/a>");
807
832
808
- 

Return to bug 14715