|
Lines 1643-1651
sub _FixPriority {
Link Here
|
| 1643 |
|
1643 |
|
| 1644 |
# if index exists in array then move it to new position |
1644 |
# if index exists in array then move it to new position |
| 1645 |
if ( $key > -1 && $rank ne 'del' && $rank > 0 ) { |
1645 |
if ( $key > -1 && $rank ne 'del' && $rank > 0 ) { |
| 1646 |
my $new_rank = $rank - |
1646 |
my $new_rank = $rank - 1; # $new_rank is what you want the new index to be in the array |
| 1647 |
1; # $new_rank is what you want the new index to be in the array |
|
|
| 1648 |
my $moving_item = splice( @priority, $key, 1 ); |
1647 |
my $moving_item = splice( @priority, $key, 1 ); |
|
|
1648 |
$new_rank = scalar @priority if $new_rank > scalar @priority; |
| 1649 |
splice( @priority, $new_rank, 0, $moving_item ); |
1649 |
splice( @priority, $new_rank, 0, $moving_item ); |
| 1650 |
} |
1650 |
} |
| 1651 |
|
1651 |
|
|
Lines 1663-1672
sub _FixPriority {
Link Here
|
| 1663 |
); |
1663 |
); |
| 1664 |
} |
1664 |
} |
| 1665 |
|
1665 |
|
| 1666 |
$sth = $dbh->prepare( "SELECT reserve_id FROM reserves WHERE lowestPriority = 1 ORDER BY priority" ); |
|
|
| 1667 |
$sth->execute(); |
| 1668 |
|
| 1669 |
unless ( $ignoreSetLowestRank ) { |
1666 |
unless ( $ignoreSetLowestRank ) { |
|
|
1667 |
$sth = $dbh->prepare( "SELECT reserve_id FROM reserves WHERE lowestPriority = 1 AND biblionumber = ? ORDER BY priority" ); |
| 1668 |
$sth->execute($biblionumber); |
| 1670 |
while ( my $res = $sth->fetchrow_hashref() ) { |
1669 |
while ( my $res = $sth->fetchrow_hashref() ) { |
| 1671 |
_FixPriority({ |
1670 |
_FixPriority({ |
| 1672 |
reserve_id => $res->{'reserve_id'}, |
1671 |
reserve_id => $res->{'reserve_id'}, |
| 1673 |
- |
|
|