--- /dev/null
+INSERT IGNORE INTO `systempreferences` (`variable`, `value`, `options`, `explanation`, `type`) VALUES('OpacNewsLibrarySelect', '0', '', 'Show selector for branches on OPAC news page', 'YesNo');
('OAI-PMH:MaxCount','50',NULL,'OAI-PMH maximum number of records by answer to ListRecords and ListIdentifiers queries','Integer'),
('OCLCAffiliateID','','','Use with FRBRizeEditions and XISBN. You can sign up for an AffiliateID here: http://www.worldcat.org/wcpa/do/AffiliateUserServices?method=initSelfRegister','free'),
('OPACAcquisitionDetails','0','','Show the acquisition details at the OPAC','YesNo'),
+('OpacNewsLibrarySelect','0','','Show selector for branches on OPAC news page','YesNo'),
('OpacAddMastheadLibraryPulldown','0','','Adds a pulldown menu to select the library to search on the opac masthead.','YesNo'),
('OpacAdvSearchMoreOptions','pubdate,itemtype,language,subtype,sorting,location','Show search options for the expanded view (More options)','pubdate|itemtype|language|subtype|sorting|location','multiple'),
('OpacAdvSearchOptions','pubdate,itemtype,language,sorting,location','Show search options','pubdate|itemtype|language|subtype|sorting|location','multiple'),
no: Don't display
- the acquisition details on OPAC detail pages.
-
+ - pref: OpacNewsLibrarySelect
+ default: 0
+ choices:
+ yes: Display
+ no: Don't display
+ - a branch selection list for news items in the OPAC.
+ Policy:
+ -
- "Use the following as the OPAC ISBD template:"
- pref: OPACISBD
type: textarea
<script type="text/javascript" src="[% interface %]/[% theme %]/js/googleindictransliteration.js"></script>
[% END %]
+[% IF Koha.Preference( 'OpacNewsLibrarySelect' ) %]
+<script type="text/javascript">
+ $("#news-branch-select").change(function() {
+ $( "#news-branch-select" ).submit();
+ });
+</script>
+[% END %]
+
<script type="text/javascript" src="[% interface %]/[% theme %]/lib/jquery/plugins/jquery.cookie.min.js"></script>
<script type="text/javascript">
$(document).ready(function() {
[% ELSE %]
<div class="span9">
[% END %]
+ [% IF Koha.Preference( 'OpacNewsLibrarySelect' ) %]
+ <form id="news-branch-select" class="form-inline" name="news-branch-select" method="get" action="/cgi-bin/koha/opac-main.pl">
+ <label for="news-branch">Display news for: </label>
+ <select id="news-branch" name="branch">
+ [% IF ( branchcode == "" ) %]
+ <option value="" selected="selected">system-wide only</option>
+ [% ELSE %]
+ <option value="" >system-wide only</option>
+ [% END %]
+ [% PROCESS options_for_libraries libraries => Branches.all( selected => branchcode, unfiltered => 1, ) %]
+ </select>
+ </form>
+ [% END %]
[% IF ( koha_news_count ) %]
+
<div id="news" class="newscontainer">
[% SET newsdisp = ( Koha.Preference('NewsAuthorDisplay') ) %]
[% FOREACH koha_new IN koha_news %]
<a href="[% OPACBaseURL %]/cgi-bin/koha/opac-news-rss.pl?branchcode=[% branchcode %]"><img src="[% interface %]/[% theme %]/images/feed-icon-16x16.png"></a>
RSS feed for [% IF ( branchcode ) %][% Branches.GetName( branchcode ) %] <i>and</i> [% END %] system-wide library news.
</div>
- [% END %]
+ [% ELSE %]
+ [% IF Koha.Preference( 'OpacNewsLibrarySelect' ) %]
+ <div id="news" class="newscontainer">
+ <div class="newsitem">
+ <div class="newsbody">No news to display.</div>
+ <div class="newsfooter"></div>
+ </div>
+ </div>
+ [% END %]
+ [% END %]
[% IF ( display_daily_quote && daily_quote ) %]
<div id="daily-quote">
if (defined $input->param('branch') and length $input->param('branch')) {
$homebranch = $input->param('branch');
}
+if (C4::Context->userenv and defined $input->param('branch') and length $input->param('branch') == 0 ){
+ $homebranch = "";
+}
my $all_koha_news = &GetNewsToDisplay($news_lang,$homebranch);
my $koha_news_count = scalar @$all_koha_news;