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

(-)a/C4/Reserves.pm (-2 / +15 lines)
Lines 273-279 sub GetReservesFromBiblionumber { Link Here
273
                expirationdate,
273
                expirationdate,
274
                lowestPriority,
274
                lowestPriority,
275
                suspend,
275
                suspend,
276
                suspend_until
276
                suspend_until,
277
                reserve_id
277
        FROM     reserves
278
        FROM     reserves
278
        WHERE biblionumber = ? ";
279
        WHERE biblionumber = ? ";
279
    unless ( $all_dates ) {
280
    unless ( $all_dates ) {
Lines 1056-1062 itemnumber and supplying itemnumber. Link Here
1056
1057
1057
sub ModReserve {
1058
sub ModReserve {
1058
    #subroutine to update a reserve
1059
    #subroutine to update a reserve
1059
    my ( $rank, $biblio, $borrower, $branch , $itemnumber, $suspend_until) = @_;
1060
    my ( $rank, $biblio, $borrower, $branch , $itemnumber, $suspend_until, $reserve_id ) = @_;
1060
     return if $rank eq "W";
1061
     return if $rank eq "W";
1061
     return if $rank eq "n";
1062
     return if $rank eq "n";
1062
    my $dbh = C4::Context->dbh;
1063
    my $dbh = C4::Context->dbh;
Lines 1089-1094 sub ModReserve { Link Here
1089
        
1090
        
1090
    }
1091
    }
1091
    elsif ($rank =~ /^\d+/ and $rank > 0) {
1092
    elsif ($rank =~ /^\d+/ and $rank > 0) {
1093
        my $reserve;
1094
        if ( $reserve_id ) {
1095
            my $sth = $dbh->prepare("SELECT * FROM reserves WHERE reserve_id = ?");
1096
            $sth->execute( $reserve_id );
1097
            $reserve = $sth->fetchrow_hashref();
1098
        }
1099
1092
        my $query = "
1100
        my $query = "
1093
            UPDATE reserves SET priority = ? ,branchcode = ?, itemnumber = ?, found = NULL, waitingdate = NULL
1101
            UPDATE reserves SET priority = ? ,branchcode = ?, itemnumber = ?, found = NULL, waitingdate = NULL
1094
            WHERE biblionumber   = ?
1102
            WHERE biblionumber   = ?
Lines 1098-1103 sub ModReserve { Link Here
1098
        $sth->execute( $rank, $branch,$itemnumber, $biblio, $borrower);
1106
        $sth->execute( $rank, $branch,$itemnumber, $biblio, $borrower);
1099
        $sth->finish;
1107
        $sth->finish;
1100
1108
1109
        ## If we are re-prioritizing a previously 'in transit' hold, we need to remove any item transfer that may have been created for it.
1110
        if ( $reserve->{'found'} eq 'T' ) {
1111
            $dbh->do("DELETE FROM branchtransfers WHERE itemnumber = ? AND tobranch = ? AND datearrived IS NULL", undef, ( $itemnumber, $reserve->{'branchcode'} ) );
1112
        }
1113
1101
        if ( defined( $suspend_until ) ) {
1114
        if ( defined( $suspend_until ) ) {
1102
            if ( $suspend_until ) {
1115
            if ( $suspend_until ) {
1103
                $suspend_until = C4::Dates->new( $suspend_until )->output("iso");
1116
                $suspend_until = C4::Dates->new( $suspend_until )->output("iso");
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt (+1 lines)
Lines 553-558 function checkMultiHold() { Link Here
553
  [% FOREACH reserveloo IN biblioloo.reserveloop %]
553
  [% FOREACH reserveloo IN biblioloo.reserveloop %]
554
  [% UNLESS ( loop.odd ) %]<tr class="highlight">[% ELSE %]<tr>[% END %]
554
  [% UNLESS ( loop.odd ) %]<tr class="highlight">[% ELSE %]<tr>[% END %]
555
        <td>
555
        <td>
556
          <input type="hidden" name="reserve_id" value="[% reserveloo.reserve_id %]" />
556
          <input type="hidden" name="borrowernumber" value="[% reserveloo.borrowernumber %]" />
557
          <input type="hidden" name="borrowernumber" value="[% reserveloo.borrowernumber %]" />
557
          <input type="hidden" name="biblionumber" value="[% reserveloo.biblionumber %]" />
558
          <input type="hidden" name="biblionumber" value="[% reserveloo.biblionumber %]" />
558
          <select name="rank-request">
559
          <select name="rank-request">
(-)a/reserve/modrequest.pl (-1 / +2 lines)
Lines 42-47 my ( $template, $loggedinuser, $cookie ) = get_template_and_user( Link Here
42
);
42
);
43
43
44
my @rank=$query->param('rank-request');
44
my @rank=$query->param('rank-request');
45
my @reserve_id = $query->param('reserve_id');
45
my @biblionumber=$query->param('biblionumber');
46
my @biblionumber=$query->param('biblionumber');
46
my @borrower=$query->param('borrowernumber');
47
my @borrower=$query->param('borrowernumber');
47
my @branch=$query->param('pickup');
48
my @branch=$query->param('pickup');
Lines 67-73 if ($CancelBorrowerNumber) { Link Here
67
else {
68
else {
68
    for (my $i=0;$i<$count;$i++){
69
    for (my $i=0;$i<$count;$i++){
69
        undef $itemnumber[$i] unless $itemnumber[$i] ne '';
70
        undef $itemnumber[$i] unless $itemnumber[$i] ne '';
70
        ModReserve($rank[$i],$biblionumber[$i],$borrower[$i],$branch[$i],$itemnumber[$i],$suspend_until[$i]); #from C4::Reserves
71
        ModReserve($rank[$i],$biblionumber[$i],$borrower[$i],$branch[$i],$itemnumber[$i],$suspend_until[$i],$reserve_id[$i]); #from C4::Reserves
71
    }
72
    }
72
}
73
}
73
my $from=$query->param('from');
74
my $from=$query->param('from');
(-)a/reserve/request.pl (-1 / +1 lines)
Lines 556-561 foreach my $biblionumber (@biblionumbers) { Link Here
556
        $reserve{'expirationdate'} = format_date( $res->{'expirationdate'} )
556
        $reserve{'expirationdate'} = format_date( $res->{'expirationdate'} )
557
            unless ( !defined($res->{'expirationdate'}) || $res->{'expirationdate'} eq '0000-00-00' );
557
            unless ( !defined($res->{'expirationdate'}) || $res->{'expirationdate'} eq '0000-00-00' );
558
        $reserve{'date'}           = format_date( $res->{'reservedate'} );
558
        $reserve{'date'}           = format_date( $res->{'reservedate'} );
559
        $reserve{'reserve_id'}     = $res->{'reserve_id'};
559
        $reserve{'borrowernumber'} = $res->{'borrowernumber'};
560
        $reserve{'borrowernumber'} = $res->{'borrowernumber'};
560
        $reserve{'biblionumber'}   = $res->{'biblionumber'};
561
        $reserve{'biblionumber'}   = $res->{'biblionumber'};
561
        $reserve{'borrowernumber'} = $res->{'borrowernumber'};
562
        $reserve{'borrowernumber'} = $res->{'borrowernumber'};
562
- 

Return to bug 8451