View | Details | Raw Unified | Return to bug 31873
Collapse All | Expand All

(-)a/cataloguing/additem.pl (-1 / +7 lines)
Lines 47-52 use Storable qw( freeze thaw ); Link Here
47
use URI::Escape qw( uri_escape_utf8 );
47
use URI::Escape qw( uri_escape_utf8 );
48
use C4::Members;
48
use C4::Members;
49
use Koha::UI::Form::Builder::Item;
49
use Koha::UI::Form::Builder::Item;
50
use Koha::Result::Boolean;
50
51
51
use MARC::File::XML;
52
use MARC::File::XML;
52
use URI::Escape qw( uri_escape_utf8 );
53
use URI::Escape qw( uri_escape_utf8 );
Lines 412-418 if ($op eq "additem") { Link Here
412
#-------------------------------------------------------------------------------
413
#-------------------------------------------------------------------------------
413
    # check that there is no issue on this item before deletion.
414
    # check that there is no issue on this item before deletion.
414
    my $item = Koha::Items->find($itemnumber);
415
    my $item = Koha::Items->find($itemnumber);
415
    my $deleted = $item->safe_delete;
416
    my $deleted;
417
    if( $item ) {
418
        $deleted = $item->safe_delete;
419
    } else {
420
        $deleted = Koha::Result::Boolean->new(0)->add_message({ message => 'item_not_found' });
421
    }
416
    if ( $deleted ) {
422
    if ( $deleted ) {
417
        print $input->redirect("additem.pl?biblionumber=$biblionumber&frameworkcode=$frameworkcode&searchid=$searchid");
423
        print $input->redirect("additem.pl?biblionumber=$biblionumber&frameworkcode=$frameworkcode&searchid=$searchid");
418
        exit;
424
        exit;
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/additem.tt (-1 / +1 lines)
Lines 69-74 Link Here
69
[% IF ( not_same_branch ) %]<div class="dialog alert"><strong>Cannot delete</strong>: The items do not belong to your library.</div>[% END %]
69
[% IF ( not_same_branch ) %]<div class="dialog alert"><strong>Cannot delete</strong>: The items do not belong to your library.</div>[% END %]
70
[% IF ( linked_analytics ) %]<div class="dialog alert"><strong>Cannot delete</strong>: item has linked <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% biblio.biblionumber | uri %]&amp;analyze=1">analytics.</a>.</div>[% END %]
70
[% IF ( linked_analytics ) %]<div class="dialog alert"><strong>Cannot delete</strong>: item has linked <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% biblio.biblionumber | uri %]&amp;analyze=1">analytics.</a>.</div>[% END %]
71
[% IF last_item_for_hold %]<div class="dialog alert"><strong>Cannot delete</strong>: Last item for bibliographic record with biblio-level hold on it.</div>[% END %]
71
[% IF last_item_for_hold %]<div class="dialog alert"><strong>Cannot delete</strong>: Last item for bibliographic record with biblio-level hold on it.</div>[% END %]
72
[% IF item_not_found %]<div class="dialog alert"><strong>Cannot delete</strong>: Item not found.</div>[% END %]
72
73
73
<div id="cataloguing_additem_itemlist">
74
<div id="cataloguing_additem_itemlist">
74
    [% IF items %]
75
    [% IF items %]
75
- 

Return to bug 31873