#
# This file is part of Koha.
#
-# Koha is free software; you can redistribute it and/or modify it under the
-# terms of the GNU General Public License as published by the Free Software
-# Foundation; either version 2 of the License, or (at your option) any later
-# version.
+# Koha is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
#
-# Koha is distributed in the hope that it will be useful, but WITHOUT ANY
-# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
-# A PARTICULAR PURPOSE. See the GNU General Public License for more details.
+# Koha is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
#
-# You should have received a copy of the GNU General Public License along
-# with Koha; if not, write to the Free Software Foundation, Inc.,
-# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+# You should have received a copy of the GNU General Public License
+# along with Koha; if not, see <http://www.gnu.org/licenses>.
use strict;
use C4::Review;
use C4::Ratings;
use C4::Members;
-use C4::VirtualShelves;
use C4::XSLT;
use C4::ShelfBrowser;
use C4::Reserves;
use C4::HTML5Media;
use C4::CourseReserves qw(GetItemCourseReservesInfo);
+use Koha::Virtualshelves;
+
BEGIN {
if (C4::Context->preference('BakerTaylorEnabled')) {
require C4::External::BakerTaylor;
query => $query,
type => "opac",
authnotrequired => ( C4::Context->preference("OpacPublic") ? 1 : 0 ),
- flagsrequired => { borrow => 1 },
}
);
}
-
-$template->param( 'AllowOnShelfHolds' => C4::Context->preference('AllowOnShelfHolds') );
$template->param( 'ItemsIssued' => CountItemsIssued( $biblionumber ) );
-
-
-
$template->param('OPACShowCheckoutName' => C4::Context->preference("OPACShowCheckoutName") );
$template->param('OPACShowBarcode' => C4::Context->preference("OPACShowBarcode") );
my $itemtype = $dat->{'itemtype'};
if ( $itemtype ) {
$dat->{'imageurl'} = getitemtypeimagelocation( 'opac', $itemtypes->{$itemtype}->{'imageurl'} );
- $dat->{'description'} = $itemtypes->{$itemtype}->{'description'};
+ $dat->{'description'} = $itemtypes->{$itemtype}->{translated_description};
}
my $shelflocations =GetKohaAuthorisedValues('items.location',$dat->{'frameworkcode'}, 'opac');
my $collections = GetKohaAuthorisedValues('items.ccode',$dat->{'frameworkcode'}, 'opac');
#coping with subscriptions
my $subscriptionsnumber = CountSubscriptionFromBiblionumber($biblionumber);
-my @subscriptions = GetSubscriptions($dat->{'title'}, $dat->{'issn'}, $ean, $biblionumber );
+my @subscriptions = SearchSubscriptions({ biblionumber => $biblionumber, orderby => 'title' });
my @subs;
$dat->{'serial'}=1 if $subscriptionsnumber;
items_count => scalar( @items ),
);
} else {
+ my $allow_onshelf_holds;
+ my $borrower = GetMember( 'borrowernumber' => $borrowernumber );
for my $itm (@items) {
$itm->{holds_count} = $item_reserves{ $itm->{itemnumber} };
$itm->{priority} = $priority{ $itm->{itemnumber} };
$norequests = 0
- if ( (not $itm->{'withdrawn'} )
- && (not $itm->{'itemlost'} )
- && ($itm->{'itemnotforloan'}<0 || not $itm->{'itemnotforloan'} )
- && (not $itemtypes->{$itm->{'itype'}}->{notforloan} )
- && ($itm->{'itemnumber'} ) );
+ if $norequests
+ && !$itm->{'withdrawn'}
+ && !$itm->{'itemlost'}
+ && ($itm->{'itemnotforloan'}<0 || not $itm->{'itemnotforloan'})
+ && !$itemtypes->{$itm->{'itype'}}->{notforloan}
+ && $itm->{'itemnumber'};
+
+ $allow_onshelf_holds = C4::Reserves::OnShelfHoldsAllowed( $itm, $borrower )
+ unless $allow_onshelf_holds;
# get collection code description, too
my $ccode = $itm->{'ccode'};
}
if (exists $itm->{itype} && defined($itm->{itype}) && exists $itemtypes->{ $itm->{itype} }) {
$itm->{'imageurl'} = getitemtypeimagelocation( 'opac', $itemtypes->{ $itm->{itype} }->{'imageurl'} );
- $itm->{'description'} = $itemtypes->{ $itm->{itype} }->{'description'};
+ $itm->{'description'} = $itemtypes->{ $itm->{itype} }->{translated_description};
}
foreach (qw(ccode enumchron copynumber itemnotes uri)) {
$itemfields{$_} = 1 if ($itm->{$_});
push @itemloop, $itm;
}
}
+ $template->param( 'AllowOnShelfHolds' => $allow_onshelf_holds );
}
# Display only one tab if one items list is empty
}
## get notes and subjects from MARC record
-my $dbh = C4::Context->dbh;
+if (!C4::Context->preference("OPACXSLTDetailsDisplay") ) {
+ my $marcisbnsarray = GetMarcISBN ($record,$marcflavour);
+ my $marcauthorsarray = GetMarcAuthors ($record,$marcflavour);
+ my $marcsubjctsarray = GetMarcSubjects($record,$marcflavour);
+ my $marcseriesarray = GetMarcSeries ($record,$marcflavour);
+ my $marcurlsarray = GetMarcUrls ($record,$marcflavour);
+ my $marchostsarray = GetMarcHosts($record,$marcflavour);
+
+ $template->param(
+ MARCSUBJCTS => $marcsubjctsarray,
+ MARCAUTHORS => $marcauthorsarray,
+ MARCSERIES => $marcseriesarray,
+ MARCURLS => $marcurlsarray,
+ MARCISBNS => $marcisbnsarray,
+ MARCHOSTS => $marchostsarray,
+ );
+}
+
my $marcnotesarray = GetMarcNotes ($record,$marcflavour);
-my $marcisbnsarray = GetMarcISBN ($record,$marcflavour);
-my $marcauthorsarray = GetMarcAuthors ($record,$marcflavour);
-my $marcsubjctsarray = GetMarcSubjects($record,$marcflavour);
-my $marcseriesarray = GetMarcSeries ($record,$marcflavour);
-my $marcurlsarray = GetMarcUrls ($record,$marcflavour);
-my $marchostsarray = GetMarcHosts($record,$marcflavour);
my $subtitle = GetRecordValue('subtitle', $record, GetFrameworkCode($biblionumber));
$template->param(
MARCNOTES => $marcnotesarray,
- MARCSUBJCTS => $marcsubjctsarray,
- MARCAUTHORS => $marcauthorsarray,
- MARCSERIES => $marcseriesarray,
- MARCURLS => $marcurlsarray,
- MARCISBNS => $marcisbnsarray,
- MARCHOSTS => $marchostsarray,
norequests => $norequests,
RequestOnOpac => C4::Context->preference("RequestOnOpac"),
itemdata_ccode => $itemfields{ccode},
);
# Lists
-
if (C4::Context->preference("virtualshelves") ) {
- $template->param( 'GetShelves' => GetBibliosShelves( $biblionumber ) );
+ my $shelves = Koha::Virtualshelves->search(
+ {
+ biblionumber => $biblionumber,
+ category => 2,
+ },
+ {
+ join => 'virtualshelfcontents',
+ }
+ );
+ $template->param( shelves => $shelves );
}
-
# XISBN Stuff
if (C4::Context->preference("OPACFRBRizeEditions")==1) {
eval {
$template->param('OPACSearchForTitleIn' => $search_for_title);
}
+#IDREF
+if ( C4::Context->preference("IDREF") ) {
+ # If the record comes from the SUDOC
+ if ( $record->field('009') ) {
+ my $unimarc3 = $record->field("009")->data;
+ if ( $unimarc3 =~ /^\d+$/ ) {
+ $template->param(
+ IDREF => 1,
+ );
+ }
+ }
+}
+
# We try to select the best default tab to show, according to what
# the user wants, and what's available for display
my $opac_serial_default = C4::Context->preference('opacSerialDefaultTab');