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

(-)a/installer/data/mysql/atomicupdate/bug-17018.pl (+13 lines)
Line 0 Link Here
1
use Modern::Perl;
2
3
return {
4
    bug_number => "17018",
5
    description => "Split AdvancedSearchTypes for staff and OPAC",
6
    up => sub {
7
        my ($args) = @_;
8
        my $dbh = $args->{dbh};
9
10
        $dbh->do( "INSERT IGNORE INTO systempreferences ( `variable`, `value`, `options`, `explanation`, `type` ) SELECT 'OpacAdvancedSearchTypes', `value`, `options`, 'Select which set of fields are available as limits on the OPAC advanced search page', `type` FROM systempreferences WHERE variable = 'AdvancedSearchTypes'" );
11
12
    },
13
}
(-)a/installer/data/mysql/mandatory/sysprefs.sql (+1 lines)
Lines 389-394 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
389
('OpacAddMastheadLibraryPulldown','0','','Adds a pulldown menu to select the library to search on the opac masthead.','YesNo'),
389
('OpacAddMastheadLibraryPulldown','0','','Adds a pulldown menu to select the library to search on the opac masthead.','YesNo'),
390
('OpacAdvSearchMoreOptions','pubdate,itemtype,language,subtype,sorting,location','Show search options for the expanded view (More options)','pubdate|itemtype|language|subtype|sorting|location','multiple'),
390
('OpacAdvSearchMoreOptions','pubdate,itemtype,language,subtype,sorting,location','Show search options for the expanded view (More options)','pubdate|itemtype|language|subtype|sorting|location','multiple'),
391
('OpacAdvSearchOptions','pubdate,itemtype,language,sorting,location','Show search options','pubdate|itemtype|language|subtype|sorting|location','multiple'),
391
('OpacAdvSearchOptions','pubdate,itemtype,language,sorting,location','Show search options','pubdate|itemtype|language|subtype|sorting|location','multiple'),
392
('OpacAdvancedSearchTypes','itemtypes','itemtypes|ccode','Select which set of fields are available as limits on the OPAC advanced search page','Choice'),
392
('OPACAllowHoldDateInFuture','0','','If set, along with the AllowHoldDateInFuture system preference, OPAC users can set the date of a hold to be in the future.','YesNo'),
393
('OPACAllowHoldDateInFuture','0','','If set, along with the AllowHoldDateInFuture system preference, OPAC users can set the date of a hold to be in the future.','YesNo'),
393
('OpacAllowPublicListCreation','1',NULL,'If set, allows opac users to create public lists','YesNo'),
394
('OpacAllowPublicListCreation','1',NULL,'If set, allows opac users to create public lists','YesNo'),
394
('OpacAllowSharingPrivateLists','0',NULL,'If set, allows opac users to share private lists with other patrons','YesNo'),
395
('OpacAllowSharingPrivateLists','0',NULL,'If set, allows opac users to share private lists with other patrons','YesNo'),
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref (+6 lines)
Lines 871-876 OPAC: Link Here
871
                subtype: Subtypes
871
                subtype: Subtypes
872
                sorting: Sorting
872
                sorting: Sorting
873
                location: Location and availability
873
                location: Location and availability
874
        -
875
            - Show tabs in the OPAC advanced search for limiting searches on the
876
            - pref: OpacAdvancedSearchTypes
877
              class: long
878
            - "fields (separate values with |). Tabs appear in the order listed.<br/>"
879
            - "<em>Currently supported values</em>: Item types (<strong>itemtypes</strong>), Collection, (<strong>ccode</strong>) and Shelving Location (<strong>loc</strong>)."
874
    Authentication:
880
    Authentication:
875
        -
881
        -
876
            - pref: OPACShibOnly
882
            - pref: OPACShibOnly
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/searching.pref (-2 / +2 lines)
Lines 96-106 Searching: Link Here
96
                   0: "Don't add"
96
                   0: "Don't add"
97
            - search history of the unlogged user to the next patron logging in.
97
            - search history of the unlogged user to the next patron logging in.
98
        -
98
        -
99
            - Show tabs in the OPAC and staff interface advanced search for limiting searches on the
99
            - Show tabs in the staff interface advanced search for limiting searches on the
100
            - pref: AdvancedSearchTypes
100
            - pref: AdvancedSearchTypes
101
              class: long
101
              class: long
102
            - "fields (separate values with |). Tabs appear in the order listed.<br/>"
102
            - "fields (separate values with |). Tabs appear in the order listed.<br/>"
103
            - "<em>Currently supported values</em>: Item types (<strong>itemtypes</strong>), Collection Codes (<strong>ccode</strong>) and Shelving Location (<strong>loc</strong>)."
103
            - "<em>Currently supported values</em>: Item types (<strong>itemtypes</strong>), Collection, (<strong>ccode</strong>) and Shelving Location (<strong>loc</strong>)."
104
        -
104
        -
105
            - Limit the languages listed in the advanced search drop-down to the
105
            - Limit the languages listed in the advanced search drop-down to the
106
            - pref: AdvancedSearchLanguages
106
            - pref: AdvancedSearchLanguages
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/includes/opac-topissues.inc (-3 / +3 lines)
Lines 25-32 Link Here
25
                            </select></li>
25
                            </select></li>
26
                [% END %]
26
                [% END %]
27
27
28
                [% AdvancedSearchTypes = Koha.Preference('AdvancedSearchTypes').split('\|') %]
28
                [% OpacAdvancedSearchTypes = Koha.Preference('OpacAdvancedSearchTypes').split('\|') %]
29
                [% IF AdvancedSearchTypes.grep('^itemtypes$').size %]
29
                [% IF OpacAdvancedSearchTypes.grep('^itemtypes$').size %]
30
                    <li>
30
                    <li>
31
                        <label for="itemtype">Limit to: </label>
31
                        <label for="itemtype">Limit to: </label>
32
                        <select name="itemtype" id="itemtype">
32
                        <select name="itemtype" id="itemtype">
Lines 44-50 Link Here
44
                    </li>
44
                    </li>
45
                [% END %]
45
                [% END %]
46
46
47
                [% IF AdvancedSearchTypes.grep('^ccode$').size %]
47
                [% IF OpacAdvancedSearchTypes.grep('^ccode$').size %]
48
                    <li>
48
                    <li>
49
                        <label for="ccode">Limit to:</label>
49
                        <label for="ccode">Limit to:</label>
50
                        <select name="ccode" id="ccode">
50
                        <select name="ccode" id="ccode">
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-topissues.tt (-10 / +11 lines)
Lines 65-73 Link Here
65
                <div class="col-10 order-first order-md-first order-lg-2">
65
                <div class="col-10 order-first order-md-first order-lg-2">
66
                    <div id="topissues" class="maincontent">
66
                    <div id="topissues" class="maincontent">
67
67
68
                        <h1>Top issues</h1>
68
                        <h1>Most popular</h1>
69
69
70
                        [% IF ( results ) %]
70
                        [% IF ( results ) %]
71
                            [% OpacAdvancedSearchTypes = Koha.Preference('OpacAdvancedSearchTypes').split('\|') %]
71
                            <table id="topissuest" class="table table-bordered table-striped">
72
                            <table id="topissuest" class="table table-bordered table-striped">
72
                                <caption>
73
                                <caption>
73
                                    The [% limit | html %] most checked-out
74
                                    The [% limit | html %] most checked-out
Lines 87-93 Link Here
87
                                <thead>
88
                                <thead>
88
                                    <tr>
89
                                    <tr>
89
                                        <th class="anti-the">Title</th>
90
                                        <th class="anti-the">Title</th>
90
                                        <th>[% IF ( ccodesearch ) %]Collection[% ELSE %]Item type[% END %]</th>
91
                                        <th>Item type</th>
92
                                        <th>Collection</th>
91
                                        <th>Checkouts</th>
93
                                        <th>Checkouts</th>
92
                                        [% IF Koha.Preference( 'opacuserlogin' ) == 1 %]
94
                                        [% IF Koha.Preference( 'opacuserlogin' ) == 1 %]
93
                                            <th class="NoSort">&nbsp;</th>
95
                                            <th class="NoSort">&nbsp;</th>
Lines 110-122 Link Here
110
                                                    [% IF ( result.item('size') ) %][% result.item('size') | html %][% END %]</p>
112
                                                    [% IF ( result.item('size') ) %][% result.item('size') | html %][% END %]</p>
111
                                            </td>
113
                                            </td>
112
                                            <td>
114
                                            <td>
113
                                                [% IF Koha.Preference('AdvancedSearchTypes') == 'ccode' %]
115
                                                <span class="tdlabel">Item type</span>
114
                                                    <span class="tdlabel">Collection</span>
116
                                                [% ItemTypes.GetDescription(result.itemtype) | html %]
115
                                                    [% AuthorisedValues.GetByCode('ccode', result.ccode, 1) | html %]
117
                                            </td>
116
                                                [% ELSE %]
118
                                            <td>
117
                                                    <span class="tdlabel">Item type</span>
119
                                                <span class="tdlabel">Collection</span>
118
                                                    [% ItemTypes.GetDescription(result.itemtype) | html %]
120
                                                [% AuthorisedValues.GetByCode('ccode', result.ccode, 1) | html %]
119
                                                [% END %]
120
                                            </td>
121
                                            </td>
121
                                            <td data-order="[% result.count | html %]">
122
                                            <td data-order="[% result.count | html %]">
122
                                                <span class="tdlabel">Checkouts: </span>
123
                                                <span class="tdlabel">Checkouts: </span>
Lines 150-156 Link Here
150
    <script>
151
    <script>
151
        $(function() {
152
        $(function() {
152
            $("#topissuest").dataTable($.extend(true, {}, dataTablesDefaults, {
153
            $("#topissuest").dataTable($.extend(true, {}, dataTablesDefaults, {
153
                "sorting": [[2, "desc"]],
154
                "sorting": [[3, "desc"]],
154
                "columnDefs": [
155
                "columnDefs": [
155
                    { "sortable": false, "searchable": false, 'targets': [ 'NoSort' ] },
156
                    { "sortable": false, "searchable": false, 'targets': [ 'NoSort' ] },
156
                    { "type": "anti-the", "targets" : [ "anti-the" ] }
157
                    { "type": "anti-the", "targets" : [ "anti-the" ] }
(-)a/opac/opac-search.pl (-1 / +1 lines)
Lines 239-245 foreach my $itemtype ( keys %{$itemtypes} ) { Link Here
239
my $itype_or_itemtype = (C4::Context->preference("item-level_itypes"))?'itype':'itemtype';
239
my $itype_or_itemtype = (C4::Context->preference("item-level_itypes"))?'itype':'itemtype';
240
my @advancedsearchesloop;
240
my @advancedsearchesloop;
241
my $cnt;
241
my $cnt;
242
my $advanced_search_types = C4::Context->preference("AdvancedSearchTypes") || "itemtypes";
242
my $advanced_search_types = C4::Context->preference("OpacAdvancedSearchTypes") || "itemtypes";
243
my @advanced_search_types = split(/\|/, $advanced_search_types);
243
my @advanced_search_types = split(/\|/, $advanced_search_types);
244
244
245
my $hidingrules = C4::Context->yaml_preference('OpacHiddenItems') // {};
245
my $hidingrules = C4::Context->yaml_preference('OpacHiddenItems') // {};
(-)a/opac/opac-topissues.pl (-2 / +1 lines)
Lines 64-70 if (!$do_it && C4::Context->userenv && C4::Context->userenv->{'branch'} ) { Link Here
64
}
64
}
65
my $itemtype = $input->param('itemtype') || '';
65
my $itemtype = $input->param('itemtype') || '';
66
my $timeLimit = $input->param('timeLimit') || 3;
66
my $timeLimit = $input->param('timeLimit') || 3;
67
my $advanced_search_types = C4::Context->preference('AdvancedSearchTypes');
67
my $advanced_search_types = C4::Context->preference('OpacAdvancedSearchTypes');
68
my @advanced_search_types = split /\|/, $advanced_search_types;
68
my @advanced_search_types = split /\|/, $advanced_search_types;
69
69
70
my $params = {
70
my $params = {
71
- 

Return to bug 17018