View | Details | Raw Unified | Return to bug 10584
Collapse All | Expand All

(-)a/C4/Items.pm (+1 lines)
Lines 30-35 use MARC::Record; Link Here
30
use C4::ClassSource;
30
use C4::ClassSource;
31
use C4::Log;
31
use C4::Log;
32
use List::MoreUtils qw/any/;
32
use List::MoreUtils qw/any/;
33
use YAML qw/Load/;
33
use Data::Dumper; # used as part of logging item record changes, not just for
34
use Data::Dumper; # used as part of logging item record changes, not just for
34
                  # debugging; so please don't remove this
35
                  # debugging; so please don't remove this
35
36
(-)a/opac/opac-ISBDdetail.pl (-1 / +11 lines)
Lines 84-89 $template->param( 'AllowOnShelfHolds' => C4::Context->preference('AllowOnShelfHo Link Here
84
$template->param( 'ItemsIssued' => CountItemsIssued( $biblionumber ) );
84
$template->param( 'ItemsIssued' => CountItemsIssued( $biblionumber ) );
85
85
86
my $marcflavour      = C4::Context->preference("marcflavour");
86
my $marcflavour      = C4::Context->preference("marcflavour");
87
88
my @items = GetItemsInfo($biblionumber);
89
if (scalar @items >= 1) {
90
    my @hiddenitems = GetHiddenItemnumbers(@items);
91
92
    if (scalar @hiddenitems == scalar @items ) {
93
        print $query->redirect("/cgi-bin/koha/errors/404.pl"); # escape early
94
        exit;
95
    }
96
}
97
87
my $record = GetMarcBiblio($biblionumber);
98
my $record = GetMarcBiblio($biblionumber);
88
if ( ! $record ) {
99
if ( ! $record ) {
89
    print $query->redirect("/cgi-bin/koha/errors/404.pl");
100
    print $query->redirect("/cgi-bin/koha/errors/404.pl");
Lines 138-144 $template->param( Link Here
138
149
139
my $norequests = 1;
150
my $norequests = 1;
140
my $res = GetISBDView($biblionumber, "opac");
151
my $res = GetISBDView($biblionumber, "opac");
141
my @items = GetItemsInfo( $biblionumber );
142
152
143
my $itemtypes = GetItemTypes();
153
my $itemtypes = GetItemTypes();
144
for my $itm (@items) {
154
for my $itm (@items) {
(-)a/opac/opac-MARCdetail.pl (+15 lines)
Lines 50-55 use C4::Output; Link Here
50
use CGI;
50
use CGI;
51
use MARC::Record;
51
use MARC::Record;
52
use C4::Biblio;
52
use C4::Biblio;
53
use C4::Items;
53
use C4::Acquisition;
54
use C4::Acquisition;
54
use C4::Koha;
55
use C4::Koha;
55
56
Lines 62-67 my $itemtype = &GetFrameworkCode($biblionumber); Link Here
62
my $tagslib      = &GetMarcStructure( 0, $itemtype );
63
my $tagslib      = &GetMarcStructure( 0, $itemtype );
63
my $biblio = GetBiblioData($biblionumber);
64
my $biblio = GetBiblioData($biblionumber);
64
$biblionumber = $biblio->{biblionumber};
65
$biblionumber = $biblio->{biblionumber};
66
67
print STDERR "biblionumber: $biblionumber\n";
68
my @all_items = GetItemsInfo($biblionumber);
69
if (scalar @all_items >= 1) {
70
    my @hiddenitems = GetHiddenItemnumbers(@all_items);
71
    print STDERR "Scalar GHI: " . (scalar @hiddenitems) . "\n";
72
73
    if (scalar @hiddenitems == scalar @all_items ) {
74
        print $query->redirect("/cgi-bin/koha/errors/404.pl"); # escape early
75
        exit;
76
    }
77
}
78
print STDERR "Scalar AI: " . (scalar @all_items) . "\n";
79
65
my $record = GetMarcBiblio($biblionumber, 1);
80
my $record = GetMarcBiblio($biblionumber, 1);
66
if ( ! $record ) {
81
if ( ! $record ) {
67
    print $query->redirect("/cgi-bin/koha/errors/404.pl");
82
    print $query->redirect("/cgi-bin/koha/errors/404.pl");
(-)a/opac/opac-detail.pl (-7 / +12 lines)
Lines 70-78 my ( $template, $borrowernumber, $cookie ) = get_template_and_user( Link Here
70
    }
70
    }
71
);
71
);
72
72
73
my $biblionumber = $query->param('biblionumber') || $query->param('bib');
73
my $biblionumber = $query->param('biblionumber') || $query->param('bib') || 0;
74
$biblionumber = int($biblionumber);
74
$biblionumber = int($biblionumber);
75
75
76
my @all_items = GetItemsInfo($biblionumber);
77
my @hiddenitems;
78
if (scalar @all_items >= 1) {
79
    push @hiddenitems, GetHiddenItemnumbers(@all_items);
80
81
    if (scalar @hiddenitems == scalar @all_items ) {
82
        print $query->redirect("/cgi-bin/koha/errors/404.pl"); # escape early
83
        exit;
84
    }
85
}
86
76
my $record       = GetMarcBiblio($biblionumber);
87
my $record       = GetMarcBiblio($biblionumber);
77
if ( ! $record ) {
88
if ( ! $record ) {
78
    print $query->redirect("/cgi-bin/koha/errors/404.pl"); # escape early
89
    print $query->redirect("/cgi-bin/koha/errors/404.pl"); # escape early
Lines 397-404 $template->param( 'ItemsIssued' => CountItemsIssued( $biblionumber ) ); Link Here
397
408
398
$template->param('OPACShowCheckoutName' => C4::Context->preference("OPACShowCheckoutName") );
409
$template->param('OPACShowCheckoutName' => C4::Context->preference("OPACShowCheckoutName") );
399
$template->param('OPACShowBarcode' => C4::Context->preference("OPACShowBarcode") );
410
$template->param('OPACShowBarcode' => C4::Context->preference("OPACShowBarcode") );
400
# change back when ive fixed request.pl
401
my @all_items = GetItemsInfo( $biblionumber );
402
411
403
# adding items linked via host biblios
412
# adding items linked via host biblios
404
413
Lines 421-429 foreach my $hostfield ( $record->field($analyticfield)) { Link Here
421
430
422
my @items;
431
my @items;
423
432
424
# Getting items to be hidden
425
my @hiddenitems = GetHiddenItemnumbers(@all_items);
426
427
# Are there items to hide?
433
# Are there items to hide?
428
my $hideitems;
434
my $hideitems;
429
$hideitems = 1 if C4::Context->preference('hidelostitems') or scalar(@hiddenitems) > 0;
435
$hideitems = 1 if C4::Context->preference('hidelostitems') or scalar(@hiddenitems) > 0;
430
- 

Return to bug 10584