828860b2c75491aa53e48b6ed6a73ecc288fe270
[koha-equinox.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 id="doc3" class="yui-t7">
32
33    <div id="bd">
34         <div id="yui-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 </div>
117 <div class="yui-gf">
118 <div class="yui-u first">
119 [% INCLUDE 'biblio-view-menu.inc' %]
120 </div>
121 <div class="yui-u">
122 <div id="cataloguing_additem_newitem">
123     <form id="f" method="post" action="/cgi-bin/koha/cataloguing/additem.pl" name="f">
124     <input type="hidden" name="op" value="[% op | html %]" />
125     [% IF (popup) %]
126         <input type="hidden" name="popup" value="1" />
127     [% END %]
128     <input type="hidden" name="biblionumber" value="[% biblionumber | html %]" />
129     [% IF ( opisadd ) %]
130         <h2 id="additema">Add item [% IF (circborrowernumber) %]<em>(fast cataloging)</em>[% END %]</h2>
131     [% ELSE %]
132         <h2 id="edititem">Edit Item #[% itemnumber | html %][% IF ( barcode ) %] / Barcode [% barcode | html %][% END %]</h2>
133     [% END %]
134         <fieldset class="rows">
135         <ol>
136         [% FOREACH ite IN item %]
137                <li><div class="subfield_line" style="[% ite.visibility | html %]" id="subfield[% ite.tag | html %][% ite.subfield | html %][% ite.random | html %]">
138                 [% IF ( ite.mandatory ) %]
139                <label class="required">[% ite.subfield | html %] - [% ite.marc_lib | $raw %]</label>
140                [% ELSE %]
141                <label>[% ite.subfield | html %] - [% ite.marc_lib | $raw %]</label>
142                [% END %]
143
144                 [% SET mv = ite.marc_value %]
145                 [% IF ( mv.type == 'hidden' ) %]
146                     <input type="hidden" id="[%- mv.id | html -%]" name="field_value" class="input_marceditor" size="50" maxlength="[%- mv.maxlength | html -%]" value="[%- mv.value | html -%]">
147                 [% ELSIF ( mv.type == 'select' ) %]
148                     [% IF ( mv.readonly ) %]
149                         <select name="field_value" id="[%- mv.id | html -%]" size="1" class="input_marceditor" readonly="readonly" disabled="disabled">
150                     [% ELSE %]
151                         <select name="field_value" id="[%- mv.id | html -%]" size="1" class="input_marceditor">
152                     [% END %]
153                     [% FOREACH aval IN mv.values %]
154                         [% IF aval == mv.default %]
155                         <option value="[%- aval | html -%]" selected="selected">[%- mv.labels.$aval | html -%]</option>
156                         [% ELSE %]
157                         <option value="[%- aval | html -%]">[%- mv.labels.$aval | html -%]</option>
158                         [% END %]
159                     [% END %]
160                     </select>
161                 [% ELSIF ( mv.type == 'text_auth' ) %]
162                     [% IF mv.readonly %]
163                         <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" />
164                     [% ELSE %]
165                         <input type="text" id="[%- mv.id | html -%]" name="field_value" class="input_marceditor" size="50" maxlength="[%- mv.maxlength | html -%]" value="[%- mv.value | html -%]" />
166                         [% SET dopop = "Dopop('/cgi-bin/koha/authorities/auth_finder.pl?authtypecode=\"${mv.authtypecode}\"&index=${mv.id}','${mv.id}')" %]
167                         <a href="#" class="buttonDot"  onclick="[%- dopop | html -%]; return false;" title="Tag editor">...</a>
168                     [% END %]
169                 [% ELSIF ( mv.type == 'text_plugin' ) %]
170                     [% IF mv.readonly %]
171                         <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" />
172                     [% ELSE %]
173                         <input type="text" id="[%- mv.id | html -%]" name="field_value" class="input_marceditor" size="50" maxlength="[%- mv.maxlength | html -%]" value="[%- mv.value | html -%]" />
174                         [% IF ( mv.nopopup ) %]
175                             <a href="#" id="buttonDot_[%- mv.id | html -%]" class="[%- mv.class | html -%]" title="No popup">...</a>
176                         [% ELSE  %]
177                             <a href="#" id="buttonDot_[%- mv.id | html -%]" class="[%- mv.class | html -%]" title="Tag editor">...</a>
178                         [% END %]
179                         [%- mv.javascript | $raw -%]
180                     [% END %]
181                 [% ELSIF ( mv.type == 'text' ) %]
182                     [% IF mv.readonly %]
183                         <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" />
184                     [% ELSE %]
185                         <input type="text" id="[%- mv.id | html -%]" name="field_value" class="input_marceditor" size="50" maxlength="[%- mv.maxlength | html -%]" value="[%- mv.value | html -%]" />
186                     [% END %]
187                 [% ELSIF ( mv.type == 'textarea' ) %]
188                     [% IF mv.readonly %]
189                         <textarea id="[%- mv.id | html -%]" name="field_value" class="input_marceditor" rows="5" cols="64" readonly="readonly" >[% mv.value | html %]</textarea>
190                     [% ELSE %]
191                         <textarea id="[%- mv.id | html -%]" name="field_value" class="input_marceditor" rows="5" cols="64" >[% mv.value | html %]</textarea>
192                     [% END %]
193                 [% END %]
194
195                 <input type="hidden" name="tag"       value="[% ite.tag | html %]" />
196                 <input type="hidden" name="subfield"  value="[% ite.subfield | html %]" />
197                 <input type="hidden" name="mandatory" value="[% ite.mandatory | html %]" />
198                 [% IF ( ite.repeatable ) %]
199                     <a href="#" class="buttonPlus" onclick="CloneItemSubfield(this.parentNode); return false;">
200                         <img src="[% interface | html %]/[% theme | html %]/img/clone-subfield.png" alt="Clone" title="Clone this subfield" />
201                     </a>
202                 [% END %]
203                 [% IF ( ite.mandatory ) %] <span class="required">Required</span>[% END %]
204             </div></li>
205         [% END %]
206     </ol>
207     </fieldset>
208     <input type="hidden" name="indicator" value=" " />
209     <input type="hidden" name="indicator" value=" " />
210     <input type="hidden" name="itemnumber" value="[% itemnumber | html %]" />
211
212 <fieldset class="action">    [% IF ( opisadd ) %]
213     <input type="submit" name="phony_submit" value="phony_submit" id="phony_submit" style="display:none;" onclick="return false;" />
214     <!-- 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
215                 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.
216                 It is a bit tricky, but necessary in the sake of UI correctness.
217     -->
218     <span id="addsingle">
219         <input type="submit" name="add_submit" value="Add item" onclick="return Check(this.form)" />
220         <input type="submit" name="add_duplicate_submit" value="Add &amp; duplicate" onclick="return Check(this.form)" />
221     </span>
222     <span id="addmultiple">
223         <input type="button" name="add_multiple_copies" id="add_multiple_copies" value="Add multiple copies of this item" />
224     </span>
225     <fieldset id="add_multiple_copies_span">
226         <label for="number_of_copies">Number of copies of this item to add: </label>
227         <input type="text" id="number_of_copies" name="number_of_copies" value="" size="2" />
228         <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>
229         <div class="hint"><p>The barcode you enter will be incremented for each additional item.</p></div>
230     </fieldset>
231
232     [% ELSE %]
233     <input type="hidden" name="tag" value="[% itemtagfield | html %]" />
234     <input type="hidden" name="subfield" value="[% itemtagsubfield | html %]" />
235     <input type="hidden" name="field_value" value="[% itemnumber | html %]" />
236     <input type="submit" value="Save changes" onclick="return Check(this.form)">
237     <input type="button" id="addnewitem" value="Add a new item">
238     <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% biblionumber | uri %]">Cancel</a>
239     [% END %]</fieldset>
240
241     [%# Fields for fast cataloging %]
242     <input type="hidden" name="circborrowernumber" value="[% circborrowernumber | html %]" />
243     <input type="hidden" name="stickyduedate" value="[% stickyduedate | html %]" />
244     <input type="hidden" name="barcode" value="[% barcode | html %]" />
245     <input type="hidden" name="duedatespec" value="[% duedatespec | html %]" />
246     [%# End fields for fast cataloging %]
247
248
249     </form>
250 </div>
251 </div><!-- /yui-u -->
252 </div><!-- /yui-gf -->
253
254 </div>
255 </div>
256
257 [% INCLUDE 'intranet-bottom.inc' %]