3 # Copyright 2013 Chris Cormack <chris@bigballofwax.co.nz>
5 # This file is part of Koha.
7 # Koha is free software; you can redistribute it and/or modify it under the
8 # terms of the GNU General Public License as published by the Free Software
9 # Foundation; either version 3 of the License, or (at your option) any later
12 # Koha is distributed in the hope that it will be useful, but WITHOUT ANY
13 # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
14 # A PARTICULAR PURPOSE. See the GNU General Public License for more details.
16 # You should have received a copy of the GNU General Public License along
17 # with Koha; if not, write to the Free Software Foundation, Inc.,
18 # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
30 my $query = CGI->new();
32 my $cache_active = Koha::Cache->is_cache_active;
34 my ( $cache_key, $cache, $ratings_xml );
36 $cache_key = "opac:ratings:";
37 $cache = Koha::Cache->new();
38 $ratings_xml = $cache->get_from_cache($cache_key);
40 unless ($ratings_xml) {
41 my $marcflavour = C4::Context->preference("MARCFLAVOUR");
42 my $ratings = AllRatings();
43 foreach my $rating (@$ratings){
44 my $record = GetMarcBiblio($rating->{'biblionumber'});
45 my $isbn = GetMarcISBN($record,$marcflavour);
46 my $issn = GetMarcISSN($record,$marcflavour);
47 $rating->{ISBN}=$isbn;
48 $rating->{ISSN}=$issn;
50 my $dump = new XML::Dumper;
51 $ratings_xml = $dump->pl2xml($ratings);