1 [% INCLUDE 'doc-head-open.inc' %]
2 <title>Koha › Cataloging › [% title |html %] [% IF ( author ) %] by [% author %][% END %] (Record #[% biblionumber %]) › 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' %]
9 <script type="text/javascript" src="[% interface %]/lib/shims/json2.min.js"></script>
11 <script type="text/javascript" src="[% interface %]/js/browser.js"></script>
12 <script type="text/javascript">
14 var browser = KOHA.browser('[% searchid %]', parseInt('[% biblionumber %]', 10));
17 $(document).ready(function(){
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>");
36 var itemst = $("#itemst").dataTable($.extend(true, {}, dataTablesDefaults, {
38 { "aTargets": [ 0 ], "bSortable": false, "bSearchable": false },
46 function active(numlayer)
48 for (i=10; i < 11 ; 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)";
56 document.getElementById(ong).style.visibility="hidden";
57 document.getElementById(link).style.backgroundColor="#FFFFFF";
58 document.getElementById(link).style.backgroundImage="";
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");
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);
82 function CheckMultipleAdd(f) {
84 if (!f || isNaN(f) || !parseInt(f) == f || f <= 0) {
85 alert(_("Please enter a number of items to create."));
88 <!-- Add a soft-limit of 99 with a reminder about potential data entry error -->
90 return confirm(_("You are about to add %s items. Continue?").format(f));
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');
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?"));
103 window.location = "additem.pl?op=delitem&biblionumber="+biblionumber+"&itemnumber="+itemnumber;
105 $("#row"+itemnumber).attr("class","");
109 $(document).ready(function() {
110 $("#cataloguing_additem_itemlist tr").hover(
111 function () {$(this).addClass("highlight");},
112 function () {$(this).removeClass("highlight");}
117 <link type="text/css" rel="stylesheet" href="[% themelang %]/css/addbiblio.css" />
119 <link rel="stylesheet" type="text/css" href="[% themelang %]/css/right-to-left.css" />
122 <body id="cat_additem" class="cat">
123 [% INCLUDE 'header.inc' %]
124 [% INCLUDE 'cataloging-search.inc' %]
126 <div id="breadcrumbs">
127 <a href="/cgi-bin/koha/mainpage.pl">Home</a>
128 › <a href="/cgi-bin/koha/cataloguing/addbooks.pl">Cataloging</a>
129 › Edit <a href="/cgi-bin/koha/cataloguing/addbiblio.pl?biblionumber=[% biblionumber %]">[% title |html %] [% IF ( author ) %] by [% author %][% END %] (Record #[% biblionumber %])</a>
130 › <a href="/cgi-bin/koha/cataloguing/additem.pl?biblionumber=[% biblionumber %]">Items</a>
133 <div id="doc3" class="yui-t7">
138 <h1>Items for [% title |html %] [% IF ( author ) %] by [% author %][% END %] (Record #[% biblionumber %])</h1>
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 %]&analyze=1">analytics.</a>.</div>[% END %]
147 <div id="cataloguing_additem_itemlist">
148 [% IF ( item_loop ) %]
154 [% FOREACH item_header_loo IN item_header_loop %]
156 [% item_header_loo.header_value %]
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">
167 <tr id="row[% item_loo.itemnumber %]" class="active editable">
170 [% IF item_loo.nomod %]
171 <tr id="row[% item_loo.itemnumber %]">
173 <tr id="row[% item_loo.itemnumber %]" class="editable">
176 [% IF ( item_loo.nomod ) %]
180 [% IF ( item_loo.hostitemflag ) %]
181 <a href="additem.pl?op=edititem&biblionumber=[% item_loo.hostbiblionumber %]&itemnumber=[% item_loo.itemnumber %]#edititem">Edit in host</a> <a class="delete" href="/cgi-bin/koha/cataloguing/additem.pl?op=delinkitem&biblionumber=[% biblionumber %]&hostitemnumber=[% item_loo.itemnumber %]">Delink</a>
183 <a href="additem.pl?op=edititem&biblionumber=[% biblionumber %]&itemnumber=[% item_loo.itemnumber %]#edititem">Edit</a>
184 [% IF ( item_loo.countanalytics ) %]
185 <a href="/cgi-bin/koha/catalogue/search.pl?idx=hi&q=% item_loo.itemnumber %]">View analytics</a>
187 <a class="delete" href="/cgi-bin/koha/cataloguing/additem.pl?op=delitem&biblionumber=[% biblionumber %]&itemnumber=[% item_loo.itemnumber %]" onclick="confirm_deletion([% biblionumber %],[% item_loo.itemnumber %]); return false;">Delete</a>
192 [% FOREACH item_valu IN item_loo.item_value %]
193 <td>[% item_valu.field |html %]</td>
203 <div class="yui-u first">
204 [% INCLUDE 'biblio-view-menu.inc' %]
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 %]" />
211 <input type="hidden" name="popup" value="1" />
213 <input type="hidden" name="biblionumber" value="[% biblionumber %]" />
215 <h2 id="additema">Add item [% IF (circborrowernumber) %]<em>(fast cataloging)</em>[% END %]</h2>
217 <h2 id="edititem">Edit Item #[% itemnumber %][% IF ( barcode ) %] / Barcode [% barcode %][% END %]</h2>
219 <fieldset class="rows">
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>
226 <label>[% ite.subfield %] - [% ite.marc_lib %]</label>
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" />
237 [% IF ( ite.mandatory ) %] <span class="required">Required</span>[% END %]
242 <input type="hidden" name="indicator" value=" " />
243 <input type="hidden" name="indicator" value=" " />
244 <input type="hidden" name="itemnumber" value="[% itemnumber %]" />
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.
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 & 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) && CheckMultipleAdd(this.form.number_of_copies.value);" />
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)" />
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 %]
278 </div><!-- /yui-u -->
279 </div><!-- /yui-gf -->
283 [% INCLUDE 'intranet-bottom.inc' %]