Bugzilla – Attachment 23475 Details for
Bug 7567
News by Library: refactor, enhance, and fix
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 7567 - News by Branch
Bug-7567---News-by-Branch.patch (text/plain), 85.93 KB, created by
Mark Tompsett
on 2013-12-12 06:07:23 UTC
(
hide
)
Description:
Bug 7567 - News by Branch
Filename:
MIME Type:
Creator:
Mark Tompsett
Created:
2013-12-12 06:07:23 UTC
Size:
85.93 KB
patch
obsolete
>From d66b5c3d1817dd93fc61654e7afa3756cfa5259f Mon Sep 17 00:00:00 2001 >From: Mark Tompsett <mtompset@hotmail.com> >Date: Wed, 6 Nov 2013 23:11:41 -0500 >Subject: [PATCH] Bug 7567 - News by Branch > >By selecting a particular branch, news specific to a branch >can be showed once the user logs into the opac (or the staff) >client. > >This includes adding a NULL default branchcode field >to the opac_news table. > >When a user is logged in they receive both NULL and their branch >news. When no user is logged in, they only receive NULL news. >NULL means all branches. > >C4::NewsChannels problems that were raised by Katrin Fischer >have been corrected by modifying the template file, and >removing the hardcoded strings. > >I have revised all the sample_news.sql files, including adding >setting utf8, disabling and reenabling the foreign keys, and >removing explicit references to the idnew field. The idnew field >is autogenerated. This allowed me to source all the sql files and >get all of them added into my MySQL DB. > >And as per Katrin Fischer's suggestion, I added AFTER into the >ALTER command, so that the fresh install and update install should >generate identical field orders. > >REVISED TEST PLAN >----------------- > 1) Do a fresh install, to ensure that branchcode is created as a field > in the opac_news table. > - Did you try for something non-English? > 2) Do an upgrade to confirm that the branchcode field is added > to the opac_news table. > 3) prove -v t/db_dependent/NewsChannels.t > This should test all the changes in C4::NewsChannels functions. > 4) Log into the staff client > - Does the News display on the main page bust? > 5) Add a new dummy branch (so it has no items or borrowers) > 6) Go to Tools->News > - Are the locations properly display? > 7) Add a News item, for 'All' interfaces for 'All Branches'. > 8) Add a News item, for 'Librarian interface' interfaces for > the dummy branch. > 9) Add a News item, for 'Slip' interfaces at your user branch. >10) Add a News item, for 'OPAC' interface at your user branch. >11) Change the Location and Branch filters. > - Do they show what you select after you click the Filter button? > (Unpatched the Location does not!) > - Are the items displayed matching what is selected? > - Are the drop downs containing the expected values? > (All, Librarian Interface, Slip, > and OPAC (<lang> -- for each <lang> installed) > (All Branches, and every branch listed) >12) Click 'Edit' for one of the news items added. > - Does what comes up match what was displayed? > ( Unpatched the Location may be 'All' ) > - Are the drop downs containing the expected values? > (All, Librarian Interface, Slip, > and OPAC (<lang> -- for each <lang> installed) > (All Branches, and every branch listed) > - Does the submitted values match the changes made? >13) Find a patron to print a slip for. Print Slip. > - Does both the 'All' and 'Slip' news show up on the print slip? >14) In a new tab, go to OPAC > - Does the News display on the main page bust? > - Does it display the news item for a specific branch? > (It shouldn't when patched, but unpatched it would) > (Only one of the new things added should be displayed) >15) Log in as yourself on OPAC. > - Does that piece of News display now too? > (Both things added should be displayed) >16) In the staff client, delete the dummy branch. > - Does the 'Librarian interface' news item exist any more? > It shouldn't. >17) Check the news items added and click the delete button in the > staff client. > - Did it delete them appropriately? >--- > C4/Members.pm | 2 +- > C4/NewsChannels.pm | 167 +++++++++++++------- > .../data/mysql/de-DE/optional/sample_news.sql | 8 +- > installer/data/mysql/en/optional/sample_news.sql | 11 +- > .../data/mysql/es-ES/optional/sample_news.sql | 8 +- > .../data/mysql/fr-FR/2-Optionel/sample_news.sql | 6 +- > .../data/mysql/it-IT/necessari/sample_news.sql | 7 +- > installer/data/mysql/kohastructure.sql | 5 +- > .../data/mysql/nb-NO/2-Valgfritt/sample_news.sql | 8 +- > .../data/mysql/pl-PL/optional/sample_news.sql | 8 +- > .../data/mysql/ru-RU/optional/sample_news.sql | 37 ++--- > .../data/mysql/uk-UA/optional/sample_news.sql | 37 +++-- > installer/data/mysql/updatedatabase.pl | 14 ++ > .../prog/en/modules/tools/koha-news.tt | 137 ++++++++++++---- > koha-tmpl/opac-tmpl/prog/en/modules/opac-main.tt | 8 +- > mainpage.pl | 6 +- > opac/opac-main.pl | 11 +- > t/NewsChannels.t | 14 -- > t/db_dependent/NewsChannels.t | 120 ++++++++++++++ > tools/koha-news.pl | 41 ++++- > 20 files changed, 485 insertions(+), 170 deletions(-) > delete mode 100755 t/NewsChannels.t > create mode 100755 t/db_dependent/NewsChannels.t > >diff --git a/C4/Members.pm b/C4/Members.pm >index b04cc64..20d8ed2 100644 >--- a/C4/Members.pm >+++ b/C4/Members.pm >@@ -2425,7 +2425,7 @@ sub IssueSlip { > 'news' => [ map { > $_->{'timestamp'} = $_->{'newdate'}; > { opac_news => $_ } >- } @{ GetNewsToDisplay("slip") } ], >+ } @{ GetNewsToDisplay("slip",$branch) } ], > ); > } > >diff --git a/C4/NewsChannels.pm b/C4/NewsChannels.pm >index 0201729..bcbee58 100644 >--- a/C4/NewsChannels.pm >+++ b/C4/NewsChannels.pm >@@ -1,37 +1,41 @@ > package C4::NewsChannels; > >-# Copyright 2000-2002 Katipo Communications >-# > # This file is part of Koha. > # >-# Koha is free software; you can redistribute it and/or modify it under the >-# terms of the GNU General Public License as published by the Free Software >-# Foundation; either version 2 of the License, or (at your option) any later >-# version. >+# Copyright (C) 2000 Katipo Communications >+# Copyright (C) 2013 Mark Tompsett >+# >+# Koha is free software; you can redistribute it and/or modify it >+# under the terms of the GNU General Public License as published by >+# the Free Software Foundation; either version 3 of the License, or >+# (at your option) any later version. > # >-# Koha is distributed in the hope that it will be useful, but WITHOUT ANY >-# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR >-# A PARTICULAR PURPOSE. See the GNU General Public License for more details. >+# Koha is distributed in the hope that it will be useful, but >+# WITHOUT ANY WARRANTY; without even the implied warranty of >+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the >+# GNU General Public License for more details. > # >-# You should have received a copy of the GNU General Public License along >-# with Koha; if not, write to the Free Software Foundation, Inc., >-# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. >+# You should have received a copy of the GNU General Public License >+# along with Koha; if not, see <http://www.gnu.org/licenses>. > >-use strict; >-use warnings; > >+use Modern::Perl; > use C4::Context; > use C4::Dates qw(format_date); > > use vars qw($VERSION @ISA @EXPORT); > > BEGIN { >- $VERSION = 3.07.00.049; # set the version for version checking >- @ISA = qw(Exporter); >- @EXPORT = qw( >- &GetNewsToDisplay >- &add_opac_new &upd_opac_new &del_opac_new &get_opac_new &get_opac_news >- ); >+ $VERSION = 3.07.00.049; # set the version for version checking >+ @ISA = qw(Exporter); >+ @EXPORT = qw( >+ &add_opac_new >+ &upd_opac_new >+ &del_opac_new >+ &get_opac_new >+ &get_opac_news >+ &GetNewsToDisplay >+ ); > } > > =head1 NAME >@@ -47,30 +51,51 @@ This module provides the functions needed to mange OPAC and intranet news. > =cut > > sub add_opac_new { >- my ($title, $new, $lang, $expirationdate, $timestamp, $number) = @_; >- my $dbh = C4::Context->dbh; >- my $sth = $dbh->prepare("INSERT INTO opac_news (title, new, lang, expirationdate, timestamp, number) VALUES (?,?,?,?,?,?)"); >- $sth->execute($title, $new, $lang, $expirationdate, $timestamp, $number); >- $sth->finish; >- return 1; >+ my ($href_entry) = @_; >+ my $retval=0; >+ >+ if ($href_entry) { >+ my @fields = keys %{$href_entry}; >+ my @values = values %{$href_entry}; >+ my $field_string = join ",",@fields; >+ $field_string = $field_string // q{}; >+ my $values_string = "?," x ($#fields) . "?"; >+ >+ my $dbh = C4::Context->dbh; >+ my $sth = $dbh->prepare("INSERT INTO opac_news ( $field_string ) VALUES ( $values_string );"); >+ $sth->execute(@values); >+ $retval = 1; >+ } >+ return $retval; > } > > sub upd_opac_new { >- my ($idnew, $title, $new, $lang, $expirationdate, $timestamp,$number) = @_; >- my $dbh = C4::Context->dbh; >- my $sth = $dbh->prepare(" >- UPDATE opac_news SET >- title = ?, >- new = ?, >- lang = ?, >- expirationdate = ?, >- timestamp = ?, >- number = ? >- WHERE idnew = ? >- "); >- $sth->execute($title, $new, $lang, $expirationdate, $timestamp,$number,$idnew); >- $sth->finish; >- return 1; >+ my ($href_entry) = @_; >+ my $retval = 0; >+ >+ if ($href_entry) { >+ # take the keys of hash entry and make a list, but... >+ my @fields = keys %{$href_entry}; >+ my @values; >+ $#values = -1; >+ my $field_string = q{}; >+ foreach my $field_name (@fields) { >+ # exclude idnew >+ if ( $field_name ne 'idnew' ) { >+ $field_string = $field_string . "$field_name = ?,"; >+ push @values,$href_entry->{$field_name}; >+ } >+ } >+ # put idnew at the end, so we know which record to update >+ push @values,$href_entry->{'idnew'}; >+ chop $field_string; # remove that excess , >+ >+ my $dbh = C4::Context->dbh; >+ my $sth = $dbh->prepare("UPDATE opac_news SET $field_string WHERE idnew = ?;"); >+ $sth->execute(@values); >+ $retval = 1; >+ } >+ return $retval; > } > > sub del_opac_new { >@@ -79,7 +104,6 @@ sub del_opac_new { > my $dbh = C4::Context->dbh; > my $sth = $dbh->prepare("DELETE FROM opac_news WHERE idnew IN ($ids)"); > $sth->execute(); >- $sth->finish; > return 1; > } else { > return 0; >@@ -89,29 +113,51 @@ sub del_opac_new { > sub get_opac_new { > my ($idnew) = @_; > my $dbh = C4::Context->dbh; >- my $sth = $dbh->prepare("SELECT * FROM opac_news WHERE idnew = ?"); >+ my $query = q{ >+ SELECT opac_news.*,branches.branchname,timestamp AS newdate >+ FROM opac_news LEFT JOIN branches ON opac_news.branchcode=branches.branchcode >+ WHERE opac_news.idnew = ?; >+ }; >+ my $sth = $dbh->prepare($query); > $sth->execute($idnew); > my $data = $sth->fetchrow_hashref; > $data->{$data->{'lang'}} = 1 if defined $data->{lang}; > $data->{expirationdate} = format_date($data->{expirationdate}); > $data->{timestamp} = format_date($data->{timestamp}); >- $sth->finish; > return $data; > } > > sub get_opac_news { >- my ($limit, $lang) = @_; >+ my ($limit, $lang, $branchcode) = @_; >+ my @values; > my $dbh = C4::Context->dbh; >- my $query = "SELECT *, timestamp AS newdate FROM opac_news"; >- if ($lang) { >- $query.= " WHERE lang = '" .$lang ."' "; >+ my $query = q{ >+ SELECT opac_news.*,branches.branchname,timestamp AS newdate >+ FROM opac_news LEFT JOIN branches ON opac_news.branchcode=branches.branchcode >+ }; >+ if ($lang && $branchcode) { >+ $query.= " WHERE (opac_news.lang='' OR opac_news.lang=?)"; >+ $query .= " AND (opac_news.branchcode IS NULL OR opac_news.branchcode=?)"; >+ push @values,$lang; >+ push @values,$branchcode; >+ } >+ elsif ($lang) { >+ $query.= " WHERE (opac_news.lang='' OR opac_news.lang=?)"; >+ push @values,$lang; >+ } >+ elsif ($branchcode) { >+ $query .= " WHERE (opac_news.branchcode IS NULL OR opac_news.branchcode=?)"; >+ push @values,$branchcode; >+ } >+ else { >+ # nothing > } > $query.= " ORDER BY timestamp DESC "; > #if ($limit) { > # $query.= "LIMIT 0, " . $limit; > #} > my $sth = $dbh->prepare($query); >- $sth->execute(); >+ $sth->execute(@values); > my @opac_news; > my $count = 0; > while (my $row = $sth->fetchrow_hashref) { >@@ -127,17 +173,18 @@ sub get_opac_news { > > =head2 GetNewsToDisplay > >- $news = &GetNewsToDisplay($lang); >+ $news = &GetNewsToDisplay($lang,$branch); > C<$news> is a ref to an array which containts >- all news with expirationdate > today or expirationdate is null. >+ all news with expirationdate > today or expirationdate is null >+ that is applicable for a given branch. > > =cut > > sub GetNewsToDisplay { >- my $lang = shift; >+ my ($lang,$branch) = @_; > my $dbh = C4::Context->dbh; > # SELECT *,DATE_FORMAT(timestamp, '%d/%m/%Y') AS newdate >- my $query = " >+ my $query = q{ > SELECT *,timestamp AS newdate > FROM opac_news > WHERE ( >@@ -145,15 +192,19 @@ sub GetNewsToDisplay { > OR expirationdate IS NULL > OR expirationdate = '00-00-0000' > ) >- AND `timestamp` <= CURRENT_DATE() >- AND lang = ? >+ AND `timestamp` < CURRENT_DATE()+1 >+ AND (lang = '' OR lang = ?) >+ AND (branchcode IS NULL OR branchcode = ?) > ORDER BY number >- "; # expirationdate field is NOT in ISO format? >+ }; # expirationdate field is NOT in ISO format? >+ # timestamp has HH:mm:ss, CURRENT_DATE() generates 00:00:00 >+ # by adding 1, that captures today correctly. > my $sth = $dbh->prepare($query); >- $sth->execute($lang); >+ $lang = $lang // ''; >+ $sth->execute($lang,$branch); > my @results; > while ( my $row = $sth->fetchrow_hashref ){ >- $row->{newdate} = format_date($row->{newdate}); >+ $row->{newdate} = format_date($row->{newdate}); > push @results, $row; > } > return \@results; >diff --git a/installer/data/mysql/de-DE/optional/sample_news.sql b/installer/data/mysql/de-DE/optional/sample_news.sql >index e7a2e6e..cc29045 100644 >--- a/installer/data/mysql/de-DE/optional/sample_news.sql >+++ b/installer/data/mysql/de-DE/optional/sample_news.sql >@@ -1,2 +1,6 @@ >-INSERT INTO `opac_news` VALUES (1,'Willkommen bei Koha','Willkommen bei Koha. Koha ist ein vollständiges integriertes Bibliothekssystem. Es wurde ursprünglich in Neuseeland von Katipo Communications Ltd entwickelt und ging im Januar 2000 für den Horowhenua Library Trust zum ersten mal in Produktion. Koha wird heute von einem internationalen Team aus Support-Dienstleistern und Anwendern weiterentwickelt.','koha','2007-10-29 05:25:58','2099-01-10',1), >-(2,'Was kommt jetzt?','Wie geht es weiter, nachdem Sie Koha installiert haben? Hier einige Vorschläge:\r\n<ul>\r\n<li><a href=\"http://koha-community.org/documentation/\">Lesen Sie die Koha-Dokumentation</a></li>\r\n<li><a href=\"http://wiki.koha-community.org\">Lesen oder Schreiben Sie im Koha-Wiki</a></li>\r\n<li><a href=\"http://koha-community.org/support/\">Verfolgen oder beteiligen Sie sich an Diskussionen</a></li>\r\n<li><a href=\"http://bugs.koha-community.org\">Melden Sie Bugs</a></li>\r\n<li><a href=\"http://wiki.koha-community.org/wiki/Version_Control_Using_Git\">Erstellen Sie Fehlerkorrekturen mit GIT (Versionskontrollsystem)</a></li>\r\n<li><a href=\"http://koha-community.org/support/\">Chatten Sie mit Koha-Anwendern und -Entwicklern</a></li>\r\n</ul>\r\n','koha','2007-10-29 05:34:45','2099-01-10',2); >+SET NAMES utf8; >+SET FOREIGN_KEY_CHECKS=0; >+INSERT INTO `opac_news` (`title`, `new`, `lang`, `timestamp`, `expirationdate`, `number`) VALUES >+('Willkommen bei Koha','Willkommen bei Koha. Koha ist ein vollständiges integriertes Bibliothekssystem. Es wurde ursprünglich in Neuseeland von Katipo Communications Ltd entwickelt und ging im Januar 2000 für den Horowhenua Library Trust zum ersten mal in Produktion. Koha wird heute von einem internationalen Team aus Support-Dienstleistern und Anwendern weiterentwickelt.','koha','2007-10-29 05:25:58','2099-01-10',1), >+('Was kommt jetzt?','Wie geht es weiter, nachdem Sie Koha installiert haben? Hier einige Vorschläge:\r\n<ul>\r\n<li><a href=\"http://koha-community.org/documentation/\">Lesen Sie die Koha-Dokumentation</a></li>\r\n<li><a href=\"http://wiki.koha-community.org\">Lesen oder Schreiben Sie im Koha-Wiki</a></li>\r\n<li><a href=\"http://koha-community.org/support/\">Verfolgen oder beteiligen Sie sich an Diskussionen</a></li>\r\n<li><a href=\"http://bugs.koha-community.org\">Melden Sie Bugs</a></li>\r\n<li><a href=\"http://wiki.koha-community.org/wiki/Version_Control_Using_Git\">Erstellen Sie Fehlerkorrekturen mit GIT (Versionskontrollsystem)</a></li>\r\n<li><a href=\"http://koha-community.org/support/\">Chatten Sie mit Koha-Anwendern und -Entwicklern</a></li>\r\n</ul>\r\n','koha','2007-10-29 05:34:45','2099-01-10',2); >+SET FOREIGN_KEY_CHECKS=1; >diff --git a/installer/data/mysql/en/optional/sample_news.sql b/installer/data/mysql/en/optional/sample_news.sql >index 4327f4b..e0c5599 100644 >--- a/installer/data/mysql/en/optional/sample_news.sql >+++ b/installer/data/mysql/en/optional/sample_news.sql >@@ -1,2 +1,9 @@ >-INSERT INTO `opac_news` VALUES (1,'Welcome to Koha','Welcome to Koha. Koha is a full-featured open-source ILS. Developed initially in New Zealand by Katipo Communications Ltd and first deployed in January of 2000 for Horowhenua Library Trust, Koha is currently maintained by a team of software providers and library technology staff from around the globe.','koha','2007-10-29 05:25:58','2099-01-10',1), >-(2,'What\'s Next?','Now that you\'ve installed Koha, what\'s next? Here are some suggestions:\r\n<ul>\r\n<li><a href=\"http://koha-community.org/documentation/\">Read Koha Documentation</a></li>\r\n<li><a href=\"http://wiki.koha-community.org\">Read/Write to the Koha Wiki</a></li>\r\n<li><a href=\"http://koha-community.org/support/\">Read and Contribute to Discussions</a></li>\r\n<li><a href=\"http://bugs.koha-community.org\">Report Koha Bugs</a></li>\r\n<li><a href=\"http://wiki.koha-community.org/wiki/Version_Control_Using_Git\">Submit Patches to Koha using Git (Version Control System)</a></li>\r\n<li><a href=\"http://koha-community.org/support/\">Chat with Koha users and developers</a></li>\r\n</ul>\r\n','koha','2007-10-29 05:34:45','2099-01-10',2); >\ No newline at end of file >+SET NAMES utf8; >+SET FOREIGN_KEY_CHECKS=0; >+INSERT INTO `opac_news` ( title, new, >+ lang, timestamp, expirationdate, number ) >+ VALUES ( 'Welcome to Koha', 'Welcome to Koha. Koha is a full-featured open-source ILS. Developed initially in New Zealand by Katipo Communications Ltd and first deployed in January of 2000 for Horowhenua Library Trust, Koha is currently maintained by a team of software providers and library technology staff from around the globe.', >+ 'koha', '2007-10-29 05:25:58','2099-01-10', 1), >+ ( 'What\'s Next?', 'Now that you\'ve installed Koha, what\'s next? Here are some suggestions:\r\n<ul>\r\n<li><a href=\"http://koha-community.org/documentation/\">Read Koha Documentation</a></li>\r\n<li><a href=\"http://wiki.koha-community.org\">Read/Write to the Koha Wiki</a></li>\r\n<li><a href=\"http://koha-community.org/support/\">Read and Contribute to Discussions</a></li>\r\n<li><a href=\"http://bugs.koha-community.org\">Report Koha Bugs</a></li>\r\n<li><a href=\"http://wiki.koha-community.org/wiki/Version_Control_Using_Git\">Submit Patches to Koha using Git (Version Control System)</a></li>\r\n<li><a href=\"http://koha-community.org/support/\">Chat with Koha users and developers</a></li>\r\n</ul>\r\n', >+ 'koha', '2007-10-29 05:34:45','2099-01-10', 2); >+SET FOREIGN_KEY_CHECKS=1; >diff --git a/installer/data/mysql/es-ES/optional/sample_news.sql b/installer/data/mysql/es-ES/optional/sample_news.sql >index 4327f4b..15352ff 100644 >--- a/installer/data/mysql/es-ES/optional/sample_news.sql >+++ b/installer/data/mysql/es-ES/optional/sample_news.sql >@@ -1,2 +1,6 @@ >-INSERT INTO `opac_news` VALUES (1,'Welcome to Koha','Welcome to Koha. Koha is a full-featured open-source ILS. Developed initially in New Zealand by Katipo Communications Ltd and first deployed in January of 2000 for Horowhenua Library Trust, Koha is currently maintained by a team of software providers and library technology staff from around the globe.','koha','2007-10-29 05:25:58','2099-01-10',1), >-(2,'What\'s Next?','Now that you\'ve installed Koha, what\'s next? Here are some suggestions:\r\n<ul>\r\n<li><a href=\"http://koha-community.org/documentation/\">Read Koha Documentation</a></li>\r\n<li><a href=\"http://wiki.koha-community.org\">Read/Write to the Koha Wiki</a></li>\r\n<li><a href=\"http://koha-community.org/support/\">Read and Contribute to Discussions</a></li>\r\n<li><a href=\"http://bugs.koha-community.org\">Report Koha Bugs</a></li>\r\n<li><a href=\"http://wiki.koha-community.org/wiki/Version_Control_Using_Git\">Submit Patches to Koha using Git (Version Control System)</a></li>\r\n<li><a href=\"http://koha-community.org/support/\">Chat with Koha users and developers</a></li>\r\n</ul>\r\n','koha','2007-10-29 05:34:45','2099-01-10',2); >\ No newline at end of file >+SET NAMES utf8; >+SET FOREIGN_KEY_CHECKS=0; >+INSERT INTO `opac_news` (`title`, `new`, `lang`, `timestamp`, `expirationdate`, `number`) VALUES >+('Welcome to Koha','Welcome to Koha. Koha is a full-featured open-source ILS. Developed initially in New Zealand by Katipo Communications Ltd and first deployed in January of 2000 for Horowhenua Library Trust, Koha is currently maintained by a team of software providers and library technology staff from around the globe.','koha','2007-10-29 05:25:58','2099-01-10',1), >+('What\'s Next?','Now that you\'ve installed Koha, what\'s next? Here are some suggestions:\r\n<ul>\r\n<li><a href=\"http://koha-community.org/documentation/\">Read Koha Documentation</a></li>\r\n<li><a href=\"http://wiki.koha-community.org\">Read/Write to the Koha Wiki</a></li>\r\n<li><a href=\"http://koha-community.org/support/\">Read and Contribute to Discussions</a></li>\r\n<li><a href=\"http://bugs.koha-community.org\">Report Koha Bugs</a></li>\r\n<li><a href=\"http://wiki.koha-community.org/wiki/Version_Control_Using_Git\">Submit Patches to Koha using Git (Version Control System)</a></li>\r\n<li><a href=\"http://koha-community.org/support/\">Chat with Koha users and developers</a></li>\r\n</ul>\r\n','koha','2007-10-29 05:34:45','2099-01-10',2); >+SET FOREIGN_KEY_CHECKS=1; >diff --git a/installer/data/mysql/fr-FR/2-Optionel/sample_news.sql b/installer/data/mysql/fr-FR/2-Optionel/sample_news.sql >index 888a17a..d93a5e4 100644 >--- a/installer/data/mysql/fr-FR/2-Optionel/sample_news.sql >+++ b/installer/data/mysql/fr-FR/2-Optionel/sample_news.sql >@@ -1,2 +1,6 @@ > SET NAMES utf8; >-INSERT INTO `opac_news` VALUES (1,'Bienvenue dans Koha !','Bienvenue dans Koha 3, la toute nouvelle version du système intégré de gestion de bibliothèque (SIGB) open source de référence. Développé initialement en Nouvelle Zélande et déployé pour la première fois en janvier 2000, Koha est un projet international soutenu par des sociétés de services en logiciels libres et par des bibliothécaires du monde entier.','koha','2008-01-14 03:25:58','2099-01-10',1),(2,'Et maintenant ?','Félicitations ! vous avez désormais une version opérationnelle de Koha. Et maintenant, que faire ?\r\n<ul>\r\n<li><a href=\"http://koha-community.org/documentation/\">lisez la documentation de Koha ;</a></li>\r\n<li><a href=\"http://wiki.koha-community.org\">lisez et participez au Wiki de Koha ;</a></li>\r\n<li><a href=\"http://koha-community.org/support/\">abonnez-vous aux listes de discussion ;</a></li>\r\n<li><a href=\"http://bugs.koha-community.org\">signalez des bugs ;</a></li>\r\n<li><a href=\"http://wiki.koha-community.org/doku.php?id=en:development:git_usage\">proposez des correctifs et des améliorations ;</a></li>\r\n<li><a href=\"http://koha-community.org/support/\">discutez avec les utilisateurs et les développeurs de Koha.</a></li>\r\n</ul>\r\n','koha','2008-01-14 03:34:45','2099-01-10',2); >+SET FOREIGN_KEY_CHECKS=0; >+INSERT INTO `opac_news` (`title`, `new`, `lang`, `timestamp`, `expirationdate`, `number`) VALUES >+('Bienvenue dans Koha !','Bienvenue dans Koha 3, la toute nouvelle version du système intégré de gestion de bibliothèque (SIGB) open source de référence. Développé initialement en Nouvelle Zélande et déployé pour la première fois en janvier 2000, Koha est un projet international soutenu par des sociétés de services en logiciels libres et par des bibliothécaires du monde entier.','koha','2008-01-14 03:25:58','2099-01-10',1), >+('Et maintenant ?','Félicitations ! vous avez désormais une version opérationnelle de Koha. Et maintenant, que faire ?\r\n<ul>\r\n<li><a href=\"http://koha-community.org/documentation/\">lisez la documentation de Koha ;</a></li>\r\n<li><a href=\"http://wiki.koha-community.org\">lisez et participez au Wiki de Koha ;</a></li>\r\n<li><a href=\"http://koha-community.org/support/\">abonnez-vous aux listes de discussion ;</a></li>\r\n<li><a href=\"http://bugs.koha-community.org\">signalez des bugs ;</a></li>\r\n<li><a href=\"http://wiki.koha-community.org/doku.php?id=en:development:git_usage\">proposez des correctifs et des améliorations ;</a></li>\r\n<li><a href=\"http://koha-community.org/support/\">discutez avec les utilisateurs et les développeurs de Koha.</a></li>\r\n</ul>\r\n','koha','2008-01-14 03:34:45','2099-01-10',2); >+SET FOREIGN_KEY_CHECKS=1; >diff --git a/installer/data/mysql/it-IT/necessari/sample_news.sql b/installer/data/mysql/it-IT/necessari/sample_news.sql >index 30cb64e..fe40eba 100644 >--- a/installer/data/mysql/it-IT/necessari/sample_news.sql >+++ b/installer/data/mysql/it-IT/necessari/sample_news.sql >@@ -13,10 +13,11 @@ > -- > -- Dump dei dati per la tabella 'opac_news' > -- >+SET NAMES utf8; > SET FOREIGN_KEY_CHECKS=0; > >-INSERT INTO opac_news (idnew, title, new, lang, timestamp, expirationdate, number) VALUES >-(1, 'Benvenuto in Koha', '<p>Koha è un gestionale di biblioteca (ILS) completo e Open Source. Sviluppato inzialmente in New Zealand da Katipo Communications Ltd e messo in linea per la prima volta nel gennaio 2000 per il Horowhenua Library Trust, Koha è ora mantenuto da un gruppo di aziende di servizi e dipendenti di biblioteca distribuiti in tutto il mondo.</p>', 'koha', '2007-10-29 00:00:00', '2099-01-10', 1), >-(2, 'Cosa c''è di nuovo ?', '<p>Ora che hai installato cosa, qual''è il passo successivo ? Qui alcuni suggerimenti:</p>\r\n<ul>\r\n<li><a href="http://koha-community.org/documentation/">Leggi la documentazione di Koha</a></li>\r\n<li><a href="http://wiki.koha-community.org">Leggi/aggiorna il Wiki di Koha Wiki</a></li>\r\n<li><a href="http://koha-commaunity.org/support/koha-mailing-lists/">Leggi e contribusci alle liste di discussione</a></li>\r\n<li><a href="http://bugs.koha-community.org">Descrivi e segnala i bug di Koha</a></li>\r\n<li>Chatta con gli utenti e gli sviluppatori di Koha sul server irc.katipo.co.nz, porta 6667 canale #koha</li>\r\n<li><a href="http://stats.workbuffer.org/irclog/koha/today">Leggi il log della chat di Koha di oggi</a></li>\r\n</ul>\r\n', 'koha', '2007-10-29 00:00:00', '2099-01-10', 2); >+INSERT INTO opac_news (title, new, lang, timestamp, expirationdate, number) VALUES >+('Benvenuto in Koha', '<p>Koha è un gestionale di biblioteca (ILS) completo e Open Source. Sviluppato inzialmente in New Zealand da Katipo Communications Ltd e messo in linea per la prima volta nel gennaio 2000 per il Horowhenua Library Trust, Koha è ora mantenuto da un gruppo di aziende di servizi e dipendenti di biblioteca distribuiti in tutto il mondo.</p>', 'koha', '2007-10-29 00:00:00', '2099-01-10', 1), >+('Cosa c''è di nuovo ?', '<p>Ora che hai installato cosa, qual''è il passo successivo ? Qui alcuni suggerimenti:</p>\r\n<ul>\r\n<li><a href="http://koha-community.org/documentation/">Leggi la documentazione di Koha</a></li>\r\n<li><a href="http://wiki.koha-community.org">Leggi/aggiorna il Wiki di Koha Wiki</a></li>\r\n<li><a href="http://koha-commaunity.org/support/koha-mailing-lists/">Leggi e contribusci alle liste di discussione</a></li>\r\n<li><a href="http://bugs.koha-community.org">Descrivi e segnala i bug di Koha</a></li>\r\n<li>Chatta con gli utenti e gli sviluppatori di Koha sul server irc.katipo.co.nz, porta 6667 canale #koha</li>\r\n<li><a href="http://stats.workbuffer.org/irclog/koha/today">Leggi il log della chat di Koha di oggi</a></li>\r\n</ul>\r\n', 'koha', '2007-10-29 00:00:00', '2099-01-10', 2); > > SET FOREIGN_KEY_CHECKS=1; >diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql >index 07160c8..240afea 100644 >--- a/installer/data/mysql/kohastructure.sql >+++ b/installer/data/mysql/kohastructure.sql >@@ -1636,13 +1636,16 @@ CREATE TABLE `old_reserves` ( -- this table holds all holds/reserves that have b > DROP TABLE IF EXISTS `opac_news`; > CREATE TABLE `opac_news` ( -- data from the news tool > `idnew` int(10) unsigned NOT NULL auto_increment, -- unique identifier for the news article >+ `branchcode` varchar(10) NULL default NULL, -- branch code used to create branch specific news, NULL is every branch. > `title` varchar(250) NOT NULL default '', -- title of the news article > `new` text NOT NULL, -- the body of your news article > `lang` varchar(25) NOT NULL default '', -- location for the article (koha is the staff client, slip is the circulation receipt and language codes are for the opac) > `timestamp` timestamp NOT NULL default CURRENT_TIMESTAMP, -- pulibcation date and time > `expirationdate` date default NULL, -- date the article is set to expire or no longer be visible > `number` int(11) default NULL, -- the order in which this article appears in that specific location >- PRIMARY KEY (`idnew`) >+ PRIMARY KEY (`idnew`), >+ CONSTRAINT opac_news_branchcode_ibfk FOREIGN KEY (branchcode) REFERENCES branches (branchcode) >+ ON DELETE CASCADE ON UPDATE CASCADE > ) ENGINE=InnoDB DEFAULT CHARSET=utf8; > > -- >diff --git a/installer/data/mysql/nb-NO/2-Valgfritt/sample_news.sql b/installer/data/mysql/nb-NO/2-Valgfritt/sample_news.sql >index 735db1b..9d6c60e 100644 >--- a/installer/data/mysql/nb-NO/2-Valgfritt/sample_news.sql >+++ b/installer/data/mysql/nb-NO/2-Valgfritt/sample_news.sql >@@ -1,2 +1,6 @@ >-INSERT INTO `opac_news` VALUES (1,'Velkommen til Koha!','Velkommen til Koha. Koha er et biblioteksystem rikt pÃ¥ funksjoner. Koha ble opprinnelig utviklet i New Zealand av Katipo Communications Ltd og først tatt i bruk i januar 2000 av Horowhenua Library Trust. I dag vedlikeholdes Koha av et verdensomspennende fellesskap av bibliotek og leverandører.','koha',DATE_SUB(NOW(), INTERVAL 1 DAY),'2099-01-10',1), >-(2,'Hva nÃ¥?','Hva kan du gjøre nÃ¥ som du har installert Koha? Her er noen forslag:\r\n<ul>\r\n<li><a href=\"http://koha-community.org/documentation/\">Les dokumentasjon</a></li>\r\n<li><a href=\"http://wiki.koha-community.org\">Les eller bidra til Koha sin wiki</a></li>\r\n<li><a href=\"http://koha-community.org/get-involved/\">Les og delta i diskusjoner</a></li>\r\n<li><a href=\"http://bugs.koha-community.org\">Meld fra om feil og mangler</a></li>\r\n<li><a href=\"http://wiki.koha-community.org/wiki/Version_Control_Using_Git\">Send inn feilrettinger med Git (versjonskontrollsystem)</a></li>\r\n<li><a href=\"http://koha-community.org/get-involved/irc/\">Chat med Koha-brukere og -utviklere</a></li>\r\n</ul>\r\n','koha',DATE_SUB(NOW(), INTERVAL 1 DAY),'2099-01-10',2); >\ No newline at end of file >+SET NAMES utf8; >+SET FOREIGN_KEY_CHECKS=0; >+INSERT INTO `opac_news` (`title`, `new`, `lang`, `timestamp`, `expirationdate`, `number`) VALUES >+('Velkommen til Koha!','Velkommen til Koha. Koha er et biblioteksystem rikt pÃ¥ funksjoner. Koha ble opprinnelig utviklet i New Zealand av Katipo Communications Ltd og først tatt i bruk i januar 2000 av Horowhenua Library Trust. I dag vedlikeholdes Koha av et verdensomspennende fellesskap av bibliotek og leverandører.','koha',DATE_SUB(NOW(), INTERVAL 1 DAY),'2099-01-10',1), >+('Hva nÃ¥?','Hva kan du gjøre nÃ¥ som du har installert Koha? Her er noen forslag:\r\n<ul>\r\n<li><a href=\"http://koha-community.org/documentation/\">Les dokumentasjon</a></li>\r\n<li><a href=\"http://wiki.koha-community.org\">Les eller bidra til Koha sin wiki</a></li>\r\n<li><a href=\"http://koha-community.org/get-involved/\">Les og delta i diskusjoner</a></li>\r\n<li><a href=\"http://bugs.koha-community.org\">Meld fra om feil og mangler</a></li>\r\n<li><a href=\"http://wiki.koha-community.org/wiki/Version_Control_Using_Git\">Send inn feilrettinger med Git (versjonskontrollsystem)</a></li>\r\n<li><a href=\"http://koha-community.org/get-involved/irc/\">Chat med Koha-brukere og -utviklere</a></li>\r\n</ul>\r\n','koha',DATE_SUB(NOW(), INTERVAL 1 DAY),'2099-01-10',2); >+SET FOREIGN_KEY_CHECKS=1; >diff --git a/installer/data/mysql/pl-PL/optional/sample_news.sql b/installer/data/mysql/pl-PL/optional/sample_news.sql >index a055b6a..97c6251 100644 >--- a/installer/data/mysql/pl-PL/optional/sample_news.sql >+++ b/installer/data/mysql/pl-PL/optional/sample_news.sql >@@ -1,3 +1,7 @@ >-INSERT INTO `opac_news` VALUES (1,'Witaj w Koha.','Koha to profesjonalny system biblioteczny o otwartym kodzie. Stworzony w Nowej Zelandii przez Katipo Communications Ltd (wdrożony po raz pierwszy w styczniu 2000 r. Horowhenua Library Trust) jest obecnie rozwijany przez grupe programistów i bibliotekarzy z caÅego Åwiata..','koha','2007-10-29 05:25:58','2099-01-10',1), >-(2,'Co dalej?','ZainstalowaÅeÅ Koha - i co dalej? Poniżej znajdziesz kilka wskazówek: >+SET NAMES utf8; >+SET FOREIGN_KEY_CHECKS=0; >+INSERT INTO `opac_news` (`title`, `new`, `lang`, `timestamp`, `expirationdate`, `number`) VALUES >+('Witaj w Koha.','Koha to profesjonalny system biblioteczny o otwartym kodzie. Stworzony w Nowej Zelandii przez Katipo Communications Ltd (wdrożony po raz pierwszy w styczniu 2000 r. Horowhenua Library Trust) jest obecnie rozwijany przez grupe programistów i bibliotekarzy z caÅego Åwiata..','koha','2007-10-29 05:25:58','2099-01-10',1), >+('Co dalej?','ZainstalowaÅeÅ Koha - i co dalej? Poniżej znajdziesz kilka wskazówek: > \r\n<ul>\r\n<li><a href=\"http://koha-community.org/documentation/\">Zapoznaj siÄ z dokumentacjÄ</a></li>\r\n<li><a href=\"http://wiki.koha-community.org\">Czytaj/Edytuj Koha Wiki</a></li>\r\n<li><a href=\"http://koha-community.org/support/\">Weź udziaÅ w dyskusji</a></li>\r\n<li><a href=\"http://bugs.koha-community.org\">ZgÅoÅÄ bÅÄd</a></li>\r\n<li><a href=\"http://wiki.koha-community.org/wiki/Version_Control_Using_Git\">WyÅlij patch przy uzyciu Git (Version Control System)</a></li>\r\n<li><a href=\"http://koha-community.org/support/\">Porozmawiaj z twórcami i użytkownikami Koha</a></li>\r\n</ul>\r\n','koha','2007-10-29 05:34:45','2099-01-10',2); >+SET FOREIGN_KEY_CHECKS=1; >diff --git a/installer/data/mysql/ru-RU/optional/sample_news.sql b/installer/data/mysql/ru-RU/optional/sample_news.sql >index b6907cf..b291251 100644 >--- a/installer/data/mysql/ru-RU/optional/sample_news.sql >+++ b/installer/data/mysql/ru-RU/optional/sample_news.sql >@@ -1,29 +1,30 @@ >-TRUNCATE opac_news; >+SET NAMES utf8; >+SET FOREIGN_KEY_CHECKS=0; >+INSERT INTO `opac_news` (`title`, `new`, `lang`, `timestamp`, `expirationdate`, `number`) VALUES >+('Welcome to Koha','Welcome to Koha. Koha is a full-featured open-source ILS. Developed initially in New Zealand by Katipo Communications Ltd and first deployed in January of 2000 for Horowhenua Library Trust, Koha is currently maintained by a team of software providers and library technology staff from around the globe.','en','2008-05-28 22:45:42','2099-01-10',1); > >-INSERT INTO `opac_news` (`idnew`, `title`, `new`, `lang`, `timestamp`, `expirationdate`, `number`) VALUES >-(1,'Welcome to Koha','Welcome to Koha. Koha is a full-featured open-source ILS. Developed initially in New Zealand by Katipo Communications Ltd and first deployed in January of 2000 for Horowhenua Library Trust, Koha is currently maintained by a team of software providers and library technology staff from around the globe.','en','2008-05-28 22:45:42','2099-01-10',1); >+INSERT INTO `opac_news` (`title`, `new`, `lang`, `timestamp`, `expirationdate`, `number`) VALUES >+('ÐаÑкаво пÑоÑимо до ÐоÑа','ÐаÑкаво пÑоÑимо до ÐоÑа. ÐоÑа Ñ Ð¿Ð¾Ð²Ð½Ð¾ÑÑнкÑÑоналÑÐ½Ð¾Ñ ÐÐÐС з вÑдкÑиÑими джеÑелÑними кодам. РозÑоблена ÑпоÑаÑÐºÑ Ð² ÐовÑй ÐеландÑÑ ÐºÐ¾Ð¼Ð¿Ð°Ð½ÑÑÑ Katipo Communications Ltd Ñ Ð²Ð¿ÐµÑÑе випÑÑена в ÑÑÑÐ½Ñ 2000 ÑÐ¾ÐºÑ Ð´Ð»Ñ Ð±ÑблÑоÑеÑного конÑоÑÑÑÑÐ¼Ñ Ð¥Ð¾ÑоÑнеа. ÐоÑа в даний ÑÐ°Ñ Ð¿ÑдÑÑимÑÑÑÑÑÑ Ð³ÑÑÐ¿Ð¾Ñ Ð¿Ð¾ÑÑаÑалÑникÑв пÑогÑамного забезпеÑÐµÐ½Ð½Ñ Ñ ÑаÑÑвÑÑми з бÑблÑоÑеÑÐ½Ð¸Ñ ÑеÑнологÑй Ð·Ñ Ð²ÑÑÑÑ Ð·ÐµÐ¼Ð½Ð¾Ñ ÐºÑлÑ. ','uk-UA','2008-05-28 22:48:29','2099-01-10',1); > >-INSERT INTO `opac_news` (`idnew`, `title`, `new`, `lang`, `timestamp`, `expirationdate`, `number`) VALUES >-(2,'ÐаÑкаво пÑоÑимо до ÐоÑа','ÐаÑкаво пÑоÑимо до ÐоÑа. ÐоÑа Ñ Ð¿Ð¾Ð²Ð½Ð¾ÑÑнкÑÑоналÑÐ½Ð¾Ñ ÐÐÐС з вÑдкÑиÑими джеÑелÑними кодам. РозÑоблена ÑпоÑаÑÐºÑ Ð² ÐовÑй ÐеландÑÑ ÐºÐ¾Ð¼Ð¿Ð°Ð½ÑÑÑ Katipo Communications Ltd Ñ Ð²Ð¿ÐµÑÑе випÑÑена в ÑÑÑÐ½Ñ 2000 ÑÐ¾ÐºÑ Ð´Ð»Ñ Ð±ÑблÑоÑеÑного конÑоÑÑÑÑÐ¼Ñ Ð¥Ð¾ÑоÑнеа. ÐоÑа в даний ÑÐ°Ñ Ð¿ÑдÑÑимÑÑÑÑÑÑ Ð³ÑÑÐ¿Ð¾Ñ Ð¿Ð¾ÑÑаÑалÑникÑв пÑогÑамного забезпеÑÐµÐ½Ð½Ñ Ñ ÑаÑÑвÑÑми з бÑблÑоÑеÑÐ½Ð¸Ñ ÑеÑнологÑй Ð·Ñ Ð²ÑÑÑÑ Ð·ÐµÐ¼Ð½Ð¾Ñ ÐºÑлÑ. ','uk-UA','2008-05-28 22:48:29','2099-01-10',1); > >+INSERT INTO `opac_news` (`title`, `new`, `lang`, `timestamp`, `expirationdate`, `number`) VALUES >+('ÐобÑо пожаловаÑÑ Ð² ÐоÑа','ÐобÑо пожаловаÑÑ Ð² ÐоÑа. ÐоÑа ÑвлÑеÑÑÑ Ð¿Ð¾Ð»Ð½Ð¾ÑÑнкÑионалÑной ÐÐÐС Ñ Ð¾ÑкÑÑÑÑми иÑÑодниками. РазÑабоÑана пеÑвонаÑалÑно в Ðовой Ðеландии компанией Katipo Communications Ltd и впеÑвÑе вÑпÑÑена в ÑнваÑе 2000 года Ð´Ð»Ñ Ð±Ð¸Ð±Ð»Ð¸Ð¾ÑеÑного конÑоÑÑиÑма ХоÑоÑнеа, ÐоÑа в наÑÑоÑÑее вÑÐµÐ¼Ñ Ð¿Ð¾Ð´Ð´ÐµÑживаеÑÑÑ Ð³ÑÑппой поÑÑавÑиков пÑогÑаммного обеÑпеÑÐµÐ½Ð¸Ñ Ð¸ ÑпеÑиалиÑÑами по библиоÑеÑнÑм ÑеÑнологиÑм Ñо вÑего земного ÑаÑа. ','ru-RU','2007-10-29 05:25:58','2099-01-10',1); > >-INSERT INTO `opac_news` (`idnew`, `title`, `new`, `lang`, `timestamp`, `expirationdate`, `number`) VALUES >-(3,'ÐобÑо пожаловаÑÑ Ð² ÐоÑа','ÐобÑо пожаловаÑÑ Ð² ÐоÑа. ÐоÑа ÑвлÑеÑÑÑ Ð¿Ð¾Ð»Ð½Ð¾ÑÑнкÑионалÑной ÐÐÐС Ñ Ð¾ÑкÑÑÑÑми иÑÑодниками. РазÑабоÑана пеÑвонаÑалÑно в Ðовой Ðеландии компанией Katipo Communications Ltd и впеÑвÑе вÑпÑÑена в ÑнваÑе 2000 года Ð´Ð»Ñ Ð±Ð¸Ð±Ð»Ð¸Ð¾ÑеÑного конÑоÑÑиÑма ХоÑоÑнеа, ÐоÑа в наÑÑоÑÑее вÑÐµÐ¼Ñ Ð¿Ð¾Ð´Ð´ÐµÑживаеÑÑÑ Ð³ÑÑппой поÑÑавÑиков пÑогÑаммного обеÑпеÑÐµÐ½Ð¸Ñ Ð¸ ÑпеÑиалиÑÑами по библиоÑеÑнÑм ÑеÑнологиÑм Ñо вÑего земного ÑаÑа. ','ru-RU','2007-10-29 05:25:58','2099-01-10',1); >+INSERT INTO `opac_news` (`title`, `new`, `lang`, `timestamp`, `expirationdate`, `number`) VALUES >+('ÐобÑо пожаловаÑÑ Ð² ÐоÑа','ÐобÑо пожаловаÑÑ Ð² ÐоÑа. ÐоÑа ÑвлÑеÑÑÑ Ð¿Ð¾Ð»Ð½Ð¾ÑÑнкÑионалÑной ÐÐÐС Ñ Ð¾ÑкÑÑÑÑми иÑÑодниками. РазÑабоÑана пеÑвонаÑалÑно в Ðовой Ðеландии компанией Katipo Communications Ltd и впеÑвÑе вÑпÑÑена в ÑнваÑе 2000 года Ð´Ð»Ñ Ð±Ð¸Ð±Ð»Ð¸Ð¾ÑеÑного конÑоÑÑиÑма ХоÑоÑнеа, ÐоÑа в наÑÑоÑÑее вÑÐµÐ¼Ñ Ð¿Ð¾Ð´Ð´ÐµÑживаеÑÑÑ Ð³ÑÑппой поÑÑавÑиков пÑогÑаммного обеÑпеÑÐµÐ½Ð¸Ñ Ð¸ ÑпеÑиалиÑÑами по библиоÑеÑнÑм ÑеÑнологиÑм Ñо вÑего земного ÑаÑа. ','koha','2007-10-29 05:25:58','2099-01-10',1); > >-INSERT INTO `opac_news` (`idnew`, `title`, `new`, `lang`, `timestamp`, `expirationdate`, `number`) VALUES >-(4,'ÐобÑо пожаловаÑÑ Ð² ÐоÑа','ÐобÑо пожаловаÑÑ Ð² ÐоÑа. ÐоÑа ÑвлÑеÑÑÑ Ð¿Ð¾Ð»Ð½Ð¾ÑÑнкÑионалÑной ÐÐÐС Ñ Ð¾ÑкÑÑÑÑми иÑÑодниками. РазÑабоÑана пеÑвонаÑалÑно в Ðовой Ðеландии компанией Katipo Communications Ltd и впеÑвÑе вÑпÑÑена в ÑнваÑе 2000 года Ð´Ð»Ñ Ð±Ð¸Ð±Ð»Ð¸Ð¾ÑеÑного конÑоÑÑиÑма ХоÑоÑнеа, ÐоÑа в наÑÑоÑÑее вÑÐµÐ¼Ñ Ð¿Ð¾Ð´Ð´ÐµÑживаеÑÑÑ Ð³ÑÑппой поÑÑавÑиков пÑогÑаммного обеÑпеÑÐµÐ½Ð¸Ñ Ð¸ ÑпеÑиалиÑÑами по библиоÑеÑнÑм ÑеÑнологиÑм Ñо вÑего земного ÑаÑа. ','koha','2007-10-29 05:25:58','2099-01-10',1); > >+INSERT INTO `opac_news` (`title`, `new`, `lang`, `timestamp`, `expirationdate`, `number`) VALUES >+('What\'s Next?','Now that you\'ve installed Koha, what\'s next? Here are some suggestions:\r\n<ul>\r\n<li><a href=\"http://koha-community.org/documentation/\">Read Koha Documentation</a></li>\r\n<li><a href=\"http://wiki.koha-community.org\">Read/Write to the Koha Wiki</a></li>\r\n<li><a href=\"http://koha-community.org/support/\">Read and Contribute to Discussions</a></li>\r\n<li><a href=\"http://bugs.koha-community.org\">Report Koha Bugs</a></li>\r\n<li><a href=\"http://wiki.koha-community.org/wiki/Version_Control_Using_Git\">Submit Patches to Koha using Git (Version Control System)</a></li>\r\n<li><a href=\"http://koha-community.org/support/\">Chat with Koha users and developers</a></li>\r\n</ul>\r\n','en','2007-10-29 05:34:45','2099-01-10',2); > >-INSERT INTO `opac_news` (`idnew`, `title`, `new`, `lang`, `timestamp`, `expirationdate`, `number`) VALUES >-(5,'What\'s Next?','Now that you\'ve installed Koha, what\'s next? Here are some suggestions:\r\n<ul>\r\n<li><a href=\"http://koha-community.org/documentation/\">Read Koha Documentation</a></li>\r\n<li><a href=\"http://wiki.koha-community.org\">Read/Write to the Koha Wiki</a></li>\r\n<li><a href=\"http://koha-community.org/support/\">Read and Contribute to Discussions</a></li>\r\n<li><a href=\"http://bugs.koha-community.org\">Report Koha Bugs</a></li>\r\n<li><a href=\"http://wiki.koha-community.org/wiki/Version_Control_Using_Git\">Submit Patches to Koha using Git (Version Control System)</a></li>\r\n<li><a href=\"http://koha-community.org/support/\">Chat with Koha users and developers</a></li>\r\n</ul>\r\n','en','2007-10-29 05:34:45','2099-01-10',2); >+INSERT INTO `opac_news` (`title`, `new`, `lang`, `timestamp`, `expirationdate`, `number`) VALUES >+('Що далÑ?','ТепеÑ, коли Ðи вÑÑановили ÐоÑа, Ñо ж далÑ? ÐÑÑ Ð´ÐµÑÐºÑ Ð¿ÑопозиÑÑÑ:\r\n<ul>\r\n<li><a href=\"http://koha-community.org/documentation/\">ЧиÑайÑе докÑменÑаÑÑÑ Ð¿Ñо ÐоÑа</a></li>\r\n<li><a href=\"http://wiki.koha-community.org\">ЧиÑайÑе/пиÑÑÑÑ Ð½Ð° ÐоÑа Wiki</a></li>\r\n<li><a href=\"http://koha-community.org/support/\">ЧиÑайÑе Ñ Ð±ÐµÑÑÑÑ ÑÑаÑÑÑ Ð² обговоÑеннÑÑ</a></li>\r\n<li><a href=\"http://bugs.koha-community.org\">РапоÑÑÑйÑе пÑо недолÑки ÐоÑа</a></li>\r\n<li><a href=\"http://wiki.koha-community.org/wiki/Version_Control_Using_Git\"> ÐодавайÑе паÑÑÑ Ð´Ð»Ñ ÐоÑа, викоÑиÑÑовÑÑÑи Git (ÑиÑÑема конÑÑÐ¾Ð»Ñ Ð²ÐµÑÑÑй)</a></li>\r\n<li><a href=\"http://koha-community.org/support/\">Ð§Ð°Ñ ÐºÐ¾ÑиÑÑÑваÑÑв Ñа ÑозÑобникÑв ÐоÑа</a></li>\r\n</ul>','uk-UA','2008-05-28 23:07:23','2099-01-10',2); > >-INSERT INTO `opac_news` (`idnew`, `title`, `new`, `lang`, `timestamp`, `expirationdate`, `number`) VALUES >-(6,'Що далÑ?','ТепеÑ, коли Ðи вÑÑановили ÐоÑа, Ñо ж далÑ? ÐÑÑ Ð´ÐµÑÐºÑ Ð¿ÑопозиÑÑÑ:\r\n<ul>\r\n<li><a href=\"http://koha-community.org/documentation/\">ЧиÑайÑе докÑменÑаÑÑÑ Ð¿Ñо ÐоÑа</a></li>\r\n<li><a href=\"http://wiki.koha-community.org\">ЧиÑайÑе/пиÑÑÑÑ Ð½Ð° ÐоÑа Wiki</a></li>\r\n<li><a href=\"http://koha-community.org/support/\">ЧиÑайÑе Ñ Ð±ÐµÑÑÑÑ ÑÑаÑÑÑ Ð² обговоÑеннÑÑ</a></li>\r\n<li><a href=\"http://bugs.koha-community.org\">РапоÑÑÑйÑе пÑо недолÑки ÐоÑа</a></li>\r\n<li><a href=\"http://wiki.koha-community.org/wiki/Version_Control_Using_Git\"> ÐодавайÑе паÑÑÑ Ð´Ð»Ñ ÐоÑа, викоÑиÑÑовÑÑÑи Git (ÑиÑÑема конÑÑÐ¾Ð»Ñ Ð²ÐµÑÑÑй)</a></li>\r\n<li><a href=\"http://koha-community.org/support/\">Ð§Ð°Ñ ÐºÐ¾ÑиÑÑÑваÑÑв Ñа ÑозÑобникÑв ÐоÑа</a></li>\r\n</ul>','uk-UA','2008-05-28 23:07:23','2099-01-10',2); > >+INSERT INTO `opac_news` (`title`, `new`, `lang`, `timestamp`, `expirationdate`, `number`) VALUES >+('ЧÑо далÑÑе?','ТепеÑÑ, когда ÐÑ ÑÑÑановили ÐоÑа, ÑÑо же далÑÑе? ÐÐ¾Ñ Ð½ÐµÐºÐ¾ÑоÑÑе пÑедложениÑ:\r\n<ul>\r\n<li><a href=\"http://koha-community.org/documentation/\">ЧиÑайÑе докÑменÑаÑÐ¸Ñ Ð¿Ñо ÐоÑа</a></li>\r\n<li><a href=\"http://wiki.koha-community.org\">ЧиÑайÑе/пиÑиÑе на ÐоÑа Wiki</a></li>\r\n<li><a href=\"http://koha-community.org/support/\"> ЧиÑайÑе и пÑинимайÑе ÑÑаÑÑие в обÑÑждениÑÑ</a></li>\r\n<li><a href=\"http://bugs.koha-community.org\">ÐÑиÑÑвайÑеÑÑ Ð¿Ñо недоÑеÑÑ ÐоÑа</a></li>\r\n<li><a href=\"http://wiki.koha-community.org/wiki/Version_Control_Using_Git\"> ÐодавайÑе паÑÑи Ð´Ð»Ñ ÐоÑа, иÑполÑзÑÑ Git (ÑиÑÑема конÑÑÐ¾Ð»Ñ Ð²ÐµÑÑий)</a></li>\r\n<li><a href=\"http://koha-community.org/support/\">Ð§Ð°Ñ Ð¿Ð¾Ð»ÑзоваÑелей и ÑазÑабоÑÑиков ÐоÑа</a></li>\r\n</ul>','ru-RU','2008-05-28 23:02:25','2099-01-10',2); > >-INSERT INTO `opac_news` (`idnew`, `title`, `new`, `lang`, `timestamp`, `expirationdate`, `number`) VALUES >-(7,'ЧÑо далÑÑе?','ТепеÑÑ, когда ÐÑ ÑÑÑановили ÐоÑа, ÑÑо же далÑÑе? ÐÐ¾Ñ Ð½ÐµÐºÐ¾ÑоÑÑе пÑедложениÑ:\r\n<ul>\r\n<li><a href=\"http://koha-community.org/documentation/\">ЧиÑайÑе докÑменÑаÑÐ¸Ñ Ð¿Ñо ÐоÑа</a></li>\r\n<li><a href=\"http://wiki.koha-community.org\">ЧиÑайÑе/пиÑиÑе на ÐоÑа Wiki</a></li>\r\n<li><a href=\"http://koha-community.org/support/\"> ЧиÑайÑе и пÑинимайÑе ÑÑаÑÑие в обÑÑждениÑÑ</a></li>\r\n<li><a href=\"http://bugs.koha-community.org\">ÐÑиÑÑвайÑеÑÑ Ð¿Ñо недоÑеÑÑ ÐоÑа</a></li>\r\n<li><a href=\"http://wiki.koha-community.org/wiki/Version_Control_Using_Git\"> ÐодавайÑе паÑÑи Ð´Ð»Ñ ÐоÑа, иÑполÑзÑÑ Git (ÑиÑÑема конÑÑÐ¾Ð»Ñ Ð²ÐµÑÑий)</a></li>\r\n<li><a href=\"http://koha-community.org/support/\">Ð§Ð°Ñ Ð¿Ð¾Ð»ÑзоваÑелей и ÑазÑабоÑÑиков ÐоÑа</a></li>\r\n</ul>','ru-RU','2008-05-28 23:02:25','2099-01-10',2); >- >-INSERT INTO `opac_news` (`idnew`, `title`, `new`, `lang`, `timestamp`, `expirationdate`, `number`) VALUES >-(8,'ЧÑо далÑÑе?','ТепеÑÑ, когда ÐÑ ÑÑÑановили ÐоÑа, ÑÑо же далÑÑе? ÐÐ¾Ñ Ð½ÐµÐºÐ¾ÑоÑÑе пÑедложениÑ:\r\n<ul>\r\n<li><a href=\"http://koha-community.org/documentation/\">ЧиÑайÑе докÑменÑаÑÐ¸Ñ Ð¿Ñо ÐоÑа</a></li>\r\n<li><a href=\"http://wiki.koha-community.org\">ЧиÑайÑе/пиÑиÑе на ÐоÑа Wiki</a></li>\r\n<li><a href=\"http://koha-community.org/support/\"> ЧиÑайÑе и пÑинимайÑе ÑÑаÑÑие в обÑÑждениÑÑ</a></li>\r\n<li><a href=\"http://bugs.koha-community.org\">ÐÑиÑÑвайÑеÑÑ Ð¿Ñо недоÑеÑÑ ÐоÑа</a></li>\r\n<li><a href=\"http://wiki.koha-community.org/wiki/Version_Control_Using_Git\"> ÐодавайÑе паÑÑи Ð´Ð»Ñ ÐоÑа, иÑполÑзÑÑ Git (ÑиÑÑема конÑÑÐ¾Ð»Ñ Ð²ÐµÑÑий)</a></li>\r\n<li><a href=\"http://koha-community.org/support/\">Ð§Ð°Ñ Ð¿Ð¾Ð»ÑзоваÑелей и ÑазÑабоÑÑиков ÐоÑа</a></li>\r\n</ul>','koha','2008-05-28 23:02:25','2099-01-10',2); >+INSERT INTO `opac_news` (`title`, `new`, `lang`, `timestamp`, `expirationdate`, `number`) VALUES >+('ЧÑо далÑÑе?','ТепеÑÑ, когда ÐÑ ÑÑÑановили ÐоÑа, ÑÑо же далÑÑе? ÐÐ¾Ñ Ð½ÐµÐºÐ¾ÑоÑÑе пÑедложениÑ:\r\n<ul>\r\n<li><a href=\"http://koha-community.org/documentation/\">ЧиÑайÑе докÑменÑаÑÐ¸Ñ Ð¿Ñо ÐоÑа</a></li>\r\n<li><a href=\"http://wiki.koha-community.org\">ЧиÑайÑе/пиÑиÑе на ÐоÑа Wiki</a></li>\r\n<li><a href=\"http://koha-community.org/support/\"> ЧиÑайÑе и пÑинимайÑе ÑÑаÑÑие в обÑÑждениÑÑ</a></li>\r\n<li><a href=\"http://bugs.koha-community.org\">ÐÑиÑÑвайÑеÑÑ Ð¿Ñо недоÑеÑÑ ÐоÑа</a></li>\r\n<li><a href=\"http://wiki.koha-community.org/wiki/Version_Control_Using_Git\"> ÐодавайÑе паÑÑи Ð´Ð»Ñ ÐоÑа, иÑполÑзÑÑ Git (ÑиÑÑема конÑÑÐ¾Ð»Ñ Ð²ÐµÑÑий)</a></li>\r\n<li><a href=\"http://koha-community.org/support/\">Ð§Ð°Ñ Ð¿Ð¾Ð»ÑзоваÑелей и ÑазÑабоÑÑиков ÐоÑа</a></li>\r\n</ul>','koha','2008-05-28 23:02:25','2099-01-10',2); > >+SET FOREIGN_KEY_CHECKS=1; >diff --git a/installer/data/mysql/uk-UA/optional/sample_news.sql b/installer/data/mysql/uk-UA/optional/sample_news.sql >index 614edac..45b8c98 100644 >--- a/installer/data/mysql/uk-UA/optional/sample_news.sql >+++ b/installer/data/mysql/uk-UA/optional/sample_news.sql >@@ -1,25 +1,28 @@ >-TRUNCATE opac_news; >+SET NAMES utf8; >+SET FOREIGN_KEY_CHECKS=0; > >-INSERT INTO `opac_news` (`idnew`, `title`, `new`, `lang`, `timestamp`, `expirationdate`, `number`) VALUES >-(1,'ÐобÑо пожаловаÑÑ Ð² ÐоÑа','ÐобÑо пожаловаÑÑ Ð² ÐоÑа. ÐоÑа ÑвлÑеÑÑÑ Ð¿Ð¾Ð»Ð½Ð¾ÑÑнкÑионалÑной ÐÐÐС Ñ Ð¾ÑкÑÑÑÑми иÑÑодниками. РазÑабоÑана пеÑвонаÑалÑно в Ðовой Ðеландии компанией Katipo Communications Ltd и впеÑвÑе вÑпÑÑена в ÑнваÑе 2000 года Ð´Ð»Ñ Ð±Ð¸Ð±Ð»Ð¸Ð¾ÑеÑного конÑоÑÑиÑма ХоÑоÑнеа, ÐоÑа в наÑÑоÑÑее вÑÐµÐ¼Ñ Ð¿Ð¾Ð´Ð´ÐµÑживаеÑÑÑ Ð³ÑÑппой поÑÑавÑиков пÑогÑаммного обеÑпеÑÐµÐ½Ð¸Ñ Ð¸ ÑпеÑиалиÑÑами по библиоÑеÑнÑм ÑеÑнологиÑм Ñо вÑего земного ÑаÑа. ','ru-RU','2007-10-29 05:25:58','2099-01-10',1); >+INSERT INTO `opac_news` (`title`, `new`, `lang`, `timestamp`, `expirationdate`, `number`) VALUES >+('ÐобÑо пожаловаÑÑ Ð² ÐоÑа','ÐобÑо пожаловаÑÑ Ð² ÐоÑа. ÐоÑа ÑвлÑеÑÑÑ Ð¿Ð¾Ð»Ð½Ð¾ÑÑнкÑионалÑной ÐÐÐС Ñ Ð¾ÑкÑÑÑÑми иÑÑодниками. РазÑабоÑана пеÑвонаÑалÑно в Ðовой Ðеландии компанией Katipo Communications Ltd и впеÑвÑе вÑпÑÑена в ÑнваÑе 2000 года Ð´Ð»Ñ Ð±Ð¸Ð±Ð»Ð¸Ð¾ÑеÑного конÑоÑÑиÑма ХоÑоÑнеа, ÐоÑа в наÑÑоÑÑее вÑÐµÐ¼Ñ Ð¿Ð¾Ð´Ð´ÐµÑживаеÑÑÑ Ð³ÑÑппой поÑÑавÑиков пÑогÑаммного обеÑпеÑÐµÐ½Ð¸Ñ Ð¸ ÑпеÑиалиÑÑами по библиоÑеÑнÑм ÑеÑнологиÑм Ñо вÑего земного ÑаÑа. ','ru-RU','2007-10-29 05:25:58','2099-01-10',1); > >-INSERT INTO `opac_news` (`idnew`, `title`, `new`, `lang`, `timestamp`, `expirationdate`, `number`) VALUES >-(2,'What\'s Next?','Now that you\'ve installed Koha, what\'s next? Here are some suggestions:\r\n<ul>\r\n<li><a href=\"http://koha-community.org/documentation/\">Read Koha Documentation</a></li>\r\n<li><a href=\"http://wiki.koha-community.org\">Read/Write to the Koha Wiki</a></li>\r\n<li><a href=\"http://koha-community.org/support/\">Read and Contribute to Discussions</a></li>\r\n<li><a href=\"http://bugs.koha-community.org\">Report Koha Bugs</a></li>\r\n<li><a href=\"http://wiki.koha-community.org/wiki/Version_Control_Using_Git\">Submit Patches to Koha using Git (Version Control System)</a></li>\r\n<li><a href=\"http://koha-community.org/support/\">Chat with Koha users and developers</a></li>\r\n</ul>\r\n','en','2007-10-29 05:34:45','2099-01-10',2); >+INSERT INTO `opac_news` (`title`, `new`, `lang`, `timestamp`, `expirationdate`, `number`) VALUES >+('What\'s Next?','Now that you\'ve installed Koha, what\'s next? Here are some suggestions:\r\n<ul>\r\n<li><a href=\"http://koha-community.org/documentation/\">Read Koha Documentation</a></li>\r\n<li><a href=\"http://wiki.koha-community.org\">Read/Write to the Koha Wiki</a></li>\r\n<li><a href=\"http://koha-community.org/support/\">Read and Contribute to Discussions</a></li>\r\n<li><a href=\"http://bugs.koha-community.org\">Report Koha Bugs</a></li>\r\n<li><a href=\"http://wiki.koha-community.org/wiki/Version_Control_Using_Git\">Submit Patches to Koha using Git (Version Control System)</a></li>\r\n<li><a href=\"http://koha-community.org/support/\">Chat with Koha users and developers</a></li>\r\n</ul>\r\n','en','2007-10-29 05:34:45','2099-01-10',2); > >-INSERT INTO `opac_news` (`idnew`, `title`, `new`, `lang`, `timestamp`, `expirationdate`, `number`) VALUES >-(3,'Welcome to Koha','Welcome to Koha. Koha is a full-featured open-source ILS. Developed initially in New Zealand by Katipo Communications Ltd and first deployed in January of 2000 for Horowhenua Library Trust, Koha is currently maintained by a team of software providers and library technology staff from around the globe.','en','2008-05-28 22:45:42','2099-01-10',1); >+INSERT INTO `opac_news` (`title`, `new`, `lang`, `timestamp`, `expirationdate`, `number`) VALUES >+('Welcome to Koha','Welcome to Koha. Koha is a full-featured open-source ILS. Developed initially in New Zealand by Katipo Communications Ltd and first deployed in January of 2000 for Horowhenua Library Trust, Koha is currently maintained by a team of software providers and library technology staff from around the globe.','en','2008-05-28 22:45:42','2099-01-10',1); > >-INSERT INTO `opac_news` (`idnew`, `title`, `new`, `lang`, `timestamp`, `expirationdate`, `number`) VALUES >-(4,'ÐаÑкаво пÑоÑимо до ÐоÑа','ÐаÑкаво пÑоÑимо до ÐоÑа. ÐоÑа Ñ Ð¿Ð¾Ð²Ð½Ð¾ÑÑнкÑÑоналÑÐ½Ð¾Ñ ÐÐÐС з вÑдкÑиÑими джеÑелÑними кодам. РозÑоблена ÑпоÑаÑÐºÑ Ð² ÐовÑй ÐеландÑÑ ÐºÐ¾Ð¼Ð¿Ð°Ð½ÑÑÑ Katipo Communications Ltd Ñ Ð²Ð¿ÐµÑÑе випÑÑена в ÑÑÑÐ½Ñ 2000 ÑÐ¾ÐºÑ Ð´Ð»Ñ Ð±ÑблÑоÑеÑного конÑоÑÑÑÑÐ¼Ñ Ð¥Ð¾ÑоÑнеа. ÐоÑа в даний ÑÐ°Ñ Ð¿ÑдÑÑимÑÑÑÑÑÑ Ð³ÑÑÐ¿Ð¾Ñ Ð¿Ð¾ÑÑаÑалÑникÑв пÑогÑамного забезпеÑÐµÐ½Ð½Ñ Ñ ÑаÑÑвÑÑми з бÑблÑоÑеÑÐ½Ð¸Ñ ÑеÑнологÑй Ð·Ñ Ð²ÑÑÑÑ Ð·ÐµÐ¼Ð½Ð¾Ñ ÐºÑлÑ. ','koha','2008-05-28 22:48:29','2099-01-10',1); >+INSERT INTO `opac_news` (`title`, `new`, `lang`, `timestamp`, `expirationdate`, `number`) VALUES >+('ÐаÑкаво пÑоÑимо до ÐоÑа','ÐаÑкаво пÑоÑимо до ÐоÑа. ÐоÑа Ñ Ð¿Ð¾Ð²Ð½Ð¾ÑÑнкÑÑоналÑÐ½Ð¾Ñ ÐÐÐС з вÑдкÑиÑими джеÑелÑними кодам. РозÑоблена ÑпоÑаÑÐºÑ Ð² ÐовÑй ÐеландÑÑ ÐºÐ¾Ð¼Ð¿Ð°Ð½ÑÑÑ Katipo Communications Ltd Ñ Ð²Ð¿ÐµÑÑе випÑÑена в ÑÑÑÐ½Ñ 2000 ÑÐ¾ÐºÑ Ð´Ð»Ñ Ð±ÑблÑоÑеÑного конÑоÑÑÑÑÐ¼Ñ Ð¥Ð¾ÑоÑнеа. ÐоÑа в даний ÑÐ°Ñ Ð¿ÑдÑÑимÑÑÑÑÑÑ Ð³ÑÑÐ¿Ð¾Ñ Ð¿Ð¾ÑÑаÑалÑникÑв пÑогÑамного забезпеÑÐµÐ½Ð½Ñ Ñ ÑаÑÑвÑÑми з бÑблÑоÑеÑÐ½Ð¸Ñ ÑеÑнологÑй Ð·Ñ Ð²ÑÑÑÑ Ð·ÐµÐ¼Ð½Ð¾Ñ ÐºÑлÑ. ','koha','2008-05-28 22:48:29','2099-01-10',1); > >-INSERT INTO `opac_news` (`idnew`, `title`, `new`, `lang`, `timestamp`, `expirationdate`, `number`) VALUES >-(5,'ЧÑо далÑÑе?','ТепеÑÑ, когда ÐÑ ÑÑÑановили ÐоÑа, ÑÑо же далÑÑе? ÐÐ¾Ñ Ð½ÐµÐºÐ¾ÑоÑÑе пÑедложениÑ:\r\n<ul>\r\n<li><a href=\"http://koha-community.org/documentation/\">ЧиÑайÑе докÑменÑаÑÐ¸Ñ Ð¿Ñо ÐоÑа</a></li>\r\n<li><a href=\"http://wiki.koha-community.org\">ЧиÑайÑе/пиÑиÑе на ÐоÑа Wiki</a></li>\r\n<li><a href=\"http://koha-community.org/support/\"> ЧиÑайÑе и пÑинимайÑе ÑÑаÑÑие в обÑÑждениÑÑ</a></li>\r\n<li><a href=\"http://bugs.koha-community.org\">ÐÑиÑÑвайÑеÑÑ Ð¿Ñо недоÑеÑÑ ÐоÑа</a></li>\r\n<li><a href=\"http://wiki.koha-community.org/wiki/Version_Control_Using_Git\"> ÐодавайÑе паÑÑи Ð´Ð»Ñ ÐоÑа, иÑполÑзÑÑ Git (ÑиÑÑема конÑÑÐ¾Ð»Ñ Ð²ÐµÑÑий)</a></li>\r\n<li><a href=\"http://koha-community.org/support/\">Ð§Ð°Ñ Ð¿Ð¾Ð»ÑзоваÑелей и ÑазÑабоÑÑиков ÐоÑа</a></li>\r\n</ul>','ru-RU','2008-05-28 23:02:25','2099-01-10',2); >+INSERT INTO `opac_news` (`title`, `new`, `lang`, `timestamp`, `expirationdate`, `number`) VALUES >+('ЧÑо далÑÑе?','ТепеÑÑ, когда ÐÑ ÑÑÑановили ÐоÑа, ÑÑо же далÑÑе? ÐÐ¾Ñ Ð½ÐµÐºÐ¾ÑоÑÑе пÑедложениÑ:\r\n<ul>\r\n<li><a href=\"http://koha-community.org/documentation/\">ЧиÑайÑе докÑменÑаÑÐ¸Ñ Ð¿Ñо ÐоÑа</a></li>\r\n<li><a href=\"http://wiki.koha-community.org\">ЧиÑайÑе/пиÑиÑе на ÐоÑа Wiki</a></li>\r\n<li><a href=\"http://koha-community.org/support/\"> ЧиÑайÑе и пÑинимайÑе ÑÑаÑÑие в обÑÑждениÑÑ</a></li>\r\n<li><a href=\"http://bugs.koha-community.org\">ÐÑиÑÑвайÑеÑÑ Ð¿Ñо недоÑеÑÑ ÐоÑа</a></li>\r\n<li><a href=\"http://wiki.koha-community.org/wiki/Version_Control_Using_Git\"> ÐодавайÑе паÑÑи Ð´Ð»Ñ ÐоÑа, иÑполÑзÑÑ Git (ÑиÑÑема конÑÑÐ¾Ð»Ñ Ð²ÐµÑÑий)</a></li>\r\n<li><a href=\"http://koha-community.org/support/\">Ð§Ð°Ñ Ð¿Ð¾Ð»ÑзоваÑелей и ÑазÑабоÑÑиков ÐоÑа</a></li>\r\n</ul>','ru-RU','2008-05-28 23:02:25','2099-01-10',2); > >-INSERT INTO `opac_news` (`idnew`, `title`, `new`, `lang`, `timestamp`, `expirationdate`, `number`) VALUES >-(6,'Що далÑ?','ТепеÑ, коли Ðи вÑÑановили ÐоÑа, Ñо ж далÑ? ÐÑÑ Ð´ÐµÑÐºÑ Ð¿ÑопозиÑÑÑ:\r\n<ul>\r\n<li><a href=\"http://koha-community.org/documentation/\">ЧиÑайÑе докÑменÑаÑÑÑ Ð¿Ñо ÐоÑа</a></li>\r\n<li><a href=\"http://wiki.koha-community.org\">ЧиÑайÑе/пиÑÑÑÑ Ð½Ð° ÐоÑа Wiki</a></li>\r\n<li><a href=\"http://koha-community.org/support/\">ЧиÑайÑе Ñ Ð±ÐµÑÑÑÑ ÑÑаÑÑÑ Ð² обговоÑеннÑÑ</a></li>\r\n<li><a href=\"http://bugs.koha-community.org\">РапоÑÑÑйÑе пÑо недолÑки ÐоÑа</a></li>\r\n<li><a href=\"http://wiki.koha-community.org/wiki/Version_Control_Using_Git\"> ÐодавайÑе паÑÑÑ Ð´Ð»Ñ ÐоÑа, викоÑиÑÑовÑÑÑи Git (ÑиÑÑема конÑÑÐ¾Ð»Ñ Ð²ÐµÑÑÑй)</a></li>\r\n<li><a href=\"http://koha-community.org/support/\">Ð§Ð°Ñ ÐºÐ¾ÑиÑÑÑваÑÑв Ñа ÑозÑобникÑв ÐоÑа</a></li>\r\n</ul>','koha','2008-05-28 23:07:23','2099-01-10',2); >+INSERT INTO `opac_news` (`title`, `new`, `lang`, `timestamp`, `expirationdate`, `number`) VALUES >+('Що далÑ?','ТепеÑ, коли Ðи вÑÑановили ÐоÑа, Ñо ж далÑ? ÐÑÑ Ð´ÐµÑÐºÑ Ð¿ÑопозиÑÑÑ:\r\n<ul>\r\n<li><a href=\"http://koha-community.org/documentation/\">ЧиÑайÑе докÑменÑаÑÑÑ Ð¿Ñо ÐоÑа</a></li>\r\n<li><a href=\"http://wiki.koha-community.org\">ЧиÑайÑе/пиÑÑÑÑ Ð½Ð° ÐоÑа Wiki</a></li>\r\n<li><a href=\"http://koha-community.org/support/\">ЧиÑайÑе Ñ Ð±ÐµÑÑÑÑ ÑÑаÑÑÑ Ð² обговоÑеннÑÑ</a></li>\r\n<li><a href=\"http://bugs.koha-community.org\">РапоÑÑÑйÑе пÑо недолÑки ÐоÑа</a></li>\r\n<li><a href=\"http://wiki.koha-community.org/wiki/Version_Control_Using_Git\"> ÐодавайÑе паÑÑÑ Ð´Ð»Ñ ÐоÑа, викоÑиÑÑовÑÑÑи Git (ÑиÑÑема конÑÑÐ¾Ð»Ñ Ð²ÐµÑÑÑй)</a></li>\r\n<li><a href=\"http://koha-community.org/support/\">Ð§Ð°Ñ ÐºÐ¾ÑиÑÑÑваÑÑв Ñа ÑозÑобникÑв ÐоÑа</a></li>\r\n</ul>','koha','2008-05-28 23:07:23','2099-01-10',2); > >-INSERT INTO `opac_news` (`idnew`, `title`, `new`, `lang`, `timestamp`, `expirationdate`, `number`) VALUES >-(7,'ÐаÑкаво пÑоÑимо до ÐоÑа','ÐаÑкаво пÑоÑимо до ÐоÑа. ÐоÑа Ñ Ð¿Ð¾Ð²Ð½Ð¾ÑÑнкÑÑоналÑÐ½Ð¾Ñ ÐÐÐС з вÑдкÑиÑими джеÑелÑними кодам. РозÑоблена ÑпоÑаÑÐºÑ Ð² ÐовÑй ÐеландÑÑ ÐºÐ¾Ð¼Ð¿Ð°Ð½ÑÑÑ Katipo Communications Ltd Ñ Ð²Ð¿ÐµÑÑе випÑÑена в ÑÑÑÐ½Ñ 2000 ÑÐ¾ÐºÑ Ð´Ð»Ñ Ð±ÑблÑоÑеÑного конÑоÑÑÑÑÐ¼Ñ Ð¥Ð¾ÑоÑнеа. ÐоÑа в даний ÑÐ°Ñ Ð¿ÑдÑÑимÑÑÑÑÑÑ Ð³ÑÑÐ¿Ð¾Ñ Ð¿Ð¾ÑÑаÑалÑникÑв пÑогÑамного забезпеÑÐµÐ½Ð½Ñ Ñ ÑаÑÑвÑÑми з бÑблÑоÑеÑÐ½Ð¸Ñ ÑеÑнологÑй Ð·Ñ Ð²ÑÑÑÑ Ð·ÐµÐ¼Ð½Ð¾Ñ ÐºÑлÑ. ','uk-UA','2008-05-28 22:48:29','2099-01-10',1); >+INSERT INTO `opac_news` (`title`, `new`, `lang`, `timestamp`, `expirationdate`, `number`) VALUES >+('ÐаÑкаво пÑоÑимо до ÐоÑа','ÐаÑкаво пÑоÑимо до ÐоÑа. ÐоÑа Ñ Ð¿Ð¾Ð²Ð½Ð¾ÑÑнкÑÑоналÑÐ½Ð¾Ñ ÐÐÐС з вÑдкÑиÑими джеÑелÑними кодам. РозÑоблена ÑпоÑаÑÐºÑ Ð² ÐовÑй ÐеландÑÑ ÐºÐ¾Ð¼Ð¿Ð°Ð½ÑÑÑ Katipo Communications Ltd Ñ Ð²Ð¿ÐµÑÑе випÑÑена в ÑÑÑÐ½Ñ 2000 ÑÐ¾ÐºÑ Ð´Ð»Ñ Ð±ÑблÑоÑеÑного конÑоÑÑÑÑÐ¼Ñ Ð¥Ð¾ÑоÑнеа. ÐоÑа в даний ÑÐ°Ñ Ð¿ÑдÑÑимÑÑÑÑÑÑ Ð³ÑÑÐ¿Ð¾Ñ Ð¿Ð¾ÑÑаÑалÑникÑв пÑогÑамного забезпеÑÐµÐ½Ð½Ñ Ñ ÑаÑÑвÑÑми з бÑблÑоÑеÑÐ½Ð¸Ñ ÑеÑнологÑй Ð·Ñ Ð²ÑÑÑÑ Ð·ÐµÐ¼Ð½Ð¾Ñ ÐºÑлÑ. ','uk-UA','2008-05-28 22:48:29','2099-01-10',1); > >-INSERT INTO `opac_news` (`idnew`, `title`, `new`, `lang`, `timestamp`, `expirationdate`, `number`) VALUES >-(8,'Що далÑ?','ТепеÑ, коли Ðи вÑÑановили ÐоÑа, Ñо ж далÑ? ÐÑÑ Ð´ÐµÑÐºÑ Ð¿ÑопозиÑÑÑ:\r\n<ul>\r\n<li><a href=\"http://koha-community.org/documentation/\">ЧиÑайÑе докÑменÑаÑÑÑ Ð¿Ñо ÐоÑа</a></li>\r\n<li><a href=\"http://wiki.koha-community.org\">ЧиÑайÑе/пиÑÑÑÑ Ð½Ð° ÐоÑа Wiki</a></li>\r\n<li><a href=\"http://koha-community.org/support/\">ЧиÑайÑе Ñ Ð±ÐµÑÑÑÑ ÑÑаÑÑÑ Ð² обговоÑеннÑÑ</a></li>\r\n<li><a href=\"http://bugs.koha-community.org\">РапоÑÑÑйÑе пÑо недолÑки ÐоÑа</a></li>\r\n<li><a href=\"http://wiki.koha-community.org/wiki/Version_Control_Using_Git\"> ÐодавайÑе паÑÑÑ Ð´Ð»Ñ ÐоÑа, викоÑиÑÑовÑÑÑи Git (ÑиÑÑема конÑÑÐ¾Ð»Ñ Ð²ÐµÑÑÑй)</a></li>\r\n<li><a href=\"http://koha-community.org/support/\">Ð§Ð°Ñ ÐºÐ¾ÑиÑÑÑваÑÑв Ñа ÑозÑобникÑв ÐоÑа</a></li>\r\n</ul>','uk-UA','2008-05-28 23:07:23','2099-01-10',2); >+INSERT INTO `opac_news` (`title`, `new`, `lang`, `timestamp`, `expirationdate`, `number`) VALUES >+('Що далÑ?','ТепеÑ, коли Ðи вÑÑановили ÐоÑа, Ñо ж далÑ? ÐÑÑ Ð´ÐµÑÐºÑ Ð¿ÑопозиÑÑÑ:\r\n<ul>\r\n<li><a href=\"http://koha-community.org/documentation/\">ЧиÑайÑе докÑменÑаÑÑÑ Ð¿Ñо ÐоÑа</a></li>\r\n<li><a href=\"http://wiki.koha-community.org\">ЧиÑайÑе/пиÑÑÑÑ Ð½Ð° ÐоÑа Wiki</a></li>\r\n<li><a href=\"http://koha-community.org/support/\">ЧиÑайÑе Ñ Ð±ÐµÑÑÑÑ ÑÑаÑÑÑ Ð² обговоÑеннÑÑ</a></li>\r\n<li><a href=\"http://bugs.koha-community.org\">РапоÑÑÑйÑе пÑо недолÑки ÐоÑа</a></li>\r\n<li><a href=\"http://wiki.koha-community.org/wiki/Version_Control_Using_Git\"> ÐодавайÑе паÑÑÑ Ð´Ð»Ñ ÐоÑа, викоÑиÑÑовÑÑÑи Git (ÑиÑÑема конÑÑÐ¾Ð»Ñ Ð²ÐµÑÑÑй)</a></li>\r\n<li><a href=\"http://koha-community.org/support/\">Ð§Ð°Ñ ÐºÐ¾ÑиÑÑÑваÑÑв Ñа ÑозÑобникÑв ÐоÑа</a></li>\r\n</ul>','uk-UA','2008-05-28 23:07:23','2099-01-10',2); >+ >+SET FOREIGN_KEY_CHECKS=1; >diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl >index 19893b4..2dfa2ba 100755 >--- a/installer/data/mysql/updatedatabase.pl >+++ b/installer/data/mysql/updatedatabase.pl >@@ -7824,6 +7824,20 @@ if ( CheckVersion($DBversion) ) { > SetVersion($DBversion); > } > >+$DBversion = "3.15.00.XXX"; >+if ( CheckVersion($DBversion) ) { >+ $dbh->do(q{ >+ ALTER TABLE opac_news ADD branchcode varchar(10) DEFAULT NULL >+ AFTER idnew, >+ ADD CONSTRAINT opac_news_branchcode_ibfk >+ FOREIGN KEY (branchcode) >+ REFERENCES branches (branchcode) >+ ON DELETE CASCADE ON UPDATE CASCADE; >+ }); >+ print "Upgrade to $DBversion done (Bug 7567: Add branchcode to opac_news)\n"; >+ SetVersion($DBversion); >+} >+ > > =head1 FUNCTIONS > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/koha-news.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/koha-news.tt >index b92f63a..f616fc7 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/koha-news.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/koha-news.tt >@@ -56,8 +56,8 @@ Edit News Item[% ELSE %]Add News Item[% END %][% ELSE %]News[% END %]</div> > > [% IF ( add_form ) %]<div id="doc" class="yui-t7">[% ELSE %]<div id="doc3" class="yui-t2">[% END %] > <div id="bd"> >- <div id="yui-main"> >- <div class="yui-b"> >+ <div id="yui-main"> >+ <div class="yui-b"> > > [% UNLESS ( add_form ) %] > <div id="toolbar" class="btn-toolbar"> >@@ -69,31 +69,70 @@ Edit News Item[% ELSE %]Add News Item[% END %][% ELSE %]News[% END %]</div> > <form name="add_form" method="post" action="/cgi-bin/koha/tools/koha-news.pl" > > <input type="hidden" name="op" value="[% op %]" /> > <input type="hidden" name="id" value="[% id %]" /> >- <fieldset class="rows"> >+ <fieldset class="rows"> > <legend>OPAC and Koha news</legend> > <ol> <li> > <label for="lang">Display location</label> > <select id="lang" name="lang"> >- <option value="koha">Librarian interface</option> >- [% IF ( slip ) %]<option value="slip" selected="selected">Slip</option>[% ELSE %]<option value="slip">Slip</option>[% END %] >- [% FOREACH lang_lis IN lang_list %] >- [% IF ( lang_lis.selected ) %]<option value="[% lang_lis.language %]" selected="selected">OPAC ([% lang_lis.language %])</option>[% ELSE %]<option value="[% lang_lis.language %]">OPAC ([% lang_lis.language %])</option>[% END %] >- [% END %] >+ [% IF ( new_detail.lang == "" ) %] >+ <option value="" selected>All</option> >+ [% ELSE %] >+ <option value="" >All</option> >+ [% END %] >+ [% IF ( new_detail.lang == "koha" ) %] >+ <option value="koha" selected>Librarian interface</option> >+ [% ELSE %] >+ <option value="koha" >Librarian interface</option> >+ [% END %] >+ [% IF ( new_detail.lang == "slip" ) %] >+ <option value="slip" selected>Slip</option> >+ [% ELSE %] >+ <option value="slip" >Slip</option> >+ [% END %] >+ [% FOREACH lang_lis IN lang_list %] >+ [% IF ( lang_lis.language == new_detail.lang ) %] >+ <option value="[% lang_lis.language %]" selected>OPAC ([% lang_lis.language %])</option> >+ [% ELSE %] >+ <option value="[% lang_lis.language %]" >OPAC ([% lang_lis.language %])</option> >+ [% END %] >+ [% END %] > </select> > </li> > <li> >+ <label for="branch">Branch: </label> >+ <select id="branch" name="branch"> >+ [% IF ( new_detail.branchcode == "" ) %] >+ <option value="" selected>All Branches</option> >+ [% ELSE %] >+ <option value="" >All Branches</option> >+ [% END %] >+ [% FOREACH branch_item IN branch_list %] >+ [% IF ( branch_item.value.branchcode == >+ new_detail.branchcode ) %] >+ <option value="[% branch_item.value.branchcode %]" >+ selected>[% branch_item.value.branchname %] >+ </option> >+ [% ELSE %] >+ <option value="[% branch_item.value.branchcode %]" >+ >[% branch_item.value.branchname %] >+ </option> >+ [% END %] >+ [% END %] >+ </select> >+ </li> >+ <li> > <label for="title">Title: </label> > <input id="title" size="30" type="text" name="title" value="[% new_detail.title %]" /> > </li> > <li> > <label for="from">Publication date: </label> > <input id="from" type="text" name="timestamp" size="15" value="[% new_detail.timestamp %]" class="datepickerfrom" /> >- <div class="hint">[% INCLUDE 'date-format.inc' %]</div> >+ <div class="hint">[% INCLUDE 'date-format.inc' %]</div> > </li> > <li> > <label for="to">Expiration date: </label> > <input id="to" type="text" name="expirationdate" size="15" value="[% new_detail.expirationdate %]" class="datepickerto" /> >- <div class="hint">[% INCLUDE 'date-format.inc' %]</div> >+ <div class="hint">[% INCLUDE 'date-format.inc' %]</div> > </li> > <li> > <label for="number">Appear in position: </label> >@@ -106,7 +145,7 @@ Edit News Item[% ELSE %]Add News Item[% END %][% ELSE %]News[% END %]</div> > <li><label for="new">News: </label> > <textarea name="new" id="new" cols="75" rows="10">[% new_detail.new %]</textarea></li> > </ol> >- </fieldset> >+ </fieldset> > > <fieldset class="action"><input class="button" type="submit" value="Submit" /> <a class="cancel" href="/cgi-bin/koha/tools/koha-news.pl">Cancel</a></fieldset> > </form> >@@ -115,17 +154,46 @@ Edit News Item[% ELSE %]Add News Item[% END %][% ELSE %]News[% END %]</div> > <form name="add_form" method="post" action="/cgi-bin/koha/tools/koha-news.pl" > > <label for="lang">Display location:</label> > <select name="lang" id="lang"> >- <option value="">All</option> >- <option value="koha">Librarian interface</option> >- <option value="slip">Slip</option> >- [% FOREACH lang_lis IN lang_list %] >- [% IF ( lang_lis.selected ) %] >- <option value="[% lang_lis.language %]" selected="selected"> >- [% ELSE %] >- <option value="[% lang_lis.language %]"> >- [% END %] >- OPAC ([% lang_lis.language %]) >+ [% IF ( lang == "" ) %] >+ <option value="" selected>All</option> >+ [% ELSE %] >+ <option value="" >All</option> >+ [% END %] >+ [% IF ( lang == "koha" ) %] >+ <option value="koha" selected>Librarian interface</option> >+ [% ELSE %] >+ <option value="koha" >Librarian interface</option> >+ [% END %] >+ [% IF ( lang == "slip" ) %] >+ <option value="slip" selected>Slip</option> >+ [% ELSE %] >+ <option value="slip" >Slip</option> >+ [% END %] >+ [% FOREACH lang_lis IN lang_list %] >+ [% IF ( lang_lis.language == lang ) %] >+ <option value="[% lang_lis.language %]" selected>OPAC ([% lang_lis.language %])</option> >+ [% ELSE %] >+ <option value="[% lang_lis.language %]" >OPAC ([% lang_lis.language %])</option> >+ [% END %] >+ [% END %] >+ </select> >+ <label for="branch">Branch: </label> >+ <select id="branch" name="branch"> >+ [% IF ( branchcode == "" ) %] >+ <option value="" selected>All Branches</option> >+ [% ELSE %] >+ <option value="" >All Branches</option> >+ [% END %] >+ [% FOREACH branch_item IN branch_list %] >+ [% IF ( branch_item.value.branchcode == branchcode ) %] >+ <option value="[% branch_item.value.branchcode %]" >+ selected>[% branch_item.value.branchname %] > </option> >+ [% ELSE %] >+ <option value="[% branch_item.value.branchcode %]" >+ >[% branch_item.value.branchname %] >+ </option> >+ [% END %] > [% END %] > </select> > <input type="submit" class="button" value="Filter" /> >@@ -137,6 +205,7 @@ Edit News Item[% ELSE %]Add News Item[% END %][% ELSE %]News[% END %]</div> > <thead> <tr> > <th> </th> > <th>Location</th> >+ <th>Branch</th> > <th>Number</th> > <th>Creation date</th> > <th>Expiration date</th> >@@ -153,17 +222,21 @@ Edit News Item[% ELSE %]Add News Item[% END %][% ELSE %]News[% END %]</div> > <td> > <input type="checkbox" name="ids" value="[% opac_new.idnew %]" /> > </td> >- <td>[% IF ( opac_new.lang == 'koha' ) %] >- Librarian interface >- [% ELSE %] >- [% IF ( opac_new.lang == 'slip' ) %] >- Slip >- [% ELSE %] >- OPAC >- [% END %] >- [% END %] >- </td> >- >+ <td>[% SWITCH opac_new.lang %] >+ [% CASE 'koha' %] >+ Librarian interface >+ [% CASE 'slip' %] >+ Slip >+ [% CASE '' %] >+ All >+ [% CASE %] >+ OPAC ([% opac_new.lang %]) >+ [% END %] >+ </td> >+ <td>[% IF ( opac_new.branchcode == "" ) -%] >+ All Branches >+ [% ELSE %][% opac_new.branchname %] >+ [% END %]</td> > <td>[% opac_new.number %]</td> > <td>[% opac_new.newdate %]</td> > <td>[% opac_new.expirationdate %] [% IF ( opac_new.expired ) %](<span class="expired">expired</span>)[% END %]</td> >diff --git a/koha-tmpl/opac-tmpl/prog/en/modules/opac-main.tt b/koha-tmpl/opac-tmpl/prog/en/modules/opac-main.tt >index eb1e600..c397451 100644 >--- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-main.tt >+++ b/koha-tmpl/opac-tmpl/prog/en/modules/opac-main.tt >@@ -19,10 +19,10 @@ > [% END %] > [% ELSE %] > <div id="notloggedin" class="yui-ge"> >- [% END %] >+ [% END %] > <div class="yui-u first"> >+ <div id="news" class="container"> > [% IF ( koha_news_count ) %] >-<div id="news" class="container"> > <table> > [% FOREACH koha_new IN koha_news %] > <tr><th>[% koha_new.title %]</th></tr> >@@ -30,8 +30,8 @@ > <p class="newsfooter"><i>(published on [% koha_new.newdate %])</i></p></td></tr> > [% END %] > </table> >-</div> >-[% END %] >+ [% END %] >+ </div> > > [% IF ( display_daily_quote && daily_quote ) %] > <div id="daily-quote" class="container"><h1>Quote of the Day</h1><div><span id="daily-quote-text">[% daily_quote.text %]</span><span id="daily-quote-sep"> ~ </span><span id="daily-quote-source">[% daily_quote.source %]</span></div></div> >diff --git a/mainpage.pl b/mainpage.pl >index 4159618..51fbc97 100755 >--- a/mainpage.pl >+++ b/mainpage.pl >@@ -42,7 +42,11 @@ my ( $template, $loggedinuser, $cookie, $flags ) = get_template_and_user( > } > ); > >-my $all_koha_news = &GetNewsToDisplay("koha"); >+my $homebranch; >+if (C4::Context->userenv) { >+ $homebranch = C4::Context->userenv->{'branch'}; >+} >+my $all_koha_news = &GetNewsToDisplay("koha",$homebranch); > my $koha_news_count = scalar @$all_koha_news; > > $template->param( >diff --git a/opac/opac-main.pl b/opac/opac-main.pl >index 7c6ee36..c3d53b2 100755 >--- a/opac/opac-main.pl >+++ b/opac/opac-main.pl >@@ -16,12 +16,11 @@ > # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. > > >-use strict; >-use warnings; >+use Modern::Perl; > use CGI; > use C4::Auth; # get_template_and_user > use C4::Output; >-use C4::NewsChannels; # get_opac_news >+use C4::NewsChannels; # GetNewsToDisplay > use C4::Languages qw(getTranslatedLanguages accept_language); > use C4::Koha qw( GetDailyQuote ); > >@@ -48,7 +47,11 @@ $template->param( > # use cookie setting for language, bug default to syspref if it's not set > my ($theme, $news_lang, $availablethemes) = C4::Templates::themelanguage(C4::Context->config('opachtdocs'),'opac-main.tt','opac',$input); > >-my $all_koha_news = &GetNewsToDisplay($news_lang); >+my $homebranch; >+if (C4::Context->userenv) { >+ $homebranch = C4::Context->userenv->{'branch'}; >+} >+my $all_koha_news = &GetNewsToDisplay($news_lang,$homebranch); > my $koha_news_count = scalar @$all_koha_news; > > my $quote = GetDailyQuote(); # other options are to pass in an exact quote id or select a random quote each pass... see perldoc C4::Koha >diff --git a/t/NewsChannels.t b/t/NewsChannels.t >deleted file mode 100755 >index bbcaab1..0000000 >--- a/t/NewsChannels.t >+++ /dev/null >@@ -1,14 +0,0 @@ >-#!/usr/bin/perl >-# >-# This Koha test module is a stub! >-# Add more tests here!!! >- >-use strict; >-use warnings; >- >-use Test::More tests => 1; >- >-BEGIN { >- use_ok('C4::NewsChannels'); >-} >- >diff --git a/t/db_dependent/NewsChannels.t b/t/db_dependent/NewsChannels.t >new file mode 100755 >index 0000000..8c417c5 >--- /dev/null >+++ b/t/db_dependent/NewsChannels.t >@@ -0,0 +1,120 @@ >+#!/usr/bin/perl >+# >+# This Koha test module is a stub! >+# Add more tests here!!! >+ >+use Modern::Perl; >+use C4::Dates qw(format_date); >+use C4::Branch qw(GetBranchName); >+use Test::More tests => 8; >+ >+BEGIN { >+ use_ok('C4::NewsChannels'); >+} >+ >+ >+my $dbh = C4::Context->dbh; >+ >+# Start transaction >+$dbh->{AutoCommit} = 0; >+$dbh->{RaiseError} = 1; >+ >+# Add LIB1, if it doesn't exist. >+my $addbra = 'LIB1'; >+$dbh->do(q{ >+ INSERT INTO branches (branchcode,branchname) VALUES (?,?) >+ }, undef, ($addbra, "$addbra branch") >+ ) unless GetBranchName($addbra); >+ >+# Test add_opac_new >+my $timestamp = '2000-01-01'; >+my $hashref_entry1 = { >+ 'title' => 'News Title', >+ 'new' => '<p>We have some exciting news!</p>', >+ 'lang' => '', >+ 'timestamp' => $timestamp, >+ 'expirationdate' => '2999-12-30', >+ 'number' => 1, >+ 'branchcode' => 'LIB1', >+ }; >+my $rv = add_opac_new( $hashref_entry1 ); >+ok($rv==1,"Successfully added the first dummy news item!"); >+ >+my $hashref_entry2 = { >+ "title" => 'News Title2', >+ "new" => '<p>We have some exciting news!</p>', >+ "lang" => '', >+ "timestamp" => $timestamp, >+ "expirationdate" => '2999-12-31', >+ "number" => 1, >+ "branchcode" => 'LIB1', >+ }; >+$rv = add_opac_new( $hashref_entry2 ); >+ok($rv==1,"Successfully added the second dummy news item!"); >+ >+# We need to determine the idnew in a non-MySQLism way. >+# This should be good enough. >+my $sth = $dbh->prepare(q{ >+ SELECT idnew from opac_news >+ WHERE timestamp='2000-01-01' AND >+ expirationdate='2999-12-30' AND >+ branchcode='LIB1'; >+ }); >+$sth->execute(); >+my $idnew1 = $sth->fetchrow; >+$sth = $dbh->prepare(q{ >+ SELECT idnew from opac_news >+ WHERE timestamp='2000-01-01' AND >+ expirationdate='2999-12-31' AND >+ branchcode='LIB1'; >+ }); >+$sth->execute(); >+my $idnew2 = $sth->fetchrow; >+ >+# Test upd_opac_new >+$hashref_entry2->{new} = '<p>Update! There is no news!</p>'; >+$hashref_entry2->{idnew} = $idnew2; >+$rv = upd_opac_new($hashref_entry2); >+ok($rv==1,"Successfully updated second dummy news item!"); >+ >+# Test get_opac_new (single news item) >+$hashref_entry1->{timestamp} = >+ format_date( $hashref_entry1->{timestamp} ); >+$hashref_entry1->{expirationdate} = >+ format_date( $hashref_entry1->{expirationdate} ); >+$hashref_entry2->{timestamp} = >+ format_date( $hashref_entry2->{timestamp} ); >+$hashref_entry2->{expirationdate} = >+ format_date( $hashref_entry2->{expirationdate} ); >+my $hashref_check = get_opac_new($idnew1); >+my $failure = 0; >+foreach my $key (keys %{$hashref_entry1}) { >+ if ($hashref_entry1->{$key} ne $hashref_check->{$key}) { >+ $failure = 1; >+ print STDERR "\nKey mismatch: " . $hashref_entry1->{$key} . " vs "; >+ print STDERR $hashref_check->{$key} . "\n"; >+ } >+} >+ok($failure==0,"Successfully tested get_opac_new id1!"); >+ >+# Test get_opac_new (single news item) >+$hashref_check = get_opac_new($idnew2); >+$failure = 0; >+foreach my $key (keys %{$hashref_entry2}) { >+ if ($hashref_entry2->{$key} ne $hashref_check->{$key}) { >+ $failure = 1; >+ print STDERR "\nKey mismatch: " . $hashref_entry1->{$key} . " vs "; >+ print STDERR $hashref_check->{$key} . "\n"; >+ } >+} >+ok($failure==0,"Successfully tested get_opac_new id2!"); >+ >+# Test get_opac_news (multiple news items) >+my ($opac_news_count, $arrayref_opac_news) = get_opac_news(0,'','LIB1'); >+ok($opac_news_count>=2,"Successfully tested get_opac_news for LIB1!"); >+ >+# Test GetNewsToDisplay >+($opac_news_count, $arrayref_opac_news) = GetNewsToDisplay('','LIB1'); >+ok($opac_news_count>=2,"Successfully tested GetNewsToDisplay for LIB1!"); >+ >+$dbh->rollback; >diff --git a/tools/koha-news.pl b/tools/koha-news.pl >index 4dd07a9..7ce26db 100755 >--- a/tools/koha-news.pl >+++ b/tools/koha-news.pl >@@ -32,6 +32,7 @@ use C4::Output; > use C4::NewsChannels; > use C4::Languages qw(getTranslatedLanguages); > use Date::Calc qw/Date_to_Days Today/; >+use C4::Branch qw/GetBranches/; > > my $cgi = new CGI; > >@@ -42,6 +43,11 @@ my $expirationdate = format_date_in_iso($cgi->param('expirationdate')); > my $timestamp = format_date_in_iso($cgi->param('timestamp')); > my $number = $cgi->param('number'); > my $lang = $cgi->param('lang'); >+my $branchcode = $cgi->param('branch'); >+# Foreign Key constraints work with NULL, not '' >+# NULL = All branches. >+$branchcode = undef if (defined($branchcode) && $branchcode eq ''); >+my $hashref_entry; > > my $new_detail = get_opac_new($id); > >@@ -67,9 +73,13 @@ foreach my $language ( @$tlangs ) { > }; > } > >-$template->param( lang_list => \@lang_list ); >+my $branches = GetBranches; > >-my $op = $cgi->param('op'); >+$template->param( lang_list => \@lang_list, >+ branch_list => $branches, >+ branchcode => $branchcode ); >+ >+my $op = $cgi->param('op') // ''; > > if ( $op eq 'add_form' ) { > $template->param( add_form => 1 ); >@@ -86,11 +96,30 @@ if ( $op eq 'add_form' ) { > } > } > elsif ( $op eq 'add' ) { >- add_opac_new( $title, $new, $lang, $expirationdate, $timestamp, $number ); >+ $hashref_entry = { >+ "title" => $title, >+ "new" => $new, >+ "lang" => $lang, >+ "timestamp" => $timestamp, >+ "expirationdate" => $expirationdate, >+ "number" => $number, >+ "branchcode" => $branchcode, >+ }; >+ add_opac_new( $hashref_entry ); > print $cgi->redirect("/cgi-bin/koha/tools/koha-news.pl"); > } > elsif ( $op eq 'edit' ) { >- upd_opac_new( $id, $title, $new, $lang, $expirationdate, $timestamp ,$number ); >+ $hashref_entry = { >+ "idnew" => $id, >+ "title" => $title, >+ "new" => $new, >+ "lang" => $lang, >+ "timestamp" => $timestamp, >+ "expirationdate" => $expirationdate, >+ "number" => $number, >+ "branchcode" => $branchcode, >+ }; >+ upd_opac_new( $hashref_entry ); > print $cgi->redirect("/cgi-bin/koha/tools/koha-news.pl"); > } > elsif ( $op eq 'del' ) { >@@ -101,7 +130,7 @@ elsif ( $op eq 'del' ) { > > else { > >- my ( $opac_news_count, $opac_news ) = &get_opac_news( undef, $lang ); >+ my ( $opac_news_count, $opac_news ) = &get_opac_news( 0, $lang, $branchcode ); > > foreach my $new ( @$opac_news ) { > next unless $new->{'expirationdate'}; >@@ -113,9 +142,9 @@ else { > } > > $template->param( >- $lang => 1, > opac_news => $opac_news, > opac_news_count => $opac_news_count, > ); >+ $template->param( lang => $lang ); > } > output_html_with_http_headers $cgi, $cookie, $template->output; >-- >1.7.9.5
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 7567
:
22863
|
22917
|
22920
|
23350
|
23351
|
23352
|
23362
|
23368
|
23378
|
23383
|
23386
|
23474
|
23475
|
23501
|
23544
|
23547
|
23552
|
23553
|
23554
|
23559
|
23664
|
23703
|
23704
|
23705
|
25316
|
25317
|
25318
|
25319
|
25320
|
25321
|
25322
|
25323
|
25324
|
25325
|
25331
|
25332
|
25333
|
26510
|
26511
|
26590
|
26591
|
26592
|
26593
|
26594
|
26595
|
26596
|
26597
|
26598
|
26599
|
26600
|
26601
|
26602
|
26603
|
26604
|
26605
|
26606
|
26607
|
26608
|
26609
|
26610
|
26611
|
26612
|
26631
|
26632
|
26633
|
26634
|
26635
|
26636
|
26637
|
26638
|
26639
|
26640
|
26641
|
26642
|
26643
|
26644
|
26647