projects
/
google-map-tiles.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fix biblionumber
[google-map-tiles.git]
/
koha.pl
diff --git
a/koha.pl
b/koha.pl
index
b9de0ce
..
7e34821
100755
(executable)
--- a/
koha.pl
+++ b/
koha.pl
@@
-14,6
+14,8
@@
my $zoom = param('ZOOM') ;
my $maxpix = 15 ; # Maximum pixels between click and point
my $maxpix = 15 ; # Maximum pixels between click and point
+my $limit_books = 100; # max. for one click
+
print qq{Content-type: text/xml\r\n\r\n};
print qq{<?xml version="1.0" encoding="UTF-8"?>\n} ;
print qq!<map>\n! ;
print qq{Content-type: text/xml\r\n\r\n};
print qq{<?xml version="1.0" encoding="UTF-8"?>\n} ;
print qq!<map>\n! ;
@@
-37,7
+39,7
@@
if ( $point =~ /(.*),(.*)/ )
my $sql = qq{
select
my $sql = qq{
select
- city
+ city
_koha
,country
,count
,point
,country
,count
,point
@@
-64,19
+66,26
@@
limit 1
my $sth = $dbh->prepare(qq{
select
my $sth = $dbh->prepare(qq{
select
- author, title,
bi.biblionumber
+ author, title,
max(bi.biblionumber) as biblionumber, count(title)
from geo_city c
join geo_biblioitems bi on bi.city = c.city_koha
join biblio b on b.biblionumber = bi.biblionumber
from geo_city c
join geo_biblioitems bi on bi.city = c.city_koha
join biblio b on b.biblionumber = bi.biblionumber
-where c.city = ? and country = ?
-order by timestamp
-limit 100
+where c.city_koha = ? and country = ?
+group by author, title
+order by min(timestamp)
+limit $limit_books
});
$sth->execute( $city, $country );
});
$sth->execute( $city, $country );
- $count = $sth->rows if $sth->rows > $count;
+ my $rows = $sth->rows;
+ if ( $rows == $limit_books ) {
+ $rows = "more than $rows";
+ $rows = $count if $count > $rows;
+ };
+ my $books = 'books';
+ $books = 'book' if $rows == 1;
- my $descript = "<b>$city</b> <em>$country</em>
$count items
\n<ol>";
+ my $descript = "<b>$city</b> <em>$country</em>
<small>$rows $books</small>
\n<ol>";
while ( my $row = $sth->fetchrow_hashref ) {
$descript .= sprintf qq|<li><a target="koha" href="http://koha.ffzg.hr/cgi-bin/koha/opac-detail.pl?biblionumber=%d">%s</a> %s\n|,
while ( my $row = $sth->fetchrow_hashref ) {
$descript .= sprintf qq|<li><a target="koha" href="http://koha.ffzg.hr/cgi-bin/koha/opac-detail.pl?biblionumber=%d">%s</a> %s\n|,