&ModShelf
&ShelfPossibleAction
&DelFromShelf &DelShelf
+ &GetBibliosShelves
);
@EXPORT_OK = qw(
&GetShelvesSummary &GetRecentShelves
return $sth->execute(shift);
}
+=item GetBibShelves
+
+This finds all the lists that this bib record is in.
+
+=cut
+
+sub GetBibliosShelves {
+ my ( $biblionumber ) = @_;
+ my $dbh = C4::Context->dbh;
+ my $sth = $dbh->prepare('SELECT vs.shelfname, vs.shelfnumber FROM virtualshelves vs LEFT JOIN virtualshelfcontents vc ON (vs.shelfnumber= vc.shelfnumber) WHERE vs.category != 1 AND vc.biblionumber= ?');
+ $sth->execute( $biblionumber );
+ my @lists;
+ while (my $data = $sth->fetchrow_hashref){
+ push @lists,$data;
+ }
+ return \@lists;
+}
+
=item RefreshShelvesSummary
($total, $pubshelves, $barshelves) = RefreshShelvesSummary($sessionID, $loggedinuser, $row_count);
use C4::XISBN qw(get_xisbns get_biblionumber_from_isbn);
use C4::External::Amazon;
use C4::Search; # enabled_staff_search_views
+use C4::VirtualShelves;
# use Smart::Comments;
# $debug and $template->param(debug_display => 1);
+# Lists
+
+if (C4::Context->preference("virtualshelves") ) {
+ $template->param( 'GetShelves' => GetBibliosShelves( $biblionumber ) );
+}
+
# XISBN Stuff
if (C4::Context->preference("FRBRizeEditions")==1) {
eval {
<!-- /TMPL_LOOP --></ul>
</li>
<!-- /TMPL_IF -->
+
<!-- TMPL_IF name="OpacUrl" -->
<li><strong>OPAC View:</strong>
<a href="http://<!-- TMPL_VAR name="OpacUrl" -->/cgi-bin/koha/opac-detail.pl?biblionumber=<!-- TMPL_VAR NAME="biblionumber" -->" target="_blank">Open in new window</a>
<!-- /TMPL_LOOP -->
</li>
<!-- /TMPL_IF -->
+ <!--This grabs all of the lists a bib record appears in -->
+ <!-- TMPL_IF NAME="GetShelves" -->
+ <li><strong>Lists that include this title: </strong>
+ <ul>
+ <!-- TMPL_LOOP NAME="GetShelves" -->
+ <li><a href="/cgi-bin/koha/virtualshelves/shelves.pl?viewshelf=<!-- TMPL_VAR NAME="shelfnumber" -->"><!-- TMPL_VAR NAME="shelfname" --></a></li>
+ <!-- /TMPL_LOOP -->
+ </ul>
+ </li>
+ <!-- /TMPL_IF -->
</ul>
</div>
</div>
</span>
<!-- /TMPL_IF -->
+<!--This grabs all of the lists a bib record appears in -->
+<!-- TMPL_IF NAME="GetShelves" -->
+ <span class="results_summary"><span class="label">List(s) this item appears in: </span>
+ <!-- TMPL_LOOP NAME="GetShelves" -->
+ <a href="/cgi-bin/koha/opac-shelves.pl?viewshelf=<!-- TMPL_VAR NAME="shelfnumber" -->&sortfield=title"><!-- TMPL_VAR NAME="shelfname" --></a>
+ <!-- TMPL_IF NAME="__LAST__" --><!-- TMPL_ELSE -->|<!-- /TMPL_IF -->
+ <!-- /TMPL_LOOP -->
+ </span>
+<!-- /TMPL_IF -->
<!-- TMPL_IF NAME="TagsShowOnDetail" -->
<div class="results_summary">
use C4::Review;
use C4::Serials;
use C4::Members;
+use C4::VirtualShelves;
use C4::XSLT;
BEGIN {
loggedincommenter => $loggedincommenter
);
+# Lists
+
+if (C4::Context->preference("virtualshelves") ) {
+ $template->param( 'GetShelves' => GetBibliosShelves( $biblionumber ) );
+}
+
+
# XISBN Stuff
if (C4::Context->preference("OPACFRBRizeEditions")==1) {
eval {