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

(-)a/cataloguing/additem.pl (-8 / +1 lines)
Lines 25-41 use CGI qw ( -utf8 ); Link Here
25
use C4::Auth qw( get_template_and_user haspermission );
25
use C4::Auth qw( get_template_and_user haspermission );
26
use C4::Output qw( output_and_exit_if_error output_and_exit output_html_with_http_headers );
26
use C4::Output qw( output_and_exit_if_error output_and_exit output_html_with_http_headers );
27
use C4::Biblio qw(
27
use C4::Biblio qw(
28
    GetAuthorisedValueDesc
29
    GetFrameworkCode
28
    GetFrameworkCode
30
    GetMarcBiblio
29
    GetMarcBiblio
31
    GetMarcFromKohaField
30
    GetMarcFromKohaField
32
    GetMarcStructure
31
    GetMarcStructure
33
    IsMarcStructureInternal
32
    IsMarcStructureInternal
34
    ModBiblio
33
    ModBiblio
35
    TransformHtmlToXml
36
    TransformMarcToKoha
37
);
34
);
38
use C4::Items qw( AddItemFromMarc ModItemFromMarc );
39
use C4::Context;
35
use C4::Context;
40
use C4::Circulation qw( LostItem );
36
use C4::Circulation qw( LostItem );
41
use C4::Koha qw( GetAuthorisedValues );
37
use C4::Koha qw( GetAuthorisedValues );
Lines 411-417 my $record = GetMarcBiblio({ biblionumber => $biblionumber }); Link Here
411
output_and_exit_if_error( $input, $cookie, $template,
407
output_and_exit_if_error( $input, $cookie, $template,
412
    { module => 'cataloguing', record => $record } );
408
    { module => 'cataloguing', record => $record } );
413
409
414
my $oldrecord = TransformMarcToKoha($record);
415
my $current_item;
410
my $current_item;
416
my $nextop="additem";
411
my $nextop="additem";
417
my @errors; # store errors found while checking data BEFORE saving item.
412
my @errors; # store errors found while checking data BEFORE saving item.
Lines 900-908 foreach my $tag ( keys %{$tagslib} ) { Link Here
900
895
901
# what's the next op ? it's what we are not in : an add if we're editing, otherwise, and edit.
896
# what's the next op ? it's what we are not in : an add if we're editing, otherwise, and edit.
902
$template->param(
897
$template->param(
903
    biblionumber => $biblionumber,
898
    biblio       => $biblio,
904
    title        => $oldrecord->{title},
905
    author       => $oldrecord->{author},
906
    items        => \@items,
899
    items        => \@items,
907
    item_header_loop => \@header_value_loop,
900
    item_header_loop => \@header_value_loop,
908
    subfields    => \@subfields,
901
    subfields    => \@subfields,
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/additem.tt (-12 / +11 lines)
Lines 5-11 Link Here
5
[% USE KohaDates %]
5
[% USE KohaDates %]
6
[% USE TablesSettings %]
6
[% USE TablesSettings %]
7
[% INCLUDE 'doc-head-open.inc' %]
7
[% INCLUDE 'doc-head-open.inc' %]
8
<title>Items &rsaquo; [% title | html %] [% IF ( author ) %] by [% author | html %][% END %] (Record #[% biblionumber | html %]) &rsaquo; Cataloging &rsaquo; Koha</title>
8
<title>Items &rsaquo; [% biblio.title | html %] [% IF ( author ) %] by [% biblio.author | html %][% END %] (Record #[% biblio.biblionumber | html %]) &rsaquo; Cataloging &rsaquo; Koha</title>
9
[% INCLUDE 'doc-head-close.inc' %]
9
[% INCLUDE 'doc-head-close.inc' %]
10
[% Asset.css("css/addbiblio.css") | $raw %]
10
[% Asset.css("css/addbiblio.css") | $raw %]
11
[% INCLUDE 'datatables.inc' %]
11
[% INCLUDE 'datatables.inc' %]
Lines 34-40 Link Here
34
            <a href="/cgi-bin/koha/cataloguing/addbooks.pl">Cataloging</a>
34
            <a href="/cgi-bin/koha/cataloguing/addbooks.pl">Cataloging</a>
35
        </li>
35
        </li>
36
        <li>
36
        <li>
37
            <a href="/cgi-bin/koha/cataloguing/addbiblio.pl?biblionumber=[% biblionumber | uri %]">Edit <em>[% title | html %] [% IF ( author ) %] by [% author | html %][% END %] (Record #[% biblionumber | html %])</em></a>
37
            <a href="/cgi-bin/koha/cataloguing/addbiblio.pl?biblionumber=[% biblio.biblionumber | uri %]">Edit <em>[% biblio.title | html %] [% IF ( author ) %] by [% biblio.author | html %][% END %] (Record #[% biblio.biblionumber | html %])</em></a>
38
        </li>
38
        </li>
39
        <li>
39
        <li>
40
            <a href="#" aria-current="page">
40
            <a href="#" aria-current="page">
Lines 49-62 Link Here
49
        <div class="col-sm-12">
49
        <div class="col-sm-12">
50
            <main>
50
            <main>
51
                [% INCLUDE 'blocking_errors.inc' %]
51
                [% INCLUDE 'blocking_errors.inc' %]
52
<h1>Items for [% title | html %] [% IF ( author ) %] by [% author | html %][% END %] (Record #[% biblionumber | html %])</h1>
52
<h1>Items for [% biblio.title | html %] [% IF ( author ) %] by [% biblio.author | html %][% END %] (Record #[% biblio.biblionumber | html %])</h1>
53
53
54
[% IF ( barcode_not_unique ) %]<div class="dialog alert"><strong>Error saving item</strong>: Barcode must be unique.</div>[% END %]
54
[% IF ( barcode_not_unique ) %]<div class="dialog alert"><strong>Error saving item</strong>: Barcode must be unique.</div>[% END %]
55
[% IF ( no_next_barcode ) %]<div class="dialog alert"><strong>Error saving items</strong>: Unable to automatically determine values for barcodes. No item has been inserted.</div>[% END %]
55
[% IF ( no_next_barcode ) %]<div class="dialog alert"><strong>Error saving items</strong>: Unable to automatically determine values for barcodes. No item has been inserted.</div>[% END %]
56
[% IF ( book_on_loan ) %]<div class="dialog alert"><strong>Cannot delete</strong>: item is checked out.</div>[% END %]
56
[% IF ( book_on_loan ) %]<div class="dialog alert"><strong>Cannot delete</strong>: item is checked out.</div>[% END %]
57
[% IF ( book_reserved ) %]<div class="dialogalert"><strong>Cannot delete</strong>: item has a waiting hold.</div>[% END %]
57
[% IF ( book_reserved ) %]<div class="dialogalert"><strong>Cannot delete</strong>: item has a waiting hold.</div>[% END %]
58
[% IF ( not_same_branch ) %]<div class="dialog alert"><strong>Cannot delete</strong>: The items do not belong to your library.</div>[% END %]
58
[% IF ( not_same_branch ) %]<div class="dialog alert"><strong>Cannot delete</strong>: The items do not belong to your library.</div>[% END %]
59
[% IF ( linked_analytics ) %]<div class="dialog alert"><strong>Cannot delete</strong>: item has linked <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% biblionumber | uri %]&amp;analyze=1">analytics.</a>.</div>[% END %]
59
[% 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 %]
60
[% 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 %]
60
[% 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 %]
61
61
62
<div id="cataloguing_additem_itemlist">
62
<div id="cataloguing_additem_itemlist">
Lines 104-114 Link Here
104
                          </a>
104
                          </a>
105
                          <ul class="dropdown-menu" role="menu" aria-labelledby="itemactions[% item.itemnumber | html %]">
105
                          <ul class="dropdown-menu" role="menu" aria-labelledby="itemactions[% item.itemnumber | html %]">
106
106
107
                        [% IF item.biblionumber != biblionumber %] [%# Host item %]
107
                        [% IF item.biblionumber != biblio.biblionumber %] [%# Host item %]
108
                              <li><a href="additem.pl?op=edititem&amp;biblionumber=[% item.biblionumber | uri %]&amp;itemnumber=[% item.itemnumber | uri %]#edititem">Edit in host</a> &nbsp; <a class="delete" href="/cgi-bin/koha/cataloguing/additem.pl?op=delinkitem&amp;biblionumber=[% biblionumber | html %]&amp;hostitemnumber=[% item.itemnumber | html %]&amp;searchid=[% searchid | html %]">Delink</a></li>
108
                              <li><a href="additem.pl?op=edititem&amp;biblionumber=[% item.biblionumber | uri %]&amp;itemnumber=[% item.itemnumber | uri %]#edititem">Edit in host</a> &nbsp; <a class="delete" href="/cgi-bin/koha/cataloguing/additem.pl?op=delinkitem&amp;biblionumber=[% biblio.biblionumber | html %]&amp;hostitemnumber=[% item.itemnumber | html %]&amp;searchid=[% searchid | html %]">Delink</a></li>
109
                        [% ELSE %]
109
                        [% ELSE %]
110
                              <li><a href="additem.pl?op=edititem&amp;biblionumber=[% biblionumber | uri %]&amp;itemnumber=[% item.itemnumber | uri %]&amp;searchid=[% searchid | uri %]#edititem">Edit</a></li>
110
                              <li><a href="additem.pl?op=edititem&amp;biblionumber=[% biblio.biblionumber | uri %]&amp;itemnumber=[% item.itemnumber | uri %]&amp;searchid=[% searchid | uri %]#edititem">Edit</a></li>
111
                              <li><a href="additem.pl?op=dupeitem&amp;biblionumber=[% biblionumber | uri %]&amp;itemnumber=[% item.itemnumber | uri %]&amp;searchid=[% searchid | uri %]#additema">Duplicate</a></li>
111
                              <li><a href="additem.pl?op=dupeitem&amp;biblionumber=[% biblio.biblionumber | uri %]&amp;itemnumber=[% item.itemnumber | uri %]&amp;searchid=[% searchid | uri %]#additema">Duplicate</a></li>
112
                              <li class="print_label"><a href="/cgi-bin/koha/labels/label-edit-batch.pl?op=add&amp;number_type=itemnumber&amp;number_list=[% item.itemnumber | uri %]" target="_blank" >Print label</a></li>
112
                              <li class="print_label"><a href="/cgi-bin/koha/labels/label-edit-batch.pl?op=add&amp;number_type=itemnumber&amp;number_list=[% item.itemnumber | uri %]" target="_blank" >Print label</a></li>
113
                              <li><a class="delete" href="/cgi-bin/koha/cataloguing/additem.pl?op=delitem&amp;biblionumber=[% item.biblionumber | html %]&amp;itemnumber=[% item.itemnumber | html %]&amp;searchid=[% searchid | html %]" onclick="return confirm_deletion();">Delete</a></li>
113
                              <li><a class="delete" href="/cgi-bin/koha/cataloguing/additem.pl?op=delitem&amp;biblionumber=[% item.biblionumber | html %]&amp;itemnumber=[% item.itemnumber | html %]&amp;searchid=[% searchid | html %]" onclick="return confirm_deletion();">Delete</a></li>
114
                        [% END %]
114
                        [% END %]
Lines 141-152 Link Here
141
    <div class="col-sm-10">
141
    <div class="col-sm-10">
142
142
143
<div id="cataloguing_additem_newitem">
143
<div id="cataloguing_additem_newitem">
144
    <form id="f" method="post" action="/cgi-bin/koha/cataloguing/additem.pl?biblionumber=[% biblionumber | html %]" name="f">
144
    <form id="f" method="post" action="/cgi-bin/koha/cataloguing/additem.pl?biblionumber=[% biblio.biblionumber | html %]" name="f">
145
    <input type="hidden" name="op" value="[% op | html %]" />
145
    <input type="hidden" name="op" value="[% op | html %]" />
146
    [% IF (popup) %]
146
    [% IF (popup) %]
147
        <input type="hidden" name="popup" value="1" />
147
        <input type="hidden" name="popup" value="1" />
148
    [% END %]
148
    [% END %]
149
    <input type="hidden" name="biblionumber" value="[% biblionumber | html %]" />
149
    <input type="hidden" name="biblionumber" value="[% biblio.biblionumber | html %]" />
150
    [% IF op != 'saveitem' %]
150
    [% IF op != 'saveitem' %]
151
        <h2 id="additema">Add item [% IF (circborrowernumber) %]<em>(fast cataloging)</em>[% END %]</h2>
151
        <h2 id="additema">Add item [% IF (circborrowernumber) %]<em>(fast cataloging)</em>[% END %]</h2>
152
    [% ELSE %]
152
    [% ELSE %]
Lines 277-283 Link Here
277
    [% END %]
277
    [% END %]
278
    <input type="submit" value="Save changes" onclick="return Check(this.form)">
278
    <input type="submit" value="Save changes" onclick="return Check(this.form)">
279
    <input type="button" id="addnewitem" value="Add a new item">
279
    <input type="button" id="addnewitem" value="Add a new item">
280
    <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% biblionumber | uri %]">Cancel</a>
280
    <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% biblio.biblionumber | uri %]">Cancel</a>
281
    [% END %]</fieldset>
281
    [% END %]</fieldset>
282
282
283
    [%# Fields for fast cataloging %]
283
    [%# Fields for fast cataloging %]
284
- 

Return to bug 27526