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

(-)a/basket/basket.pl (-1 / +1 lines)
Lines 89-95 foreach my $biblionumber ( @bibs ) { Link Here
89
89
90
    $num++;
90
    $num++;
91
    $dat->{biblionumber} = $biblionumber;
91
    $dat->{biblionumber} = $biblionumber;
92
    $dat->{ITEM_RESULTS}   = $biblio->items;
92
    $dat->{ITEM_RESULTS}   = $biblio->items->search_ordered;
93
    $dat->{MARCNOTES}      = $marcnotesarray;
93
    $dat->{MARCNOTES}      = $marcnotesarray;
94
    $dat->{MARCSUBJCTS}    = $marcsubjctsarray;
94
    $dat->{MARCSUBJCTS}    = $marcsubjctsarray;
95
    $dat->{MARCAUTHORS}    = $marcauthorsarray;
95
    $dat->{MARCAUTHORS}    = $marcauthorsarray;
(-)a/basket/sendbasket.pl (-1 / +1 lines)
Lines 85-91 if ( $email_add ) { Link Here
85
        $dat->{MARCAUTHORS}    = $marcauthorsarray;
85
        $dat->{MARCAUTHORS}    = $marcauthorsarray;
86
        $dat->{HASAUTHORS}     = $hasauthors;
86
        $dat->{HASAUTHORS}     = $hasauthors;
87
        $dat->{'biblionumber'} = $biblionumber;
87
        $dat->{'biblionumber'} = $biblionumber;
88
        $dat->{ITEM_RESULTS}   = $biblio->items;
88
        $dat->{ITEM_RESULTS}   = $biblio->items->search_ordered;
89
89
90
        $iso2709 .= $record->as_usmarc();
90
        $iso2709 .= $record->as_usmarc();
91
91
(-)a/opac/opac-detail.pl (-4 / +4 lines)
Lines 114-122 unless ( $biblio && $record ) { Link Here
114
    exit;
114
    exit;
115
}
115
}
116
116
117
my $items = $biblio->items;
117
my $items = $biblio->items->search_ordered;
118
if ($specific_item) {
118
if ($specific_item) {
119
    $items->search( { itemnumber => scalar $query->param('itemnumber') } );
119
    $items = $items->search( { itemnumber => scalar $query->param('itemnumber') } );
120
    $template->param( specific_item => 1 );
120
    $template->param( specific_item => 1 );
121
}
121
}
122
122
Lines 496-504 $template->param( Link Here
496
496
497
my $host_items = $biblio->host_items->filter_by_visible_in_opac({ patron => $patron });
497
my $host_items = $biblio->host_items->filter_by_visible_in_opac({ patron => $patron });
498
498
499
$items = $biblio->items->search(
499
$items = $biblio->items->search_ordered(
500
    {
500
    {
501
        itemnumber => {
501
        'me.itemnumber' => {
502
            -in => [
502
            -in => [
503
                $items->get_column('itemnumber'),
503
                $items->get_column('itemnumber'),
504
                $host_items->get_column('itemnumber')
504
                $host_items->get_column('itemnumber')
(-)a/opac/opac-reserve.pl (-2 / +2 lines)
Lines 155-161 foreach my $biblioNumber (@biblionumbers) { Link Here
155
      $biblio->items->filter_by_visible_in_opac( { patron => $patron } );
155
      $biblio->items->filter_by_visible_in_opac( { patron => $patron } );
156
    my $host_items =
156
    my $host_items =
157
      $biblio->host_items->filter_by_visible_in_opac( { patron => $patron } );
157
      $biblio->host_items->filter_by_visible_in_opac( { patron => $patron } );
158
    $items = $biblio->items->search(
158
    $items = $biblio->items->search_ordered(
159
        {
159
        {
160
            itemnumber => {
160
            itemnumber => {
161
                -in => [
161
                -in => [
Lines 571-577 foreach my $biblioNum (@biblionumbers) { Link Here
571
571
572
    if ( $biblioLoopIter{holdable} and C4::Context->preference('AllowHoldItemTypeSelection') ) {
572
    if ( $biblioLoopIter{holdable} and C4::Context->preference('AllowHoldItemTypeSelection') ) {
573
        # build the allowed item types loop
573
        # build the allowed item types loop
574
        my $rs = $biblio->items->search(
574
        my $rs = $biblio->items->search_ordered(
575
            undef,
575
            undef,
576
            {   select => [ { distinct => 'itype' } ],
576
            {   select => [ { distinct => 'itype' } ],
577
                as     => 'item_type'
577
                as     => 'item_type'
(-)a/opac/opac-sendbasket.pl (-1 / +1 lines)
Lines 85-91 if ( $email_add ) { Link Here
85
        my $marcauthorsarray = $biblio->get_marc_authors;
85
        my $marcauthorsarray = $biblio->get_marc_authors;
86
        my $marcsubjctsarray = GetMarcSubjects( $record, $marcflavour );
86
        my $marcsubjctsarray = GetMarcSubjects( $record, $marcflavour );
87
87
88
        my $items = $biblio->items->filter_by_visible_in_opac({ patron => $patron });
88
        my $items = $biblio->items->search_ordered->filter_by_visible_in_opac({ patron => $patron });
89
89
90
        my $hasauthors = 0;
90
        my $hasauthors = 0;
91
        if($dat->{'author'} || @$marcauthorsarray) {
91
        if($dat->{'author'} || @$marcauthorsarray) {
(-)a/opac/opac-sendshelf.pl (-1 / +1 lines)
Lines 94-100 if ( $shelf and $shelf->can_be_viewed( $borrowernumber ) ) { Link Here
94
        my $marcauthorsarray = $biblio->get_marc_authors;
94
        my $marcauthorsarray = $biblio->get_marc_authors;
95
        my $marcsubjctsarray = GetMarcSubjects( $record, $marcflavour );
95
        my $marcsubjctsarray = GetMarcSubjects( $record, $marcflavour );
96
96
97
        my $items = $biblio->items->filter_by_visible_in_opac({ patron => $patron });
97
        my $items = $biblio->items->search_ordered->filter_by_visible_in_opac({ patron => $patron });
98
98
99
        $dat->{ISBN}           = GetMarcISBN($record, $marcflavour);
99
        $dat->{ISBN}           = GetMarcISBN($record, $marcflavour);
100
        $dat->{MARCSUBJCTS}    = $marcsubjctsarray;
100
        $dat->{MARCSUBJCTS}    = $marcsubjctsarray;
(-)a/opac/opac-tags.pl (-1 / +1 lines)
Lines 260-266 if ($loggedinuser) { Link Here
260
        next unless $record;
260
        next unless $record;
261
        my @hidden_items;
261
        my @hidden_items;
262
        if ($should_hide) {
262
        if ($should_hide) {
263
            my $items = $biblio->items;
263
            my $items = $biblio->items->search_ordered;
264
            my @all_itemnumbers = $items->get_column('itemnumber');
264
            my @all_itemnumbers = $items->get_column('itemnumber');
265
            my @items_to_show = $items->filter_by_visible_in_opac({ opac => 1, patron => $patron })->as_list;
265
            my @items_to_show = $items->filter_by_visible_in_opac({ opac => 1, patron => $patron })->as_list;
266
            @hidden_items = array_minus( @all_itemnumbers, @items_to_show );
266
            @hidden_items = array_minus( @all_itemnumbers, @items_to_show );
(-)a/serials/routing-preview.pl (-1 / +1 lines)
Lines 63-69 if($ok){ Link Here
63
    my $biblionumber = $subs->{'bibnum'};
63
    my $biblionumber = $subs->{'bibnum'};
64
64
65
    my $biblio = Koha::Biblios->find( $biblionumber );
65
    my $biblio = Koha::Biblios->find( $biblionumber );
66
    my $items = $biblio->items->search;
66
    my $items = $biblio->items->search_ordered;
67
    my $branch =
67
    my $branch =
68
        $items->count
68
        $items->count
69
      ? $items->next->holding_branch->branchcode
69
      ? $items->next->holding_branch->branchcode
(-)a/tags/list.pl (-2 / +3 lines)
Lines 26-32 use C4::Context; Link Here
26
use C4::Tags qw( get_tag_rows get_tags remove_tag );
26
use C4::Tags qw( get_tag_rows get_tags remove_tag );
27
use C4::Output qw( output_html_with_http_headers );
27
use C4::Output qw( output_html_with_http_headers );
28
28
29
use Koha::Items;
29
use Koha::Biblios;
30
30
31
my $needed_flags = { tools => 'moderate_tags'
31
my $needed_flags = { tools => 'moderate_tags'
32
};    # FIXME: replace when more specific permission is created.
32
};    # FIXME: replace when more specific permission is created.
Lines 60-66 else { Link Here
60
        for ( @{$taglist} ) {
60
        for ( @{$taglist} ) {
61
            # FIXME We should use Koha::Biblio here
61
            # FIXME We should use Koha::Biblio here
62
            my $dat    = &GetBiblioData( $_->{biblionumber} );
62
            my $dat    = &GetBiblioData( $_->{biblionumber} );
63
            my $items = Koha::Items->search({ biblionumber => $dat->{biblionumber} });
63
            my $biblio = Koha::Biblios->find($dat->{biblionumber});
64
            my $items = $biblio->items->search_ordered;
64
            $dat->{biblionumber} = $_->{biblionumber};
65
            $dat->{biblionumber} = $_->{biblionumber};
65
            $dat->{tag_id}       = $_->{tag_id};
66
            $dat->{tag_id}       = $_->{tag_id};
66
            $dat->{items}        = $items;
67
            $dat->{items}        = $items;
(-)a/virtualshelves/sendshelf.pl (-2 / +1 lines)
Lines 82-88 if ($to_address) { Link Here
82
        my $marcauthorsarray = $biblio->get_marc_authors;
82
        my $marcauthorsarray = $biblio->get_marc_authors;
83
        my $marcsubjctsarray = GetMarcSubjects( $record, $marcflavour );
83
        my $marcsubjctsarray = GetMarcSubjects( $record, $marcflavour );
84
84
85
        my $items = $biblio->items;
85
        my $items = $biblio->items->search_ordered;
86
86
87
        $dat->{ISBN}           = GetMarcISBN($record, $marcflavour);
87
        $dat->{ISBN}           = GetMarcISBN($record, $marcflavour);
88
        $dat->{MARCSUBJCTS}    = $marcsubjctsarray;
88
        $dat->{MARCSUBJCTS}    = $marcsubjctsarray;
89
- 

Return to bug 27272