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

(-)a/installer/data/mysql/atomicupdate/bug_25314_add_OPACFacetsCollapseByDefault_syspref.perl (+6 lines)
Line 0 Link Here
1
$DBversion = 'XXX'; # will be replaced by the RM
2
if( CheckVersion( $DBversion ) ) {
3
    $dbh->do( "INSERT IGNORE INTO systempreferences (variable,value,explanation,options,type) VALUES('OPACFacetCollapseByDefault','0', 'Collapse/expand OPAC facets','','YesNO')" );
4
5
    NewVersion( $DBversion, 25314, "Adds OPACFacetCollapseByDefault system preference");	
6
}
(-)a/installer/data/mysql/sysprefs.sql (+1 lines)
Lines 320-325 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
320
('maxItemsInSearchResults','20',NULL,'Specify the maximum number of items to display for each result on a page of results','free'),
320
('maxItemsInSearchResults','20',NULL,'Specify the maximum number of items to display for each result on a page of results','free'),
321
('MaxOpenSuggestions','',NULL,'Limit the number of open suggestions a patron can have at once','Integer'),
321
('MaxOpenSuggestions','',NULL,'Limit the number of open suggestions a patron can have at once','Integer'),
322
('maxoutstanding','5','','maximum amount withstanding to be able make holds','Integer'),
322
('maxoutstanding','5','','maximum amount withstanding to be able make holds','Integer'),
323
('OPACFacetsCollapseByDefault','0','','Collapse/expand OPAC facets','YesNo'),
323
('OPACFineNoRenewalsBlockAutoRenew','0','','Block/Allow auto renewals if the patron owe more than OPACFineNoRenewals','YesNo'),
324
('OPACFineNoRenewalsBlockAutoRenew','0','','Block/Allow auto renewals if the patron owe more than OPACFineNoRenewals','YesNo'),
324
('maxRecordsForFacets','20',NULL,NULL,'Integer'),
325
('maxRecordsForFacets','20',NULL,NULL,'Integer'),
325
('maxreserves','50','','Define maximum number of holds a patron can place','Integer'),
326
('maxreserves','50','','Define maximum number of holds a patron can place','Integer'),
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref (+16 lines)
Lines 402-407 OPAC: Link Here
402
                  no: "Don't enable"
402
                  no: "Don't enable"
403
            - the option to show a QR Code on the OPAC bibliographic detail page.
403
            - the option to show a QR Code on the OPAC bibliographic detail page.
404
        -
404
        -
405
            - "Define OPAC facets that should collapse by default"
406
            - pref: OPACFacetsCollapseByDefault
407
              multiple:
408
                authors: Authors
409
                collections: Collections
410
                holding-libraries: Holding libraries
411
                home-libraries: Home libraries
412
                itemtypes: Itemtypes
413
                languages: Languages
414
                location: Locations
415
                series: Series
416
                places: Places
417
                topics: Topics
418
                titles: Titles
419
            - "<br />Note: if none of the above options are selected all facets will expand by default"
420
        -
405
            - pref: OPACFinesTab
421
            - pref: OPACFinesTab
406
              choices:
422
              choices:
407
                  yes: Allow
423
                  yes: Allow
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/includes/opac-facets.inc (-1 lines)
Lines 17-23 Link Here
17
                </ul>
17
                </ul>
18
                [% IF ( related ) %] <li>(related searches: [% FOREACH relate IN related %][% relate.related_search | html %][% END %])</li>[% END %]
18
                [% IF ( related ) %] <li>(related searches: [% FOREACH relate IN related %][% relate.related_search | html %][% END %])</li>[% END %]
19
            </li>
19
            </li>
20
21
            [% FOREACH facets_loo IN facets_loop %]
20
            [% FOREACH facets_loo IN facets_loop %]
22
                [% IF facets_loo.facets.size > 0 %]
21
                [% IF facets_loo.facets.size > 0 %]
23
                    <li id="[% facets_loo.type_id | html %]">
22
                    <li id="[% facets_loo.type_id | html %]">
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-results.tt (-3 / +12 lines)
Lines 1016-1027 $("input.newtag").on('keydown', function(e){ Link Here
1016
    });
1016
    });
1017
1017
1018
});
1018
});
1019
$('.toggle-facet').click( function() {
1019
1020
[% IF ( Koha.Preference('OPACFacetsCollapseByDefault') ) %]
1021
[% SET OPACFacetsCollapsed = Koha.Preference('OPACFacetsCollapseByDefault') %]
1022
    var OPACFacetsToCollapse = "[% OPACFacetsCollapsed %]";
1023
    var OPACFacetsToCollapeArray = OPACFacetsToCollapse.split(",");
1024
    OPACFacetsToCollapeArray.forEach(function(arr){
1025
            $('#facet-'+arr).siblings('.collapsible-list').toggle();
1026
            $('#facet-'+arr).toggleClass('facets-list-expanded');
1027
    })
1028
[% END %]
1029
$('.toggle-facet').click( function(){
1020
    $(this).siblings('.collapsible-list').toggle();
1030
    $(this).siblings('.collapsible-list').toggle();
1021
    $(this).toggleClass('facet-list-expanded');
1031
    $(this).toggleClass('facet-list-expanded');
1022
    $(this).attr('aria-expanded' , function(index, attr) {
1032
    $(this).attr('aria-expanded' , function(index, attr) {
1023
        return attr == 'true' ? false : true;
1033
        return attr == 'true' ? false : true;
1024
    })
1034
    })
1025
})
1035
});
1026
</script>
1036
</script>
1027
[% END %]
1037
[% END %]
1028
- 

Return to bug 25314