Bug 21307: (follow-up) QA fixes
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / cataloguing / additem.tt
1 [% USE raw %]
2 [% USE Asset %]
3 [% USE Koha %]
4 [% USE ColumnsSettings %]
5 [% INCLUDE 'doc-head-open.inc' %]
6 <title>Koha &rsaquo; Cataloging &rsaquo; [% title | html %] [% IF ( author ) %] by [% author | html %][% END %] (Record #[% biblionumber | html %]) &rsaquo; Items</title>
7 [% INCLUDE 'doc-head-close.inc' %]
8 [% Asset.css("css/datatables.css") | $raw %]
9 [% Asset.css("css/addbiblio.css") | $raw %]
10 [% INCLUDE 'datatables.inc' %]
11 [% Asset.js("js/cataloging.js") | $raw %]
12 [% INCLUDE 'columns_settings.inc' %]
13 [% INCLUDE 'browser-strings.inc' %]
14 [% Asset.js("js/browser.js") | $raw %]
15 [% INCLUDE 'select2.inc' %]
16 [% INCLUDE 'str/cataloging_additem.inc' %]
17 [% Asset.js("js/cataloging_additem.js") | $raw %]
18 </head>
19
20 <body id="cat_additem" class="cat">
21 [% INCLUDE 'header.inc' %]
22 [% INCLUDE 'cataloging-search.inc' %]
23
24 <div id="breadcrumbs">
25           <a href="/cgi-bin/koha/mainpage.pl">Home</a>
26  &rsaquo; <a href="/cgi-bin/koha/cataloguing/addbooks.pl">Cataloging</a>
27  &rsaquo; Edit <a href="/cgi-bin/koha/cataloguing/addbiblio.pl?biblionumber=[% biblionumber | uri %]">[% title | html %] [% IF ( author ) %] by [% author | html %][% END %] (Record #[% biblionumber | html %])</a>
28  &rsaquo; <a href="/cgi-bin/koha/cataloguing/additem.pl?biblionumber=[% biblionumber | uri %]">Items</a>
29 </div>
30
31 <div class="main container-fluid">
32     <div class="row">
33         <div class="col-sm-12">
34             <main>
35
36 <h1>Items for [% title | html %] [% IF ( author ) %] by [% author | html %][% END %] (Record #[% biblionumber | html %])</h1>
37
38 [% IF ( barcode_not_unique ) %]<div class="dialog alert"><strong>Error saving item</strong>: Barcode must be unique.</div>[% END %]
39 [% 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 %]
40 [% IF ( book_on_loan ) %]<div class="dialog alert"><strong>Cannot delete</strong>: item is checked out.</div>[% END %]
41 [% IF ( book_reserved ) %]<div class="dialogalert"><strong>Cannot delete</strong>: item has a waiting hold.</div>[% END %]
42 [% IF ( not_same_branch ) %]<div class="dialog alert"><strong>Cannot delete</strong>: The items do not belong to your library.</div>[% END %]
43 [% 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 %]
44
45 <div id="cataloguing_additem_itemlist">
46     [% IF ( item_loop ) %]
47         <div>
48         <table id="itemst">
49           <thead>
50             <tr>
51                 <th>&nbsp;</th>
52                 [% FOREACH item_header IN item_header_loop %]
53                     [% IF item_header.column_name %]
54                         <th data-colname="[% item_header.column_name | html %]">
55                     [% ELSE %]
56                         <th>
57                     [% END %]
58                         [% item_header.header_value | html %]
59                     </th>
60                 [% END %]
61             </tr>
62           </thead>
63           <tbody>
64                 [% FOREACH item_loo IN item_loop %]
65                     [% IF ( item_loo.itemnumber == itemnumber) %]
66                         [% IF item_loo.nomod %]
67                            <tr id="row[% item_loo.itemnumber | html %]" class="active">
68                         [% ELSE %]
69                             <tr id="row[% item_loo.itemnumber | html %]" class="active editable">
70                         [% END %]
71                     [% ELSE %]
72                         [% IF item_loo.nomod %]
73                            <tr id="row[% item_loo.itemnumber | html %]">
74                         [% ELSE %]
75                             <tr id="row[% item_loo.itemnumber | html %]" class="editable">
76                         [% END %]
77                     [% END %]
78                     [% IF ( item_loo.nomod ) %]
79                       <td>&nbsp;</td>
80                     [% ELSE %]
81                       <td>
82                           <div class="dropdown">
83                           <a class="btn btn-default btn-xs dropdown-toggle" id="itemactions[% item_loo.itemnumber | html %]" role="button" data-toggle="dropdown" href="#">
84                               Actions <b class="caret"></b>
85                           </a>
86                           <ul class="dropdown-menu" role="menu" aria-labelledby="itemactions[% item_loo.itemnumber | html %]">
87
88                         [% IF ( item_loo.hostitemflag ) %]
89                               <li><a href="additem.pl?op=edititem&amp;biblionumber=[% item_loo.hostbiblionumber | uri %]&amp;itemnumber=[% item_loo.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_loo.itemnumber | html %]&amp;searchid=[% searchid | html %]">Delink</a></li>
90                         [% ELSE %]
91                               <li><a href="additem.pl?op=edititem&amp;biblionumber=[% biblionumber | uri %]&amp;itemnumber=[% item_loo.itemnumber | uri %]&amp;searchid=[% searchid | uri %]#edititem">Edit</a></li>
92                               <li><a href="additem.pl?op=dupeitem&amp;biblionumber=[% biblionumber | uri %]&amp;itemnumber=[% item_loo.itemnumber | uri %]&amp;searchid=[% searchid | uri %]#additema">Duplicate</a></li>
93                               <li class="print_label"><a href="/cgi-bin/koha/labels/label-edit-batch.pl?op=add&amp;number_type=itemnumber&amp;number_list=[% item_loo.itemnumber | uri %]" target="_blank" >Print label</a></li>
94                           [% IF ( item_loo.countanalytics ) %]
95                               <li><a href="/cgi-bin/koha/catalogue/search.pl?idx=hi&amp;q=% item_loo.itemnumber %]">View analytics</a></li>
96                           [% ELSE %]
97                               <li><a class="delete" href="/cgi-bin/koha/cataloguing/additem.pl?op=delitem&amp;biblionumber=[% biblionumber | html %]&amp;itemnumber=[% item_loo.itemnumber | html %]&amp;searchid=[% searchid | html %]" onclick="return confirm_deletion();">Delete</a></li>
98                           [% END %]
99                         [% END %]
100                             [% IF ( OPACBaseURL ) %]
101                                 <li class="view-in-opac"><a target="_blank" href="[% Koha.Preference('OPACBaseURL') | url %]/cgi-bin/koha/opac-detail.pl?biblionumber=[% biblionumber | uri %]">OPAC view</a></li>
102                             [% END %]
103                           </ul>
104                           </div>
105                       </td>
106                     [% END %]
107                 [% FOREACH item_valu IN item_loo.item_value %]
108                     <td>[% item_valu.field | html %]</td>
109                 [% END %]
110                 </tr>
111                 [% END %]
112           </tbody>
113         </table>
114         </div>
115     [% END %]
116
117 <div class="row">
118     <div class="col-sm-2">
119         [% INCLUDE 'biblio-view-menu.inc' %]
120     </div>
121     <div class="col-sm-10">
122
123 <div id="cataloguing_additem_newitem">
124     <form id="f" method="post" action="/cgi-bin/koha/cataloguing/additem.pl" name="f">
125     <input type="hidden" name="op" value="[% op | html %]" />
126     [% IF (popup) %]
127         <input type="hidden" name="popup" value="1" />
128     [% END %]
129     <input type="hidden" name="biblionumber" value="[% biblionumber | html %]" />
130     [% IF ( opisadd ) %]
131         <h2 id="additema">Add item [% IF (circborrowernumber) %]<em>(fast cataloging)</em>[% END %]</h2>
132     [% ELSE %]
133         <h2 id="edititem">Edit Item #[% itemnumber | html %][% IF ( barcode ) %] / Barcode [% barcode | html %][% END %]</h2>
134     [% END %]
135         <fieldset class="rows">
136         <ol>
137         [% FOREACH ite IN item %]
138                <li><div class="subfield_line" style="[% ite.visibility | html %]" id="subfield[% ite.tag | html %][% ite.subfield | html %][% ite.random | html %]">
139                 [% IF ( ite.mandatory ) %]
140                <label class="required">[% ite.subfield | html %] - [% ite.marc_lib | $raw %]</label>
141                [% ELSE %]
142                <label>[% ite.subfield | html %] - [% ite.marc_lib | $raw %]</label>
143                [% END %]
144
145                 [% SET mv = ite.marc_value %]
146                 [% IF ( mv.type == 'hidden' ) %]
147                     <input type="hidden" id="[%- mv.id | html -%]" name="field_value" class="input_marceditor" size="50" maxlength="[%- mv.maxlength | html -%]" value="[%- mv.value | html -%]">
148                 [% ELSIF ( mv.type == 'select' ) %]
149                     [% IF ( mv.readonly ) %]
150                         <select name="field_value" id="[%- mv.id | html -%]" size="1" class="input_marceditor" readonly="readonly" disabled="disabled">
151                     [% ELSE %]
152                         <select name="field_value" id="[%- mv.id | html -%]" size="1" class="input_marceditor">
153                     [% END %]
154                     [% FOREACH aval IN mv.values %]
155                         [% IF aval == mv.default %]
156                         <option value="[%- aval | html -%]" selected="selected">[%- mv.labels.$aval | html -%]</option>
157                         [% ELSE %]
158                         <option value="[%- aval | html -%]">[%- mv.labels.$aval | html -%]</option>
159                         [% END %]
160                     [% END %]
161                     </select>
162                 [% ELSIF ( mv.type == 'text_auth' ) %]
163                     [% IF mv.readonly %]
164                         <input type="text" id="[%- mv.id | html -%]" name="field_value" class="input_marceditor" size="50" maxlength="[%- mv.maxlength | html -%]" value="[%- mv.value | html -%]" readonly="readonly" />
165                     [% ELSE %]
166                         <input type="text" id="[%- mv.id | html -%]" name="field_value" class="input_marceditor" size="50" maxlength="[%- mv.maxlength | html -%]" value="[%- mv.value | html -%]" />
167                         [% SET dopop = "Dopop('/cgi-bin/koha/authorities/auth_finder.pl?authtypecode=\"${mv.authtypecode}\"&index=${mv.id}','${mv.id}')" %]
168                         <a href="#" class="buttonDot"  onclick="[%- dopop | html -%]; return false;" title="Tag editor">...</a>
169                     [% END %]
170                 [% ELSIF ( mv.type == 'text_plugin' ) %]
171                     [% IF mv.readonly %]
172                         <input type="text" id="[%- mv.id | html -%]" name="field_value" class="input_marceditor" size="50" maxlength="[%- mv.maxlength | html -%]" value="[%- mv.value | html -%]" readonly="readonly" />
173                     [% ELSE %]
174                         <input type="text" id="[%- mv.id | html -%]" name="field_value" class="input_marceditor" size="50" maxlength="[%- mv.maxlength | html -%]" value="[%- mv.value | html -%]" />
175                         [% IF ( mv.nopopup ) %]
176                             <a href="#" id="buttonDot_[%- mv.id | html -%]" class="[%- mv.class | html -%]" title="No popup">...</a>
177                         [% ELSE  %]
178                             <a href="#" id="buttonDot_[%- mv.id | html -%]" class="[%- mv.class | html -%]" title="Tag editor">...</a>
179                         [% END %]
180                         [%- mv.javascript | $raw -%]
181                     [% END %]
182                 [% ELSIF ( mv.type == 'text' ) %]
183                     [% IF mv.readonly %]
184                         <input type="text" id="[%- mv.id | html -%]" name="field_value" class="input_marceditor" size="50" maxlength="[%- mv.maxlength | html -%]" value="[%- mv.value | html -%]" readonly="readonly" />
185                     [% ELSE %]
186                         <input type="text" id="[%- mv.id | html -%]" name="field_value" class="input_marceditor" size="50" maxlength="[%- mv.maxlength | html -%]" value="[%- mv.value | html -%]" />
187                     [% END %]
188                 [% ELSIF ( mv.type == 'textarea' ) %]
189                     [% IF mv.readonly %]
190                         <textarea id="[%- mv.id | html -%]" name="field_value" class="input_marceditor" rows="5" cols="64" readonly="readonly" >[% mv.value | html %]</textarea>
191                     [% ELSE %]
192                         <textarea id="[%- mv.id | html -%]" name="field_value" class="input_marceditor" rows="5" cols="64" >[% mv.value | html %]</textarea>
193                     [% END %]
194                 [% END %]
195
196                 <input type="hidden" name="tag"       value="[% ite.tag | html %]" />
197                 <input type="hidden" name="subfield"  value="[% ite.subfield | html %]" />
198                 <input type="hidden" name="mandatory" value="[% ite.mandatory | html %]" />
199                 [% IF ( ite.repeatable ) %]
200                     <a href="#" class="buttonPlus" onclick="CloneItemSubfield(this.parentNode); return false;">
201                         <img src="[% interface | html %]/[% theme | html %]/img/clone-subfield.png" alt="Clone" title="Clone this subfield" />
202                     </a>
203                 [% END %]
204                 [% IF ( ite.mandatory ) %] <span class="required">Required</span>[% END %]
205             </div></li>
206         [% END %]
207     </ol>
208     </fieldset>
209     <input type="hidden" name="indicator" value=" " />
210     <input type="hidden" name="indicator" value=" " />
211     <input type="hidden" name="itemnumber" value="[% itemnumber | html %]" />
212
213 <fieldset class="action">    [% IF ( opisadd ) %]
214     <input type="submit" name="phony_submit" value="phony_submit" id="phony_submit" style="display:none;" onclick="return false;" />
215     <!-- Note : We use here a false submit button because we have several submit buttons and we don't want the user to believe they validated the adding of multiple items
216                 when pressing the enter key, while in fact it is the first submit button that is validated, in our case the "add (single) item" button.
217                 It is a bit tricky, but necessary in the sake of UI correctness.
218     -->
219     <span id="addsingle">
220         <input type="submit" name="add_submit" value="Add item" onclick="return Check(this.form)" />
221         <input type="submit" name="add_duplicate_submit" value="Add &amp; duplicate" onclick="return Check(this.form)" />
222     </span>
223     <span id="addmultiple">
224         <input type="button" name="add_multiple_copies" id="add_multiple_copies" value="Add multiple copies of this item" />
225     </span>
226     <fieldset id="add_multiple_copies_span">
227         <label for="number_of_copies">Number of copies of this item to add: </label>
228         <input type="text" id="number_of_copies" name="number_of_copies" value="" size="2" />
229         <input type="submit" id="add_multiple_copies_submit" name="add_multiple_copies_submit" value="Add" onclick="javascript:return Check(this.form) && CheckMultipleAdd(this.form.number_of_copies.value);" /> <a href="#" id="cancel_add_multiple" class="cancel">Cancel</a>
230         <div class="hint"><p>The barcode you enter will be incremented for each additional item.</p></div>
231     </fieldset>
232
233     [% ELSE %]
234     <input type="hidden" name="tag" value="[% itemtagfield | html %]" />
235     <input type="hidden" name="subfield" value="[% itemtagsubfield | html %]" />
236     <input type="hidden" name="field_value" value="[% itemnumber | html %]" />
237     <input type="submit" value="Save changes" onclick="return Check(this.form)">
238     <input type="button" id="addnewitem" value="Add a new item">
239     <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% biblionumber | uri %]">Cancel</a>
240     [% END %]</fieldset>
241
242     [%# Fields for fast cataloging %]
243     <input type="hidden" name="circborrowernumber" value="[% circborrowernumber | html %]" />
244     <input type="hidden" name="stickyduedate" value="[% stickyduedate | html %]" />
245     <input type="hidden" name="barcode" value="[% barcode | html %]" />
246     <input type="hidden" name="duedatespec" value="[% duedatespec | html %]" />
247     [%# End fields for fast cataloging %]
248
249
250     </form>
251                             </div> <!-- /#cataloguing_additem_newitem -->
252                         </div> <!-- /.col-sm-10 -->
253                     </div> <!-- /.row -->
254                 </div> <!-- /#cataloguing_additem_itemlist -->
255             </main>
256         </div> <!-- /.col-sm-12 -->
257     </div> <!-- /.row -->
258
259 [% INCLUDE 'intranet-bottom.inc' %]