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 |
|