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

(-)a/cataloguing/additem.pl (-15 / +11 lines)
Lines 161-166 if ( $op eq "edititem" || $op eq "dupeitem" ) { Link Here
161
    if ( !$item ) {
161
    if ( !$item ) {
162
        $itemnumber = undef;
162
        $itemnumber = undef;
163
        $template->param( item_doesnt_exist => 1 );
163
        $template->param( item_doesnt_exist => 1 );
164
        output_and_exit( $input, $cookie, $template, 'unknown_item' )
164
    }
165
    }
165
}
166
}
166
167
Lines 469-493 if ($op eq "additem") { Link Here
469
} elsif ($op eq "edititem") {
470
} elsif ($op eq "edititem") {
470
#-------------------------------------------------------------------------------
471
#-------------------------------------------------------------------------------
471
# retrieve item if exist => then, it's a modif
472
# retrieve item if exist => then, it's a modif
472
    $nextop = "additem";
473
    $current_item = Koha::Items->find($itemnumber)->unblessed;
473
    if ($itemnumber) {
474
    $nextop       = "saveitem";
474
        $current_item = Koha::Items->find($itemnumber)->unblessed;
475
        $nextop       = "saveitem";
476
    }
477
#-------------------------------------------------------------------------------
475
#-------------------------------------------------------------------------------
478
} elsif ($op eq "dupeitem") {
476
} elsif ($op eq "dupeitem") {
479
#-------------------------------------------------------------------------------
477
#-------------------------------------------------------------------------------
480
# retrieve item if exist => then, it's a modif
478
# retrieve item if exist => then, it's a modif
481
    if ($itemnumber) {
479
    $current_item = Koha::Items->find($itemnumber)->unblessed;
482
        $current_item = Koha::Items->find($itemnumber)->unblessed;
480
    if ( C4::Context->preference('autoBarcode') eq 'incremental' ) {
483
        if ( C4::Context->preference('autoBarcode') eq 'incremental' ) {
481
        my ($barcode) =
484
            my ($barcode) =
482
          C4::Barcodes::ValueBuilder::incremental::get_barcode;
485
              C4::Barcodes::ValueBuilder::incremental::get_barcode;
483
        $current_item->{barcode} = $barcode;
486
            $current_item->{barcode} = $barcode;
484
    }
487
        }
485
    else {
488
        else {
486
        $current_item->{barcode} = undef;    # Don't save it!
489
            $current_item->{barcode} = undef;    # Don't save it!
490
        }
491
    }
487
    }
492
488
493
    $nextop = "additem";
489
    $nextop = "additem";
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/additem.tt (-7 / +5 lines)
Lines 66-71 Link Here
66
    <div class="row">
66
    <div class="row">
67
        <div class="col-sm-12">
67
        <div class="col-sm-12">
68
            <main>
68
            <main>
69
                [% IF item_doesnt_exist %]
70
                    <div class="dialog alert">
71
                        <a href="/cgi-bin/koha/cataloguing/additem.pl?biblionumber=[% biblio.biblionumber %]">Add a new item</a> or <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% biblio.biblionumber %]#holdings">go to the records holdings</a>.
72
                    </div>
73
                [% END %]
69
                [% INCLUDE 'blocking_errors.inc' %]
74
                [% INCLUDE 'blocking_errors.inc' %]
70
<h1>Items for [% biblio.title | html %] [% IF ( biblio.author ) %] by [% biblio.author | html %][% END %] (Record #[% biblio.biblionumber | html %])</h1>
75
<h1>Items for [% biblio.title | html %] [% IF ( biblio.author ) %] by [% biblio.author | html %][% END %] (Record #[% biblio.biblionumber | html %])</h1>
71
76
Lines 77-88 Link Here
77
[% 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 %]
82
[% 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 %]
78
[% 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 %]
83
[% 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 %]
79
[% IF item_not_found %]<div class="dialog alert"><strong>Cannot delete</strong>: Item not found.</div>[% END %]
84
[% IF item_not_found %]<div class="dialog alert"><strong>Cannot delete</strong>: Item not found.</div>[% END %]
80
[% IF item_doesnt_exist %]
81
<div class="dialog alert">
82
The item you are trying to access doesn't exist.<br>
83
<a href="/cgi-bin/koha/cataloguing/additem.pl?biblionumber=[% biblio.biblionumber %]">Add a new item</a> or <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% biblio.biblionumber %]#holdings">go to the records holdings</a>.
84
</div>
85
[% END %]
86
85
87
<div id="cataloguing_additem_itemlist">
86
<div id="cataloguing_additem_itemlist">
88
    [% IF items %]
87
    [% IF items %]
89
- 

Return to bug 32418