|
Lines 632-649
sub ModDateLastSeen {
Link Here
|
| 632 |
|
632 |
|
| 633 |
=head2 DelItem |
633 |
=head2 DelItem |
| 634 |
|
634 |
|
| 635 |
DelItem($dbh, $biblionumber, $itemnumber); |
635 |
DelItem( $biblionumber, $itemnumber ); |
| 636 |
|
636 |
|
| 637 |
Exported function (core API) for deleting an item record in Koha. |
637 |
Exported function (core API) for deleting an item record in Koha. |
| 638 |
|
638 |
|
| 639 |
=cut |
639 |
=cut |
| 640 |
|
640 |
|
| 641 |
sub DelItem { |
641 |
sub DelItem { |
| 642 |
my ( $dbh, $biblionumber, $itemnumber ) = @_; |
642 |
my ( $biblionumber, $itemnumber ) = @_; |
| 643 |
|
643 |
|
| 644 |
# FIXME check the item has no current issues |
644 |
# FIXME check the item has no current issues |
| 645 |
|
645 |
_koha_delete_item( $itemnumber ); |
| 646 |
_koha_delete_item( $dbh, $itemnumber ); |
|
|
| 647 |
|
646 |
|
| 648 |
# get the MARC record |
647 |
# get the MARC record |
| 649 |
my $record = GetMarcBiblio($biblionumber); |
648 |
my $record = GetMarcBiblio($biblionumber); |
|
Lines 2288-2294
sub DelItemCheck {
Link Here
|
| 2288 |
} elsif ($countanalytics > 0){ |
2287 |
} elsif ($countanalytics > 0){ |
| 2289 |
$error = "linked_analytics"; |
2288 |
$error = "linked_analytics"; |
| 2290 |
} else { |
2289 |
} else { |
| 2291 |
DelItem($dbh, $biblionumber, $itemnumber); |
2290 |
DelItem($biblionumber, $itemnumber); |
| 2292 |
return 1; |
2291 |
return 1; |
| 2293 |
} |
2292 |
} |
| 2294 |
} |
2293 |
} |
|
Lines 2330-2344
sub _koha_modify_item {
Link Here
|
| 2330 |
|
2329 |
|
| 2331 |
=head2 _koha_delete_item |
2330 |
=head2 _koha_delete_item |
| 2332 |
|
2331 |
|
| 2333 |
_koha_delete_item( $dbh, $itemnum ); |
2332 |
_koha_delete_item( $itemnum ); |
| 2334 |
|
2333 |
|
| 2335 |
Internal function to delete an item record from the koha tables |
2334 |
Internal function to delete an item record from the koha tables |
| 2336 |
|
2335 |
|
| 2337 |
=cut |
2336 |
=cut |
| 2338 |
|
2337 |
|
| 2339 |
sub _koha_delete_item { |
2338 |
sub _koha_delete_item { |
| 2340 |
my ( $dbh, $itemnum ) = @_; |
2339 |
my ( $itemnum ) = @_; |
| 2341 |
|
2340 |
|
|
|
2341 |
my $dbh = C4::Context->dbh; |
| 2342 |
# save the deleted item to deleteditems table |
2342 |
# save the deleted item to deleteditems table |
| 2343 |
my $sth = $dbh->prepare("SELECT * FROM items WHERE itemnumber=?"); |
2343 |
my $sth = $dbh->prepare("SELECT * FROM items WHERE itemnumber=?"); |
| 2344 |
$sth->execute($itemnum); |
2344 |
$sth->execute($itemnum); |