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

(-)a/installer/data/mysql/atomicupdate/add_opacnewsbranchselect_syspref.sql (+1 lines)
Line 0 Link Here
1
INSERT IGNORE INTO `systempreferences` (`variable`, `value`, `options`, `explanation`, `type`) VALUES('OPACNewsLibrarySelect', '0', '', 'Show selector for branches on OPAC news page', 'YesNo');
(-)a/installer/data/mysql/sysprefs.sql (+1 lines)
Lines 286-291 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
286
('OAI-PMH:MaxCount','50',NULL,'OAI-PMH maximum number of records by answer to ListRecords and ListIdentifiers queries','Integer'),
286
('OAI-PMH:MaxCount','50',NULL,'OAI-PMH maximum number of records by answer to ListRecords and ListIdentifiers queries','Integer'),
287
('OCLCAffiliateID','','','Use with FRBRizeEditions and XISBN. You can sign up for an AffiliateID here: http://www.worldcat.org/wcpa/do/AffiliateUserServices?method=initSelfRegister','free'),
287
('OCLCAffiliateID','','','Use with FRBRizeEditions and XISBN. You can sign up for an AffiliateID here: http://www.worldcat.org/wcpa/do/AffiliateUserServices?method=initSelfRegister','free'),
288
('OPACAcquisitionDetails','0','','Show the acquisition details at the OPAC','YesNo'),
288
('OPACAcquisitionDetails','0','','Show the acquisition details at the OPAC','YesNo'),
289
('OPACNewsLibrarySelect','0','','Show selector for branches on OPAC news page','YesNo'),
289
('OpacAddMastheadLibraryPulldown','0','','Adds a pulldown menu to select the library to search on the opac masthead.','YesNo'),
290
('OpacAddMastheadLibraryPulldown','0','','Adds a pulldown menu to select the library to search on the opac masthead.','YesNo'),
290
('OpacAdvSearchMoreOptions','pubdate,itemtype,language,subtype,sorting,location','Show search options for the expanded view (More options)','pubdate|itemtype|language|subtype|sorting|location','multiple'),
291
('OpacAdvSearchMoreOptions','pubdate,itemtype,language,subtype,sorting,location','Show search options for the expanded view (More options)','pubdate|itemtype|language|subtype|sorting|location','multiple'),
291
('OpacAdvSearchOptions','pubdate,itemtype,language,sorting,location','Show search options','pubdate|itemtype|language|subtype|sorting|location','multiple'),
292
('OpacAdvSearchOptions','pubdate,itemtype,language,sorting,location','Show search options','pubdate|itemtype|language|subtype|sorting|location','multiple'),
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref (+8 lines)
Lines 503-508 OPAC: Link Here
503
                  no: Don't display
503
                  no: Don't display
504
            - the acquisition details on OPAC detail pages.
504
            - the acquisition details on OPAC detail pages.
505
        -
505
        -
506
            - pref: OPACNewsLibrarySelect
507
              default: 0
508
              choices:
509
                  yes: Display
510
                  no: Don't display
511
            - a branch selection list for news items in the OPAC.
512
    Policy:
513
        -
506
            - "Use the following as the OPAC ISBD template:"
514
            - "Use the following as the OPAC ISBD template:"
507
            - pref: OPACISBD
515
            - pref: OPACISBD
508
              type: textarea
516
              type: textarea
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/includes/opac-bottom.inc (+8 lines)
Lines 267-272 $.widget.bridge('uitooltip', $.ui.tooltip); Link Here
267
    </script>
267
    </script>
268
[% END #  / IF persona %]
268
[% END #  / IF persona %]
269
269
270
[% IF Koha.Preference( 'OpacNewsLibrarySelect' ) %]
271
<script type="text/javascript">
272
    $("#news-branch-select").change(function() {
273
        $( "#news-branch-select" ).submit();
274
    });
275
</script>
276
[% END %]
277
270
<script type="text/javascript" src="[% interface %]/[% theme %]/lib/jquery/plugins/jquery.cookie.min.js"></script>
278
<script type="text/javascript" src="[% interface %]/[% theme %]/lib/jquery/plugins/jquery.cookie.min.js"></script>
271
<script type="text/javascript">
279
<script type="text/javascript">
272
$(document).ready(function() {
280
$(document).ready(function() {
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-main.tt (-2 / +25 lines)
Lines 37-44 Link Here
37
    [% ELSE %]
37
    [% ELSE %]
38
        <div class="span9">
38
        <div class="span9">
39
    [% END %]
39
    [% END %]
40
            [% IF Koha.Preference( 'OpacNewsLibrarySelect' ) %]
41
                <form id="news-branch-select" class="form-inline" name="news-branch-select" method="get" action="/cgi-bin/koha/opac-main.pl">
42
                <select id="news-branch" name="branch">
43
                [% IF ( branchcode == "" ) %]
44
                <option value="" selected="selected">All libraries</option>
45
                [% ELSE %]
46
                <option value=""         >All libraries</option>
47
                [% END %]
48
                [% PROCESS options_for_libraries libraries => Branches.all( selected => branchcode, unfiltered => 1, ) %]
49
                </select>
50
                <button id="news-branch-submit" class="btn btn-link" type="submit">Change library</button>
51
                </form>
52
            [% END %]
40
53
41
        [% IF ( koha_news_count ) %]
54
        [% IF ( koha_news_count ) %]
55
42
            <div id="news" class="newscontainer">
56
            <div id="news" class="newscontainer">
43
                [% SET newsdisp = ( Koha.Preference('NewsAuthorDisplay') ) %]
57
                [% SET newsdisp = ( Koha.Preference('NewsAuthorDisplay') ) %]
44
                [% FOREACH koha_new IN koha_news %]
58
                [% FOREACH koha_new IN koha_news %]
Lines 54-60 Link Here
54
                <a href="[% OPACBaseURL %]/cgi-bin/koha/opac-news-rss.pl?branchcode=[% branchcode %]"><img src="[% interface %]/[% theme %]/images/feed-icon-16x16.png"></a>
68
                <a href="[% OPACBaseURL %]/cgi-bin/koha/opac-news-rss.pl?branchcode=[% branchcode %]"><img src="[% interface %]/[% theme %]/images/feed-icon-16x16.png"></a>
55
                RSS feed for [% IF ( branchcode ) %][% Branches.GetName( branchcode ) %] <i>and</i> [% END %] system-wide library news.
69
                RSS feed for [% IF ( branchcode ) %][% Branches.GetName( branchcode ) %] <i>and</i> [% END %] system-wide library news.
56
            </div>
70
            </div>
57
        [% END %]
71
            [% ELSE %]
72
                [% IF Koha.Preference( 'OpacNewsLibrarySelect' ) %]
73
                    <div id="news" class="newscontainer">
74
                        <div class="newsitem">
75
                            <div class="newsbody">No news to display.</div>
76
                            <div class="newsfooter"></div>
77
                        </div>
78
                    </div>
79
                [% END %]
80
            [% END %]
58
81
59
        [% IF ( display_daily_quote && daily_quote ) %]
82
        [% IF ( display_daily_quote && daily_quote ) %]
60
            <div id="daily-quote">
83
            <div id="daily-quote">
Lines 116-119 Link Here
116
</div> <!-- /.main -->
139
</div> <!-- /.main -->
117
140
118
[% INCLUDE 'opac-bottom.inc' %]
141
[% INCLUDE 'opac-bottom.inc' %]
119
[% BLOCK jsinclude %][% END %]
142
[% BLOCK jsinclude %][% END %] 
(-)a/opac/opac-main.pl (-1 / +3 lines)
Lines 54-59 if (C4::Context->userenv) { Link Here
54
if (defined $input->param('branch') and length $input->param('branch')) {
54
if (defined $input->param('branch') and length $input->param('branch')) {
55
    $homebranch = $input->param('branch');
55
    $homebranch = $input->param('branch');
56
}
56
}
57
if (C4::Context->userenv and defined $input->param('branch') and length $input->param('branch') == 0 ){
58
   $homebranch = "";
59
}
57
my $all_koha_news   = &GetNewsToDisplay($news_lang,$homebranch);
60
my $all_koha_news   = &GetNewsToDisplay($news_lang,$homebranch);
58
my $koha_news_count = scalar @$all_koha_news;
61
my $koha_news_count = scalar @$all_koha_news;
59
62
60
- 

Return to bug 14764