Lines 2231-2241
sub DelItemCheck {
Link Here
|
2231 |
|
2231 |
|
2232 |
|
2232 |
|
2233 |
# check that there is no issue on this item before deletion. |
2233 |
# check that there is no issue on this item before deletion. |
2234 |
my $sth=$dbh->prepare("select * from issues i where i.itemnumber=?"); |
2234 |
my $sth = $dbh->prepare(q{ |
|
|
2235 |
SELECT COUNT(*) FROM issues |
2236 |
WHERE itemnumber = ? |
2237 |
}); |
2235 |
$sth->execute($itemnumber); |
2238 |
$sth->execute($itemnumber); |
|
|
2239 |
my ($onloan) = $sth->fetchrow; |
2236 |
|
2240 |
|
2237 |
my $item = GetItem($itemnumber); |
2241 |
my $item = GetItem($itemnumber); |
2238 |
my $onloan=$sth->fetchrow; |
|
|
2239 |
|
2242 |
|
2240 |
if ($onloan){ |
2243 |
if ($onloan){ |
2241 |
$error = "book_on_loan" |
2244 |
$error = "book_on_loan" |
Lines 2248-2256
sub DelItemCheck {
Link Here
|
2248 |
} |
2251 |
} |
2249 |
else{ |
2252 |
else{ |
2250 |
# check it doesnt have a waiting reserve |
2253 |
# check it doesnt have a waiting reserve |
2251 |
$sth=$dbh->prepare("SELECT * FROM reserves WHERE (found = 'W' or found = 'T') AND itemnumber = ?"); |
2254 |
$sth = $dbh->prepare(q{ |
|
|
2255 |
SELECT COUNT(*) FROM reserves |
2256 |
WHERE (found = 'W' OR found = 'T') |
2257 |
AND itemnumber = ? |
2258 |
}); |
2252 |
$sth->execute($itemnumber); |
2259 |
$sth->execute($itemnumber); |
2253 |
my $reserve=$sth->fetchrow; |
2260 |
my ($reserve) = $sth->fetchrow; |
2254 |
if ($reserve){ |
2261 |
if ($reserve){ |
2255 |
$error = "book_reserved"; |
2262 |
$error = "book_reserved"; |
2256 |
} elsif ($countanalytics > 0){ |
2263 |
} elsif ($countanalytics > 0){ |
2257 |
- |
|
|