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

(-)a/C4/Reserves.pm (-4 / +7 lines)
Lines 1466-1474 sub AlterPriority { Link Here
1466
1466
1467
    my $reserve = GetReserve( $reserve_id );
1467
    my $reserve = GetReserve( $reserve_id );
1468
1468
1469
    if ( $reserve->{cancellationdate} ) {
1470
        warn "I cannot alter the priority for reserve_id $reserve_id, the reserve has been cancelled (".$reserve->{cancellationdate}.')';
1471
        return;
1472
    }
1473
1469
    if ( $where eq 'up' || $where eq 'down' ) {
1474
    if ( $where eq 'up' || $where eq 'down' ) {
1470
    
1475
1471
      my $priority = $reserve->{'priority'};        
1476
      my $priority = $reserve->{'priority'};
1472
      $priority = $where eq 'up' ? $priority - 1 : $priority + 1;
1477
      $priority = $where eq 'up' ? $priority - 1 : $priority + 1;
1473
      _FixPriority( $reserve_id, $priority )
1478
      _FixPriority( $reserve_id, $priority )
1474
1479
Lines 1628-1634 sub _FixPriority { Link Here
1628
        $sth->execute( $reserve_id );
1633
        $sth->execute( $reserve_id );
1629
    }
1634
    }
1630
    my @priority;
1635
    my @priority;
1631
    my @reservedates;
1632
1636
1633
    # get whats left
1637
    # get whats left
1634
    my $query = "
1638
    my $query = "
Lines 1641-1647 sub _FixPriority { Link Here
1641
    my $sth = $dbh->prepare($query);
1645
    my $sth = $dbh->prepare($query);
1642
    $sth->execute( $res->{'biblionumber'} );
1646
    $sth->execute( $res->{'biblionumber'} );
1643
    while ( my $line = $sth->fetchrow_hashref ) {
1647
    while ( my $line = $sth->fetchrow_hashref ) {
1644
        push( @reservedates, $line );
1645
        push( @priority,     $line );
1648
        push( @priority,     $line );
1646
    }
1649
    }
1647
1650
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt (-1 / +1 lines)
Lines 1136-1142 No patron matched <span class="ex">[% message %]</span> Link Here
1136
                </select>
1136
                </select>
1137
                <input type="hidden" name="biblionumber" value="[% reservloo.biblionumber %]" />
1137
                <input type="hidden" name="biblionumber" value="[% reservloo.biblionumber %]" />
1138
                <input type="hidden" name="borrowernumber" value="[% borrowernumber %]" />
1138
                <input type="hidden" name="borrowernumber" value="[% borrowernumber %]" />
1139
                <input type="hidden" name="reservenumber" value="[% reservloo.reservenumber %]" />
1139
                <input type="hidden" name="reserve_id" value="[% reservloo.reserve_id %]" />
1140
            </td>
1140
            </td>
1141
            <td>[% IF ( reservloo.suspend ) %]Suspended [% IF ( reservloo.suspend_until ) %] until [% reservloo.suspend_until | $KohaDates %][% END %][% END %]</td>
1141
            <td>[% IF ( reservloo.suspend ) %]Suspended [% IF ( reservloo.suspend_until ) %] until [% reservloo.suspend_until | $KohaDates %][% END %][% END %]</td>
1142
            </tr>
1142
            </tr>
(-)a/t/db_dependent/Holds.t (-5 / +11 lines)
Lines 4-18 use strict; Link Here
4
use warnings;
4
use warnings;
5
use C4::Branch;
5
use C4::Branch;
6
6
7
use Test::More tests => 18;
7
use Test::More tests => 19;
8
use MARC::Record;
8
use MARC::Record;
9
use C4::Biblio;
9
use C4::Biblio;
10
use C4::Items;
10
use C4::Items;
11
11
12
BEGIN {
12
BEGIN {
13
      use FindBin;
13
    use FindBin;
14
   use lib $FindBin::Bin;
14
    use lib $FindBin::Bin;
15
 use_ok('C4::Reserves');
15
    use_ok('C4::Reserves');
16
}
16
}
17
17
18
my $borrowers_count = 5;
18
my $borrowers_count = 5;
Lines 121-126 AddReserve( Link Here
121
    my $found,
121
    my $found,
122
);
122
);
123
( $reserve ) = GetReservesFromBorrowernumber($borrowernumber);
123
( $reserve ) = GetReservesFromBorrowernumber($borrowernumber);
124
my $reserveid = C4::Reserves::GetReserveId(
125
    {
126
        biblionumber => $biblionumber,
127
        borrowernumber => $borrowernumber
128
    }
129
);
130
is( $reserveid, $reserve->{reserve_id}, "Test GetReserveId" );
124
ModReserveMinusPriority( $itemnumber, $reserve->{'reserve_id'} );
131
ModReserveMinusPriority( $itemnumber, $reserve->{'reserve_id'} );
125
( $reserve ) = GetReservesFromBorrowernumber($borrowernumber);
132
( $reserve ) = GetReservesFromBorrowernumber($borrowernumber);
126
ok( $reserve->{'itemnumber'} eq $itemnumber, "Test ModReserveMinusPriority()" );
133
ok( $reserve->{'itemnumber'} eq $itemnumber, "Test ModReserveMinusPriority()" );
127
- 

Return to bug 9394