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

(-)a/Koha/Hold.pm (+12 lines)
Lines 62-67 sub waiting_expires_on { Link Here
62
    return $dt;
62
    return $dt;
63
}
63
}
64
64
65
=head3 is_waiting
66
67
Returns true if hold is a waiting hold
68
69
=cut
70
71
sub is_waiting {
72
    my ($self) = @_;
73
74
    return $self->found() eq 'W';
75
}
76
65
=head3 biblio
77
=head3 biblio
66
78
67
Returns the related Koha::Biblio object for this hold
79
Returns the related Koha::Biblio object for this hold
(-)a/Koha/Item.pm (+25 lines)
Lines 47-52 sub effective_itemtype { Link Here
47
    return $self->_result()->effective_itemtype();
47
    return $self->_result()->effective_itemtype();
48
}
48
}
49
49
50
=head3 home_branch
51
52
=cut
53
54
sub home_branch {
55
    my ($self) = @_;
56
57
    $self->{_home_branch} ||= Koha::Branches->find( $self->homebranch() );
58
59
    return $self->{_home_branch};
60
}
61
62
=head3 holding_branch
63
64
=cut
65
66
sub holding_branch {
67
    my ($self) = @_;
68
69
    $self->{_holding_branch} ||= Koha::Branches->find( $self->holdingbranch() );
70
71
    return $self->{_holding_branch};
72
}
73
74
50
=head3 type
75
=head3 type
51
76
52
=cut
77
=cut
(-)a/svc/holds (-9 / +13 lines)
Lines 29-36 use C4::Charset; Link Here
29
use C4::Circulation qw(GetTransfers);
29
use C4::Circulation qw(GetTransfers);
30
use C4::Context;
30
use C4::Context;
31
31
32
use Koha::Database;
33
use Koha::DateUtils;
32
use Koha::DateUtils;
33
use Koha::Holds;
34
34
35
my $input = new CGI;
35
my $input = new CGI;
36
36
Lines 59-65 my $sorting_column = $sort_columns[ $input->param('iSortCol_0') ] Link Here
59
binmode STDOUT, ":encoding(UTF-8)";
59
binmode STDOUT, ":encoding(UTF-8)";
60
print $input->header( -type => 'text/plain', -charset => 'UTF-8' );
60
print $input->header( -type => 'text/plain', -charset => 'UTF-8' );
61
61
62
my $holds_rs = $schema->resultset('Reserve')->search(
62
my $holds_rs = Koha::Holds->search(
63
    { borrowernumber => $borrowernumber },
63
    { borrowernumber => $borrowernumber },
64
    {
64
    {
65
        prefetch => { 'item'                => 'biblio' },
65
        prefetch => { 'item'                => 'biblio' },
Lines 85-93 while ( my $h = $holds_rs->next() ) { Link Here
85
        suspend        => $h->suspend(),
85
        suspend        => $h->suspend(),
86
        suspend_until  => $h->suspend_until(),
86
        suspend_until  => $h->suspend_until(),
87
        found          => $h->found(),
87
        found          => $h->found(),
88
        waiting        => $h->found() eq 'W',
88
        waiting        => $h->is_waiting(),
89
        waiting_at     => $h->branchcode()->branchname(),
89
        waiting_at     => $h->branch()->branchname(),
90
        waiting_here   => $h->branchcode()->branchcode() eq $branch,
90
        waiting_here   => $h->branch()->branchcode() eq $branch,
91
        priority       => $h->priority(),
91
        priority       => $h->priority(),
92
        subtitle       => GetRecordValue(
92
        subtitle       => GetRecordValue(
93
            'subtitle', GetMarcBiblio($biblionumber),
93
            'subtitle', GetMarcBiblio($biblionumber),
Lines 107-112 while ( my $h = $holds_rs->next() ) { Link Here
107
        : q{},
107
        : q{},
108
    };
108
    };
109
109
110
    if ( my $e = $h->waiting_expires_on() ) {
111
        $hold->{expirationdate} = $e->ymd();
112
        $hold->{expirationdate_formatted} = output_pref( { dt => $e, dateonly => 1 });
113
    }
114
110
    $hold->{transfered}     = 0;
115
    $hold->{transfered}     = 0;
111
    $hold->{not_transfered} = 0;
116
    $hold->{not_transfered} = 0;
112
117
Lines 124-134 while ( my $h = $holds_rs->next() ) { Link Here
124
            $hold->{date_sent} = output_pref( dt_from_string($transferred_when) );
129
            $hold->{date_sent} = output_pref( dt_from_string($transferred_when) );
125
            $hold->{from_branch} = GetBranchName($transferred_from);
130
            $hold->{from_branch} = GetBranchName($transferred_from);
126
        }
131
        }
127
        elsif ( $item->holdingbranch()->branchcode() ne
132
        elsif ( $item->holding_branch()->branchcode() ne
128
            $h->branchcode()->branchcode() )
133
            $h->branch()->branchcode() )
129
        {
134
        {
130
            $hold->{not_transferred}    = 1;
135
            $hold->{not_transferred}    = 1;
131
            $hold->{not_transferred_by} = $h->item()->holdingbranch()->branchname();
136
            $hold->{not_transferred_by} = $h->item()->holding_branch()->branchname();
132
        }
137
        }
133
    }
138
    }
134
139
135
- 

Return to bug 13853