Lines 188-202
elsif ( $op eq 'add_validate' ) {
Link Here
|
188 |
# called by default form, used to confirm deletion of data in DB |
188 |
# called by default form, used to confirm deletion of data in DB |
189 |
} |
189 |
} |
190 |
elsif ( $op eq 'delete_confirm' ) { |
190 |
elsif ( $op eq 'delete_confirm' ) { |
191 |
# Check both categoryitem and biblioitems, see Bug 199 |
191 |
# Check both items and biblioitems |
192 |
my $total = 0; |
192 |
my $sth = $dbh->prepare(' |
193 |
for my $table ('biblioitems') { |
193 |
SELECT COUNT(*) AS total FROM ( |
194 |
my $sth = |
194 |
SELECT itemtype AS t FROM biblioitems |
195 |
$dbh->prepare( |
195 |
UNION |
196 |
"select count(*) as total from $table where itemtype=?"); |
196 |
SELECT itype AS t FROM items |
197 |
$sth->execute($itemtype); |
197 |
) AS tmp |
198 |
$total += $sth->fetchrow_hashref->{total}; |
198 |
WHERE tmp.t=? |
199 |
} |
199 |
'); |
|
|
200 |
$sth->execute($itemtype); |
201 |
my $total = $sth->fetchrow_hashref->{'total'}; |
200 |
|
202 |
|
201 |
my $sth = |
203 |
my $sth = |
202 |
$dbh->prepare( |
204 |
$dbh->prepare( |
203 |
- |
|
|