Lines 749-771
sub GetReserveStatus {
Link Here
|
749 |
|
749 |
|
750 |
my $dbh = C4::Context->dbh; |
750 |
my $dbh = C4::Context->dbh; |
751 |
|
751 |
|
752 |
my ($sth, $found, $priority) = (undef, q{}, 0); |
752 |
my ($sth, $found, $priority); |
753 |
if ( $itemnumber ) { |
753 |
if ( $itemnumber ) { |
754 |
$sth = $dbh->prepare("SELECT found, priority FROM reserves WHERE itemnumber = ? order by priority LIMIT 1"); |
754 |
$sth = $dbh->prepare("SELECT found, priority FROM reserves WHERE itemnumber = ? order by priority LIMIT 1"); |
755 |
$sth->execute($itemnumber); |
755 |
$sth->execute($itemnumber); |
|
|
756 |
($found, $priority) = $sth->fetchrow_array; |
756 |
} |
757 |
} |
757 |
|
758 |
|
758 |
if ( $biblionumber and not defined $found and not defined $priority ) { |
759 |
if ( $biblionumber and not defined $found and not defined $priority ) { |
759 |
$sth = $dbh->prepare("SELECT found, priority FROM reserves WHERE biblionumber = ? order by priority LIMIT 1"); |
760 |
$sth = $dbh->prepare("SELECT found, priority FROM reserves WHERE biblionumber = ? order by priority LIMIT 1"); |
760 |
$sth->execute($biblionumber); |
761 |
$sth->execute($biblionumber); |
|
|
762 |
($found, $priority) = $sth->fetchrow_array; |
761 |
} |
763 |
} |
762 |
($found, $priority) = $sth->fetchrow_array; |
|
|
763 |
|
764 |
|
764 |
return unless defined $found; |
765 |
if(defined $found) { |
765 |
return 'Waiting' if $found eq 'W' and $priority == 0; |
766 |
return 'Waiting' if $found eq 'W' and $priority == 0; |
766 |
return 'Finished' if $found eq 'F'; |
767 |
return 'Finished' if $found eq 'F'; |
767 |
return 'Reserved' if $priority > 0; |
768 |
return 'Reserved' if $priority > 0; |
768 |
return; |
769 |
} |
|
|
770 |
return ''; |
771 |
#empty string here will remove need for checking undef, or less log lines |
769 |
} |
772 |
} |
770 |
|
773 |
|
771 |
=head2 CheckReserves |
774 |
=head2 CheckReserves |
772 |
- |
|
|