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

(-)a/misc/cronjobs/holds/build_holds_queue.pl (-3 / +5 lines)
Lines 21-26 use C4::Search; Link Here
21
use C4::Items;
21
use C4::Items;
22
use C4::Branch;
22
use C4::Branch;
23
use C4::Circulation;
23
use C4::Circulation;
24
use C4::IssuingRules;
24
use C4::Members;
25
use C4::Members;
25
use C4::Biblio;
26
use C4::Biblio;
26
27
Lines 188-196 sub GetItemsAvailableToFillHoldRequestsForBib { Link Here
188
    $sth->execute(@params);
189
    $sth->execute(@params);
189
190
190
    my $items = $sth->fetchall_arrayref({});
191
    my $items = $sth->fetchall_arrayref({});
191
    $items = [ grep { my @transfers = GetTransfers($_->{itemnumber}); $#transfers == -1; } @$items ]; 
192
192
    map { my $rule = GetBranchItemRule($_->{homebranch}, $_->{itype}); $_->{holdallowed} = $rule->{holdallowed}; $rule->{holdallowed} != 0 } @$items;
193
    my $branchfield = C4::Context->preference('HomeOrHoldingBranch');
193
    return [ grep { $_->{holdallowed} != 0 } @$items ];
194
195
    return [ grep { my $rule = GetIssuingRule('*', $_->{itype}, $_->{$branchfield}); $_->{reservesallowed} = $rule->{reservesallowed}; $_->{reservesallowed} != 0 } @$items ];
194
}
196
}
195
197
196
=head2 MapItemsToHoldRequests
198
=head2 MapItemsToHoldRequests
(-)a/opac/opac-ISBDdetail.pl (-2 / +11 lines)
Lines 53-58 use C4::Review; Link Here
53
use C4::Serials;    # uses getsubscriptionfrom biblionumber
53
use C4::Serials;    # uses getsubscriptionfrom biblionumber
54
use C4::Koha;
54
use C4::Koha;
55
use C4::Members;    # GetMember
55
use C4::Members;    # GetMember
56
use C4::Items;
57
use C4::Reserves;
56
use C4::External::Amazon;
58
use C4::External::Amazon;
57
59
58
my $query = CGI->new();
60
my $query = CGI->new();
Lines 68-74 my ( $template, $loggedinuser, $cookie ) = get_template_and_user( Link Here
68
70
69
my $biblionumber = $query->param('biblionumber');
71
my $biblionumber = $query->param('biblionumber');
70
72
71
$template->param( 'AllowOnShelfHolds' => C4::Context->preference('AllowOnShelfHolds') );
72
$template->param( 'ItemsIssued' => CountItemsIssued( $biblionumber ) );
73
$template->param( 'ItemsIssued' => CountItemsIssued( $biblionumber ) );
73
74
74
my $marcflavour      = C4::Context->preference("marcflavour");
75
my $marcflavour      = C4::Context->preference("marcflavour");
Lines 122-127 $template->param( Link Here
122
);
123
);
123
124
124
my $norequests = 1;
125
my $norequests = 1;
126
## Check if an item Can be holds on shelf
127
$template->param(C4::Search::enabled_opac_search_views);
128
my @all_items = &GetItemsInfo( $biblionumber, 'opac' );
129
my $allowonshelfholds = 0;
130
for my $item (@all_items){
131
    $allowonshelfholds = 1 if(CanHoldOnShelf($item->{itemnumber}) and not $allowonshelfholds);
132
}
133
$template->param( 'AllowOnShelfHolds' => $allowonshelfholds );
134
125
my $res = GetISBDView($biblionumber, "opac");
135
my $res = GetISBDView($biblionumber, "opac");
126
my @items = &GetItemsInfo($biblionumber, 'opac');
136
my @items = &GetItemsInfo($biblionumber, 'opac');
127
137
Lines 148-154 foreach ( @$reviews ) { Link Here
148
158
149
$template->param(
159
$template->param(
150
    RequestOnOpac       => C4::Context->preference("RequestOnOpac"),
160
    RequestOnOpac       => C4::Context->preference("RequestOnOpac"),
151
    AllowOnShelfHolds   => C4::Context->preference('AllowOnShelfHolds'),
152
    norequests   => $norequests,
161
    norequests   => $norequests,
153
    ISBD         => $res,
162
    ISBD         => $res,
154
    biblionumber => $biblionumber,
163
    biblionumber => $biblionumber,
(-)a/opac/opac-MARCdetail.pl (+4 lines)
Lines 49-54 use C4::Output; Link Here
49
use CGI;
49
use CGI;
50
use MARC::Record;
50
use MARC::Record;
51
use C4::Biblio;
51
use C4::Biblio;
52
use C4::Items; #qw/GetItemsInfo GetItemsCount/;
53
use C4::Reserves qw/CanHoldOnShelf/;
52
use C4::Acquisition;
54
use C4::Acquisition;
53
use C4::Koha;
55
use C4::Koha;
54
56
Lines 82-87 $template->param( Link Here
82
84
83
$template->param( 'AllowOnShelfHolds' => C4::Context->preference('AllowOnShelfHolds') );
85
$template->param( 'AllowOnShelfHolds' => C4::Context->preference('AllowOnShelfHolds') );
84
$template->param( 'ItemsIssued' => CountItemsIssued( $biblionumber ) );
86
$template->param( 'ItemsIssued' => CountItemsIssued( $biblionumber ) );
87
$template->param( 'ItemsCount' => GetItemsCount( $biblionumber ) );
88
$template->param(C4::Search::enabled_opac_search_views);
85
89
86
# adding the $RequestOnOpac param
90
# adding the $RequestOnOpac param
87
my $RequestOnOpac;
91
my $RequestOnOpac;
(-)a/opac/opac-user.pl (-4 / +10 lines)
Lines 24-30 use CGI; Link Here
24
use C4::Auth;
24
use C4::Auth;
25
use C4::Koha;
25
use C4::Koha;
26
use C4::Circulation;
26
use C4::Circulation;
27
use C4::Reserves;
27
use C4::Reserves;# qw/GetMaxPickupDate GetReservesFromBorrowernumber/; 
28
use C4::Members;
28
use C4::Members;
29
use C4::Output;
29
use C4::Output;
30
use C4::Biblio;
30
use C4::Biblio;
Lines 32-37 use C4::Items; Link Here
32
use C4::Dates qw/format_date/;
32
use C4::Dates qw/format_date/;
33
use C4::Letters;
33
use C4::Letters;
34
use C4::Branch; # GetBranches
34
use C4::Branch; # GetBranches
35
use C4::Overdues qw/CheckBorrowerDebarred/;
35
36
36
my $query = new CGI;
37
my $query = new CGI;
37
38
Lines 64-70 for (qw(dateenrolled dateexpiry dateofbirth)) { Link Here
64
}
65
}
65
$borr->{'ethnicity'} = fixEthnicity( $borr->{'ethnicity'} );
66
$borr->{'ethnicity'} = fixEthnicity( $borr->{'ethnicity'} );
66
67
67
if ( $borr->{'debarred'} || $borr->{'gonenoaddress'} || $borr->{'lost'} ) {
68
if ( CheckBorrowerDebarred($borrowernumber) || $borr->{'gonenoaddress'} || $borr->{'lost'} ) {
68
    $borr->{'flagged'} = 1;
69
    $borr->{'flagged'} = 1;
69
}
70
}
70
71
Lines 183-188 $template->param( branchloop => \@branch_loop ); Link Here
183
# now the reserved items....
184
# now the reserved items....
184
my @reserves  = GetReservesFromBorrowernumber( $borrowernumber );
185
my @reserves  = GetReservesFromBorrowernumber( $borrowernumber );
185
foreach my $res (@reserves) {
186
foreach my $res (@reserves) {
187
    warn $res->{'waitingdate'};
186
    $res->{'reservedate'} = format_date( $res->{'reservedate'} );
188
    $res->{'reservedate'} = format_date( $res->{'reservedate'} );
187
189
188
    if ( $res->{'expirationdate'} ne '0000-00-00' ) {
190
    if ( $res->{'expirationdate'} ne '0000-00-00' ) {
Lines 193-199 foreach my $res (@reserves) { Link Here
193
    
195
    
194
    my $publictype = $res->{'publictype'};
196
    my $publictype = $res->{'publictype'};
195
    $res->{$publictype} = 1;
197
    $res->{$publictype} = 1;
196
    $res->{'waiting'} = 1 if $res->{'found'} eq 'W';
198
    if ($res->{'found'} eq 'W'){
199
        $res->{'waiting'} = 1;
200
        my @maxpickupdate = $res->{'waitingdate'} ? GetMaxPickupDate( $res->{'waitingdate'}, $borrowernumber, $res ) : '';
201
        $res->{'maxpickupdate'} = sprintf("%d-%02d-%02d", @maxpickupdate);
202
        $res->{'formattedwaitingdate'} = format_date($res->{'maxpickupdate'});
203
    }
197
    $res->{'branch'} = $branches->{ $res->{'branchcode'} }->{'branchname'};
204
    $res->{'branch'} = $branches->{ $res->{'branchcode'} }->{'branchname'};
198
    my $biblioData = GetBiblioData($res->{'biblionumber'});
205
    my $biblioData = GetBiblioData($res->{'biblionumber'});
199
    $res->{'reserves_title'} = $biblioData->{'title'};
206
    $res->{'reserves_title'} = $biblioData->{'title'};
200
- 

Return to bug 5873