diff --git a/C4/Biblio.pm b/C4/Biblio.pm index 822b5abfd1..550e34eb68 100755 --- a/C4/Biblio.pm +++ b/C4/Biblio.pm @@ -69,7 +69,7 @@ BEGIN { GetMarcUrls &GetUsedMarcStructure &GetXmlBiblio - &GetCOinSBiblio + &GetCOinSBiblio &GetAuthorisedValueDesc &GetMarcStructure @@ -77,6 +77,8 @@ BEGIN { &GetFrameworkCode &GetPublisherNameFromIsbn &TransformKohaToMarc + + &CountItemsIssued ); # To modify something @@ -2013,6 +2015,15 @@ more. =cut +sub CountItemsIssued { + my ( $biblionumber ) = @_; + my $dbh = C4::Context->dbh; + my $sth = $dbh->prepare('SELECT COUNT(*) as issuedCount FROM items, issues WHERE items.itemnumber = issues.itemnumber AND items.biblionumber = ?'); + $sth->execute( $biblionumber ); + my $row = $sth->fetchrow_hashref(); + return $row->{'issuedCount'}; +} + sub _disambiguate { my ($table, $column) = @_; if ($column eq "cn_sort" or $column eq "cn_source") { diff --git a/koha-tmpl/opac-tmpl/prog/en/modules/opac-ISBDdetail.tmpl b/koha-tmpl/opac-tmpl/prog/en/modules/opac-ISBDdetail.tmpl index 5244ff3f35..7f40c2615c 100644 --- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-ISBDdetail.tmpl +++ b/koha-tmpl/opac-tmpl/prog/en/modules/opac-ISBDdetail.tmpl @@ -161,11 +161,18 @@ - -
+ + + + + ">Place Hold + + + ">Place Hold + + + + + + " title="Click to add to cart" /> "> diff --git a/koha-tmpl/opac-tmpl/prog/en/modules/opac-results.tmpl b/koha-tmpl/opac-tmpl/prog/en/modules/opac-results.tmpl index e63a3c27db..b217aeb62a 100644 --- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-results.tmpl +++ b/koha-tmpl/opac-tmpl/prog/en/modules/opac-results.tmpl @@ -366,7 +366,20 @@ $("span.addto").html(param1); Match: Actions: - ">Place Hold + + + + + ">Place Hold + + + ">Place Hold + + + + + + " onclick="Dopop('opac-addbybiblionumber.pl?biblionumber='); return false;">Save to Lists diff --git a/opac/opac-MARCdetail.pl b/opac/opac-MARCdetail.pl index a372826042..51d1579be1 100755 --- a/opac/opac-MARCdetail.pl +++ b/opac/opac-MARCdetail.pl @@ -74,6 +74,9 @@ $template->param( bibliotitle => $biblio->{title}, ); +$template->param( 'AllowOnShelfHolds' => C4::Context->preference('AllowOnShelfHolds') ); +$template->param( 'ItemsIssued' => CountItemsIssued( $biblionumber ) ); + # adding the $RequestOnOpac param my $RequestOnOpac; if (C4::Context->preference("RequestOnOpac")) { diff --git a/opac/opac-detail.pl b/opac/opac-detail.pl index 611cdc4b24..9c01eaf000 100755 --- a/opac/opac-detail.pl +++ b/opac/opac-detail.pl @@ -58,6 +58,10 @@ my ( $template, $borrowernumber, $cookie ) = get_template_and_user( ); my $biblionumber = $query->param('biblionumber') || $query->param('bib'); + +$template->param( 'AllowOnShelfHolds' => C4::Context->preference('AllowOnShelfHolds') ); +$template->param( 'ItemsIssued' => CountItemsIssued( $biblionumber ) ); + my $record = GetMarcBiblio($biblionumber); $template->param( biblionumber => $biblionumber ); # XSLT processing of some stuff diff --git a/opac/opac-search.pl b/opac/opac-search.pl index e48a017d9f..0cfb802dd2 100755 --- a/opac/opac-search.pl +++ b/opac/opac-search.pl @@ -72,6 +72,7 @@ if (C4::Context->preference("marcflavour") eq "UNIMARC" ) { elsif (C4::Context->preference("marcflavour") eq "MARC21" ) { $template->param('usmarc' => 1); } +$template->param( 'AllowOnShelfHolds' => C4::Context->preference('AllowOnShelfHolds') ); if (C4::Context->preference('BakerTaylorEnabled')) { $template->param( @@ -421,6 +422,7 @@ for (my $i=0;$i<=@servers;$i++) { $tag_quantity = C4::Context->preference('TagsShowOnList')) { foreach (@newresults) { my $bibnum = $_->{biblionumber} or next; + $_->{itemsissued} = CountItemsIssued( $bibnum ); $_ ->{'TagLoop'} = get_tags({biblionumber=>$bibnum, approved=>1, 'sort'=>'-weight', limit=>$tag_quantity }); }