Lines 2253-2263
sub DelItemCheck {
Link Here
|
2253 |
|
2253 |
|
2254 |
|
2254 |
|
2255 |
# check that there is no issue on this item before deletion. |
2255 |
# check that there is no issue on this item before deletion. |
2256 |
my $sth=$dbh->prepare("select * from issues i where i.itemnumber=?"); |
2256 |
my $sth = $dbh->prepare(q{ |
|
|
2257 |
SELECT COUNT(*) FROM issues |
2258 |
WHERE itemnumber = ? |
2259 |
}); |
2257 |
$sth->execute($itemnumber); |
2260 |
$sth->execute($itemnumber); |
|
|
2261 |
my ($onloan) = $sth->fetchrow; |
2258 |
|
2262 |
|
2259 |
my $item = GetItem($itemnumber); |
2263 |
my $item = GetItem($itemnumber); |
2260 |
my $onloan=$sth->fetchrow; |
|
|
2261 |
|
2264 |
|
2262 |
if ($onloan){ |
2265 |
if ($onloan){ |
2263 |
$error = "book_on_loan" |
2266 |
$error = "book_on_loan" |
Lines 2270-2278
sub DelItemCheck {
Link Here
|
2270 |
} |
2273 |
} |
2271 |
else{ |
2274 |
else{ |
2272 |
# check it doesnt have a waiting reserve |
2275 |
# check it doesnt have a waiting reserve |
2273 |
$sth=$dbh->prepare("SELECT * FROM reserves WHERE (found = 'W' or found = 'T') AND itemnumber = ?"); |
2276 |
$sth = $dbh->prepare(q{ |
|
|
2277 |
SELECT COUNT(*) FROM reserves |
2278 |
WHERE (found = 'W' OR found = 'T') |
2279 |
AND itemnumber = ? |
2280 |
}); |
2274 |
$sth->execute($itemnumber); |
2281 |
$sth->execute($itemnumber); |
2275 |
my $reserve=$sth->fetchrow; |
2282 |
my ($reserve) = $sth->fetchrow; |
2276 |
if ($reserve){ |
2283 |
if ($reserve){ |
2277 |
$error = "book_reserved"; |
2284 |
$error = "book_reserved"; |
2278 |
} elsif ($countanalytics > 0){ |
2285 |
} elsif ($countanalytics > 0){ |
2279 |
- |
|
|