1 <!-- TMPL_INCLUDE NAME="doc-head-open.inc" -->
2 <title>Koha › Cataloging › <!-- TMPL_VAR name="title" escape="html" --> <!-- TMPL_IF NAME="author" --> by <!-- TMPL_VAR name="author" --><!-- /TMPL_IF --> (Record #<!-- TMPL_VAR NAME="biblionumber" -->) › Items</title>
3 <!-- TMPL_INCLUDE NAME="doc-head-close.inc" -->
4 <script type="text/javascript">
6 $(document).ready(function(){
7 $("fieldset.rows input").keydown(function(e){ return checkEnter(e); });
8 /* Inline edit/delete links */
9 var biblionumber = $("input[name='biblionumber']").attr("value");
10 $("td").click(function(event){
11 var $tgt = $(event.target);
12 if($tgt.is("a")||$tgt.is(":first-child")||$tgt.is(":nth-child(2)")){ return true; } else {
13 var rowid = $(this).parent().attr("id");
14 num_rowid = rowid.replace("row","");
15 $(".linktools").remove();
16 $(this).append("<span class=\"linktools\"><a href=\"/cgi-bin/koha/cataloguing/additem.pl?op=edititem&frameworkcode=<!-- TMPL_VAR NAME="frameworkcode" -->&biblionumber=<!-- TMPL_VAR NAME="biblionumber" -->&itemnumber="+num_rowid+"#edititem\">Edit Item</a> <a href=\"/cgi-bin/koha/cataloguing/additem.pl?op=delitem&frameworkcode=<!-- TMPL_VAR NAME="frameworkcode" -->&biblionumber=<!-- TMPL_VAR NAME="biblionumber" -->&itemnumber="+num_rowid+"\" onclick=\"confirm_deletion(<!-- TMPL_VAR NAME="biblionumber" -->,"+num_rowid+"); return false;\">Delete Item</a></span>");
20 function active(numlayer)
22 for (i=10; i < 11 ; i++ ) {
26 document.getElementById(ong).style.visibility="visible";
27 document.getElementById(link).style.backgroundColor="#11AA11";
28 document.getElementById(link).style.backgroundImage="url(<!-- TMPL_VAR NAME="themelang" -->/images/background-mem.gif)";
30 document.getElementById(ong).style.visibility="hidden";
31 document.getElementById(link).style.backgroundColor="#FFFFFF";
32 document.getElementById(link).style.backgroundImage="";
39 // alert(f.field_value.length);
40 for (i=0 ; i<f.field_value.length ; i++) {
41 // alert (f.field_value[i].value);
42 if (f.field_value[i].value.length==0 && f.mandatory[i].value==1) {
43 document.getElementById("error"+i).style.backgroundColor="#FF0000";
46 // document.getElementById("error"+i).style.backgroundColor="#FFFFFF";
50 if (total_errors==0) {
53 alertString2 = _("Form not submitted because of the following problem(s)");
54 alertString2 += "\n------------------------------------------------------------------------------------\n";
55 alertString2 += "\n- "+ total_errors+_(" mandatory fields empty (see bold subfields)");
60 function CheckMultipleAdd(f) {
62 if (!f || isNaN(f) || !parseInt(f) == f || f <= 0) {
63 alert(_("Please enter a number of items to create."));
67 function Dopop(link,i) {
68 defaultvalue=document.forms[0].field_value[i].value;
69 newin=window.open(link+"&result="+defaultvalue,"valuebuilder",'width=500,height=400,toolbar=false,scrollbars=yes');
72 function confirm_deletion(biblionumber,itemnumber) {
73 var original = $("#row"+itemnumber).attr("class");
74 $("#row"+itemnumber).attr("class","confirm");
75 var is_confirmed = confirm(_("Are you sure you want to delete this item?"));
77 window.location = "additem.pl?op=delitem&biblionumber="+biblionumber+"&itemnumber="+itemnumber;
79 $("#row"+itemnumber).attr("class","");
83 function CloneSubfield(index){
84 var original = document.getElementById(index); //original <div>
85 var clone = original.cloneNode(true);
86 var new_key = CreateKey();
87 var old_id = original.getAttribute('id');
88 old_id=old_id.substr(12);
89 var new_id = old_id+new_key;
91 // set the attribute for the new 'div' subfields
92 var inputs = clone.getElementsByTagName('input');
93 var selects = clone.getElementsByTagName('select');
94 var textareas = clone.getElementsByTagName('textarea');
98 for(var i=0,len=inputs.length; i<len ; i++ ){
99 id_input = inputs[i].getAttribute('id')+new_key;
100 inputs[i].setAttribute('id',id_input);
101 inputs[i].setAttribute('name',inputs[i].getAttribute('name'));
105 for(var i=0,len=selects.length; i<len ; i++ ){
106 id_input = selects[i].getAttribute('id')+new_key;
107 selects[i].setAttribute('id',selects[i].getAttribute('id')+new_key);
108 selects[i].setAttribute('name',selects[i].getAttribute('name'));
112 for(var i=0,len=textareas.length; i<len ; i++ ){
113 id_input = textareas[i].getAttribute('id')+new_key;
114 textareas[i].setAttribute('id',textareas[i].getAttribute('id')+new_key);
115 textareas[i].setAttribute('name',textareas[i].getAttribute('name'));
118 <!-- TMPL_UNLESS NAME='advancedMARCEditor' -->
119 // when cloning a subfield, reset its label too.
120 var label = clone.getElementsByTagName('label')[0];
121 label.setAttribute('for',id_input);
122 <!-- /TMPL_UNLESS -->
124 // setting a new if for the parent div
125 clone.setAttribute('id',new_id);
129 var spans = clone.getElementsByTagName('span');
131 for(var i = 0 ,lenspans = spans.length ; i < lenspans ; i++){
132 if(spans[i].getAttribute('class') == 'buttonPlus'){
133 CloneButtonPlus = spans[i];
134 CloneButtonPlus.setAttribute('onclick',"CloneSubfield('" + new_id + "')");
135 var buttonUp = clone.getElementsByTagName('img')[0];
136 buttonUp.setAttribute('onclick',"upSubfield('" + new_id + "')");
142 // do nothing if ButtonPlus & CloneButtonPlus don't exist.
144 // insert this line on the page
145 original.parentNode.insertBefore(clone,original.nextSibling);
149 * This function creates a random number
151 function CreateKey(){
152 return parseInt(Math.random() * 100000);
155 $(document).ready(function() {
156 $("#cataloguing_additem_itemlist tr").hover(
157 function () {$(this).attr("class","highlight");},
158 function () {$(this).attr("class","" );}
162 function set_to_today(id, force) {
163 if (! id) { alert("Bad id " + id + " sent to set_to_today()"); return 0; }
164 if ($("#" + id).val() == '' || $("#" + id).val() == '0000-00-00' || force) {
165 $("#" + id).val("<!-- TMPL_VAR NAME="today_iso" -->");
170 <link type="text/css" rel="stylesheet" href="<!-- TMPL_VAR NAME="themelang" -->/css/addbiblio.css" />
173 <!-- TMPL_INCLUDE NAME="header.inc" -->
174 <div id="breadcrumbs">
175 <a href="/cgi-bin/koha/mainpage.pl">Home</a>
176 › <a href="/cgi-bin/koha/cataloguing/addbooks.pl">Cataloging</a>
177 › Edit <a href="/cgi-bin/koha/cataloguing/addbiblio.pl?biblionumber=<!-- TMPL_VAR NAME="biblionumber" -->"><!-- TMPL_VAR name="title" escape="html" --> <!-- TMPL_IF NAME="author" --> by <!-- TMPL_VAR name="author" --><!-- /TMPL_IF --> (Record #<!-- TMPL_VAR NAME="biblionumber" -->)</a>
178 › <a href="/cgi-bin/koha/cataloguing/additem.pl?biblionumber=<!-- TMPL_VAR NAME="biblionumber" -->">Items</a>
181 <div id="doc3" class="yui-t2">
188 <h1>Items for <!-- TMPL_VAR name="title" escape="html" --> <!-- TMPL_IF NAME="author" --> by <!-- TMPL_VAR name="author" --><!-- /TMPL_IF --> (Record #<!-- TMPL_VAR NAME="biblionumber" -->)</h1>
190 <!-- TMPL_IF NAME="barcode_not_unique" --><div class="dialog alert"><strong>Error saving item</strong>: Barcode must be unique.</div><!-- /TMPL_IF -->
191 <!-- TMPL_IF NAME="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><!-- /TMPL_IF -->
192 <!-- TMPL_IF NAME="book_on_loan" --><div class="dialog alert"><strong>Cannot Delete</strong>: item is checked out.</div><!-- /TMPL_IF -->
193 <!-- TMPL_IF NAME="book_reserved" --><div class="dialogalert"><strong>Cannot Delete</strong>: item has a waiting hold.</div><!-- /TMPL_IF -->
195 <div id="cataloguing_additem_itemlist">
196 <!-- TMPL_IF name="item_loop" -->
200 <th colspan="2"> </th>
201 <!-- TMPL_LOOP NAME="item_header_loop" -->
203 <!-- TMPL_VAR NAME="header_value" -->
207 <!-- TMPL_LOOP NAME="item_loop" -->
208 <tr id="row<!-- TMPL_VAR NAME="itemnumber" -->">
209 <!-- TMPL_IF Name="nomod"--> <td colspan="2"> </td><!--TMPL_ELSE--><td><a href="additem.pl?op=edititem&biblionumber=<!-- TMPL_VAR NAME="biblionumber" -->&itemnumber=<!-- TMPL_VAR NAME="itemnumber" -->#edititem">Edit</a></td>
210 <td><a class="delete" href="/cgi-bin/koha/cataloguing/additem.pl?op=delitem&biblionumber=<!-- TMPL_VAR NAME="biblionumber" -->&itemnumber=<!-- TMPL_VAR NAME="itemnumber" -->" onclick="confirm_deletion(<!-- TMPL_VAR NAME="biblionumber" -->,<!-- TMPL_VAR NAME="itemnumber" -->); return false;">Delete</a></td><!--/TMPL_IF-->
211 <!-- TMPL_LOOP NAME="item_value" -->
212 <td><!-- TMPL_VAR ESCAPE=HTML NAME="field" --></td>
221 <div id="cataloguing_additem_newitem">
222 <form method="post" action="/cgi-bin/koha/cataloguing/additem.pl" name="f">
223 <input type="hidden" name="op" value="<!-- TMPL_VAR NAME="op" -->" />
224 <input type="hidden" name="biblionumber" value="<!-- TMPL_VAR NAME="biblionumber" -->" />
225 <!-- TMPL_IF name="opisadd" -->
226 <h2 id="additema">Add Item</h2>
228 <h2 id="edititem">Edit Item #<!-- TMPL_VAR NAME="itemnumber" --></h2>
230 <fieldset class="rows">
232 <!-- TMPL_LOOP NAME="item" -->
233 <li><div class="subfield_line" style="<!-- TMPL_VAR NAME='visibility' -->" id="subfield<!-- TMPL_VAR NAME='tag' --><!-- TMPL_VAR NAME='subfield' --><!-- TMPL_VAR name="random" -->">
235 <label><!-- TMPL_VAR NAME="subfield" --> - <!-- TMPL_IF name="mandatory" --><b><!-- /TMPL_IF --><!-- TMPL_VAR NAME="marc_lib" --><!-- TMPL_IF name="mandatory" --> *</b><!-- /TMPL_IF --></label>
236 <!-- TMPL_VAR NAME="marc_value" -->
237 <input type="hidden" name="tag" value="<!-- TMPL_VAR NAME="tag" -->" />
238 <input type="hidden" name="subfield" value="<!-- TMPL_VAR NAME="subfield" -->" />
239 <input type="hidden" name="mandatory" value="<!-- TMPL_VAR NAME="mandatory" -->" />
240 <!-- TMPL_IF NAME="repeatable" -->
241 <span class="buttonPlus" onclick="CloneSubfield('subfield<!-- TMPL_VAR NAME='tag' --><!-- TMPL_VAR NAME='subfield' --><!-- TMPL_VAR name="random" -->')">+</span>
248 <input type="hidden" name="indicator" value=" " />
249 <input type="hidden" name="indicator" value=" " />
250 <input type="hidden" name="itemnumber" value="<!-- TMPL_VAR NAME="itemnumber" -->" />
252 <fieldset class="action"> <!-- TMPL_IF name="opisadd" -->
253 <input type="submit" name="phony_submit" value="phony_submit" id="phony_submit" style="display:none;" onclick="return false;" />
254 <!-- 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 copies
255 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.
256 It is a bit tricky, but necessary in the sake of UI correctness.
259 <input type="submit" name="add_submit" value="Add item" onclick="return Check(this.form)" />
260 <input type="submit" name="add_duplicate_submit" value="Add & Duplicate" onclick="return Check(this.form)" />
261 <input type="submit" name="add_multiple_copies" value="Add Multiple Copies" onclick="javascript:this.nextSibling.style.visibility='visible';document.f.number_of_copies.focus(); return false;" /><span id="add_multiple_copies_span" style="visibility:hidden">
262 <label for="number_of_copies">Number of copies to add : </label>
263 <input type="text" id="number_of_copies" name="number_of_copies" value="" size="2" />
264 <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);" />
268 <input type="hidden" name="tag" value="<!-- TMPL_VAR NAME="itemtagfield" -->" />
269 <input type="hidden" name="subfield" value="<!-- TMPL_VAR NAME="itemtagsubfield" -->" />
270 <input type="hidden" name="field_value" value="<!-- TMPL_VAR NAME="itemnumber" -->" />
271 <input type="submit" value="Save Changes" onclick="return Check(this.form)" />
272 <!-- /TMPL_IF --></fieldset>
279 <!-- TMPL_INCLUDE NAME="biblio-view-menu.inc" -->
282 <!-- TMPL_INCLUDE NAME="intranet-bottom.inc" -->