14 use Data::Dump qw(dump);
17 my $cache = Koha::Caches->get_instance();
21 concat_ws('',stocknumber,copynumber) as copynumber,
25 concat(branchname,' - ',authorised_values.lib) as location,
31 join authorised_values on (authorised_values.category = 'LOC' and authorised_values.authorised_value = items.location)
32 join branches on (holdingbranch = branchcode)
33 where biblionumber = ?
37 if ( my $biblionumber = $query->param('biblionumber') ) {
39 if ( $hash = $cache->get_from_cache( "vuFind-$biblionumber" ) ) {
40 warn "# $biblionumber HIT\n";
43 my $dbh = C4::Context->dbh;
44 my $sth = $dbh->prepare($sql);
46 $sth->execute( $biblionumber );
47 while ( my $row = $sth->fetchrow_hashref ) {
50 warn "# $biblionumber MISS\n";
51 $cache->set_in_cache( "vuFind-$biblionumber", $hash, { expiry => 5 * 60 } );
54 print "Content-type: application/json; charset=utf-8\r\n\r\n";
55 warn $query->remote_addr, " $0 ",dump($hash);
56 print encode_json $hash;