Bug 10473: (RM followup) small wording change
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / cataloguing / additem.tt
1 [% INCLUDE 'doc-head-open.inc' %]
2 <title>Koha &rsaquo; Cataloging &rsaquo; [% title |html %] [% IF ( author ) %] by [% author %][% END %] (Record #[% biblionumber %]) &rsaquo; Items</title>
3 <link rel="stylesheet" type="text/css" href="[% themelang %]/css/datatables.css" />
4 [% INCLUDE 'doc-head-close.inc' %]
5 [% INCLUDE 'datatables.inc' %]
6 <script type="text/javascript" src="[% themelang %]/js/cataloging.js"></script>
7 [% INCLUDE 'browser-strings.inc' %]
8 <!--[if lt IE 9]>
9 <script type="text/javascript" src="[% interface %]/lib/shims/json2.min.js"></script>
10 <![endif]-->
11 <script type="text/javascript" src="[% interface %]/js/browser.js"></script>
12 <script type="text/javascript">
13 //<![CDATA[
14     var browser = KOHA.browser('[% searchid %]', parseInt('[% biblionumber %]', 10));
15     browser.show();
16
17 $(document).ready(function(){
18     [% IF (popup) %]
19         [% IF (opisadd) %]
20             window.close();
21         [% END %]
22     [% END %]
23             $("fieldset.rows input, fieldset.rows select").addClass("noEnterSubmit");
24                 /* Inline edit/delete links */
25                 var biblionumber = $("input[name='biblionumber']").attr("value");
26         $("tr.editable td").click(function(event){
27                         var $tgt = $(event.target);
28                         if($tgt.is("a")||$tgt.is(":first-child")||$tgt.is(":nth-child(2)")){ return true; } else {
29                         var rowid = $(this).parent().attr("id");
30                         num_rowid = rowid.replace("row","");
31                         $(".linktools").remove();
32                         $(this).append("<span class=\"linktools\"><a href=\"/cgi-bin/koha/cataloguing/additem.pl?op=edititem&frameworkcode=[% frameworkcode %]&biblionumber=[% biblionumber %]&itemnumber="+num_rowid+"#edititem\">" + _("Edit item") + "</a> <a href=\"/cgi-bin/koha/cataloguing/additem.pl?op=delitem&frameworkcode=[% frameworkcode %]&biblionumber=[% biblionumber %]&itemnumber="+num_rowid+"\" onclick=\"confirm_deletion([% biblionumber %],"+num_rowid+"); return false;\">" + _("Delete item") + "</a></span>");
33                 }
34                 });
35
36     var itemst = $("#itemst").dataTable($.extend(true, {}, dataTablesDefaults, {
37         "aoColumnDefs": [
38           { "aTargets": [ 0 ], "bSortable": false, "bSearchable": false },
39         ],
40         'bPaginate': false,
41         'bInfo': false,
42         "bAutoWidth": false
43     } ) );
44
45 });
46 function active(numlayer)
47 {
48     for (i=10; i < 11 ; i++ ) {
49         ong = i+"XX";
50             link = "link"+i;
51         if (numlayer==i) {
52             document.getElementById(ong).style.visibility="visible";
53             document.getElementById(link).style.backgroundColor="#11AA11";
54             document.getElementById(link).style.backgroundImage="url([% themelang %]/images/background-mem.gif)";
55         } else {
56             document.getElementById(ong).style.visibility="hidden";
57             document.getElementById(link).style.backgroundColor="#FFFFFF";
58             document.getElementById(link).style.backgroundImage="";
59         }
60     }
61 }
62 function Check(f) {
63     var total_errors = CheckMandatorySubfields(f);
64     if (total_errors==0) {
65         // Explanation about this line:
66         // In case of limited edition permission, we have to prevent user from modifying some fields.
67         // But there is no such thing as readonly attribute for select elements.
68         // So we use disabled instead. But disabled prevent values from being passed through the form at submit.
69         // So we "un-disable" the elements just before submitting.
70         // That's a bit clumsy, and if someone comes up with a better solution, feel free to improve that.
71         $("select[name=field_value]").removeAttr("disabled");
72         return true;
73     } else {
74         var alertString2 = _("Form not submitted because of the following problem(s)");
75         alertString2 += "\n------------------------------------------------------------------------------------\n";
76         alertString2 += "\n- " + _("%s mandatory fields empty (highlighted)").format(total_errors);
77         alert(alertString2);
78         return false;
79     }
80     return true;
81 }
82 function CheckMultipleAdd(f) {
83
84     if (!f || isNaN(f) || !parseInt(f) == f || f <= 0) {
85         alert(_("Please enter a number of items to create."));
86         return false;
87     }
88     <!-- Add a soft-limit of 99 with a reminder about potential data entry error -->
89     if (f>99) {
90         return confirm(_("You are about to add %s items. Continue?").format(f));
91     }
92 }
93 function Dopop(link,i) {
94     defaultvalue=document.forms[0].field_value[i].value;
95     newin=window.open(link+"&result="+defaultvalue,"valuebuilder",'width=500,height=400,toolbar=false,scrollbars=yes');
96 }
97
98 function confirm_deletion(biblionumber,itemnumber) {
99         var original = $("#row"+itemnumber).attr("class");
100         $("#row"+itemnumber).attr("class","confirm");
101     var is_confirmed = confirm(_("Are you sure you want to delete this item?"));
102     if (is_confirmed) {
103     window.location = "additem.pl?op=delitem&biblionumber="+biblionumber+"&itemnumber="+itemnumber;
104         } else {
105         $("#row"+itemnumber).attr("class","");
106     }
107 }
108
109 $(document).ready(function() {
110     $("#cataloguing_additem_itemlist  tr").hover(
111         function () {$(this).addClass("highlight");},
112         function () {$(this).removeClass("highlight");}
113     );
114 });
115 //]]>
116 </script>
117 <link type="text/css" rel="stylesheet" href="[% themelang %]/css/addbiblio.css" />
118 [% IF ( bidi ) %]
119    <link rel="stylesheet" type="text/css" href="[% themelang %]/css/right-to-left.css" />
120 [% END %]
121 </head>
122 <body id="cat_additem" class="cat">
123 [% INCLUDE 'header.inc' %]
124 [% INCLUDE 'cataloging-search.inc' %]
125
126 <div id="breadcrumbs">
127           <a href="/cgi-bin/koha/mainpage.pl">Home</a>
128  &rsaquo; <a href="/cgi-bin/koha/cataloguing/addbooks.pl">Cataloging</a>
129  &rsaquo; Edit <a href="/cgi-bin/koha/cataloguing/addbiblio.pl?biblionumber=[% biblionumber %]">[% title |html %] [% IF ( author ) %] by [% author %][% END %] (Record #[% biblionumber %])</a>
130  &rsaquo; <a href="/cgi-bin/koha/cataloguing/additem.pl?biblionumber=[% biblionumber %]">Items</a>
131 </div>
132
133 <div id="doc3" class="yui-t7">
134
135    <div id="bd">
136         <div id="yui-main">
137
138 <h1>Items for [% title |html %] [% IF ( author ) %] by [% author %][% END %] (Record #[% biblionumber %])</h1>
139
140 [% IF ( barcode_not_unique ) %]<div class="dialog alert"><strong>Error saving item</strong>: Barcode must be unique.</div>[% END %]
141 [% 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 %]
142 [% IF ( book_on_loan ) %]<div class="dialog alert"><strong>Cannot delete</strong>: item is checked out.</div>[% END %]
143 [% IF ( book_reserved ) %]<div class="dialogalert"><strong>Cannot delete</strong>: item has a waiting hold.</div>[% END %]
144 [% IF ( not_same_branch ) %]<div class="dialog alert"><strong>Cannot delete</strong>: The items do not belong to your library.</div>[% END %]
145 [% IF ( linked_analytics ) %]<div class="dialog alert"><strong>Cannot delete</strong>: item has linked <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% biblionumber %]&amp;analyze=1">analytics.</a>.</div>[% END %]
146
147 <div id="cataloguing_additem_itemlist">
148     [% IF ( item_loop ) %]
149         <div>
150         <table id="itemst">
151           <thead>
152             <tr>
153                 <th>&nbsp;</th>
154                 [% FOREACH item_header_loo IN item_header_loop %]
155                     <th>
156                         [% item_header_loo.header_value %]
157                     </th>
158                 [% END %]
159             </tr>
160           </thead>
161           <tbody>
162                 [% FOREACH item_loo IN item_loop %]
163                     [% IF ( item_loo.itemnumber == itemnumber) %]
164                         [% IF item_loo.nomod %]
165                            <tr id="row[% item_loo.itemnumber %]" class="active">
166                         [% ELSE %]
167                             <tr id="row[% item_loo.itemnumber %]" class="active editable">
168                         [% END %]
169                     [% ELSE %]
170                         [% IF item_loo.nomod %]
171                            <tr id="row[% item_loo.itemnumber %]">
172                         [% ELSE %]
173                             <tr id="row[% item_loo.itemnumber %]" class="editable">
174                         [% END %]
175                     [% END %]
176                     [% IF ( item_loo.nomod ) %]
177                       <td>&nbsp;</td>
178                     [% ELSE %]
179                       <td>
180                         [% IF ( item_loo.hostitemflag ) %]
181                           <a href="additem.pl?op=edititem&amp;biblionumber=[% item_loo.hostbiblionumber %]&amp;itemnumber=[% item_loo.itemnumber %]#edititem">Edit in host</a> &nbsp; <a class="delete" href="/cgi-bin/koha/cataloguing/additem.pl?op=delinkitem&amp;biblionumber=[% biblionumber %]&amp;hostitemnumber=[% item_loo.itemnumber %]">Delink</a>
182                         [% ELSE %]
183                           <a href="additem.pl?op=edititem&amp;biblionumber=[% biblionumber %]&amp;itemnumber=[% item_loo.itemnumber %]#edititem">Edit</a>
184                           [% IF ( item_loo.countanalytics ) %]
185                             <a href="/cgi-bin/koha/catalogue/search.pl?idx=hi&amp;q=% item_loo.itemnumber %]">View analytics</a>
186                           [% ELSE %]
187                             <a class="delete" href="/cgi-bin/koha/cataloguing/additem.pl?op=delitem&amp;biblionumber=[% biblionumber %]&amp;itemnumber=[% item_loo.itemnumber %]" onclick="confirm_deletion([% biblionumber %],[% item_loo.itemnumber %]); return false;">Delete</a>
188                           [% END %]
189                         [% END %]
190                       </td>
191                     [% END %]
192                 [% FOREACH item_valu IN item_loo.item_value %]
193                     <td>[% item_valu.field |html %]</td>
194                 [% END %]
195                 </tr>
196                 [% END %]
197           </tbody>
198         </table>
199         </div>
200     [% END %]
201 </div>
202 <div class="yui-gf">
203 <div class="yui-u first">
204 [% INCLUDE 'biblio-view-menu.inc' %]
205 </div>
206 <div class="yui-u">
207 <div id="cataloguing_additem_newitem">
208     <form id="f" method="post" action="/cgi-bin/koha/cataloguing/additem.pl" name="f">
209     <input type="hidden" name="op" value="[% op %]" />
210     [% IF (popup) %]
211         <input type="hidden" name="popup" value="1" />
212     [% END %]
213     <input type="hidden" name="biblionumber" value="[% biblionumber %]" />
214     [% IF ( opisadd ) %]
215         <h2 id="additema">Add item [% IF (circborrowernumber) %]<em>(fast cataloging)</em>[% END %]</h2>
216     [% ELSE %]
217         <h2 id="edititem">Edit Item #[% itemnumber %][% IF ( barcode ) %] / Barcode [% barcode %][% END %]</h2>
218     [% END %]
219         <fieldset class="rows">
220         <ol>
221         [% FOREACH ite IN item %]
222                <li><div class="subfield_line" style="[% ite.visibility %]" id="subfield[% ite.tag %][% ite.subfield %][% ite.random %]">
223                 [% IF ( ite.mandatory ) %]
224                <label class="required">[% ite.subfield %] - [% ite.marc_lib %]</label>
225                [% ELSE %]
226                <label>[% ite.subfield %] - [% ite.marc_lib %]</label>
227                [% END %]
228                 [% ite.marc_value %]
229                 <input type="hidden" name="tag"       value="[% ite.tag %]" />
230                 <input type="hidden" name="subfield"  value="[% ite.subfield %]" />
231                 <input type="hidden" name="mandatory" value="[% ite.mandatory %]" />
232                 [% IF ( ite.repeatable ) %]
233                     <a href="#" class="buttonPlus" onclick="CloneItemSubfield(this.parentNode); return false;">
234                         <img src="[% interface %]/[% theme %]/img/clone-subfield.png" alt="Clone" title="Clone this subfield" />
235                     </a>
236                 [% END %]
237                 [% IF ( ite.mandatory ) %] <span class="required">Required</span>[% END %]
238             </div></li>
239         [% END %]
240     </ol>
241     </fieldset>
242     <input type="hidden" name="indicator" value=" " />
243     <input type="hidden" name="indicator" value=" " />
244     <input type="hidden" name="itemnumber" value="[% itemnumber %]" />
245
246 <fieldset class="action">    [% IF ( opisadd ) %]
247     <input type="submit" name="phony_submit" value="phony_submit" id="phony_submit" style="display:none;" onclick="return false;" />
248     <!-- Note : We use here a false submit button because we have several submit buttons and we don't want the user to believe he validated the adding of multiple items
249                 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.
250                 It is a bit tricky, but necessary in the sake of UI correctness.
251     -->
252
253     <input type="submit" name="add_submit" value="Add item" onclick="return Check(this.form)" />
254     <input type="submit" name="add_duplicate_submit" value="Add &amp; duplicate" onclick="return Check(this.form)" />
255     <input type="submit" name="add_multiple_copies" value="Add multiple items" onclick="javascript:this.nextSibling.style.visibility='visible';document.f.number_of_copies.focus(); return false;" /><span id="add_multiple_copies_span" style="visibility:hidden">
256     <label for="number_of_copies">Number of items to add : </label>
257     <input type="text" id="number_of_copies" name="number_of_copies" value="" />
258         <input type="submit" id="add_multiple_copies_submit" name="add_multiple_copies_submit" value="Add" onclick="javascript:return Check(this.form) &amp;&amp; CheckMultipleAdd(this.form.number_of_copies.value);" />
259     </span>
260
261     [% ELSE %]
262     <input type="hidden" name="tag" value="[% itemtagfield %]" />
263     <input type="hidden" name="subfield" value="[% itemtagsubfield %]" />
264     <input type="hidden" name="field_value" value="[% itemnumber %]" />
265     <input type="submit" value="Save changes" onclick="return Check(this.form)" />
266     [% END %]</fieldset>
267     
268     [%# Fields for fast cataloging %]
269     <input type="hidden" name="circborrowernumber" value="[% circborrowernumber %]" />
270     <input type="hidden" name="stickyduedate" value="[% stickyduedate %]" />
271     <input type="hidden" name="barcode" value="[% barcode %]" />
272     <input type="hidden" name="duedatespec" value="[% duedatespec %]" />
273     [%# End fields for fast cataloging %]
274
275
276     </form>
277 </div>
278 </div><!-- /yui-u -->
279 </div><!-- /yui-gf -->
280
281 </div>
282 </div>
283 [% INCLUDE 'intranet-bottom.inc' %]