Bug 2774 - Path to theme is hard-coded in many places
[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 [% INCLUDE 'doc-head-close.inc' %]
4 <script type="text/javascript" src="[% themelang %]/js/cataloging.js"></script>
5 <script type="text/javascript">
6 //<![CDATA[
7 $(document).ready(function(){
8     [% IF (popup) %]
9         [% IF (opisadd) %]
10             window.close();
11         [% END %]
12     [% END %]
13                 $("fieldset.rows input").keydown(function(e){ return checkEnter(e); });
14                 /* Inline edit/delete links */
15                 var biblionumber = $("input[name='biblionumber']").attr("value");
16         $("tr.editable td").click(function(event){
17                         var $tgt = $(event.target);
18                         if($tgt.is("a")||$tgt.is(":first-child")||$tgt.is(":nth-child(2)")){ return true; } else {
19                         var rowid = $(this).parent().attr("id");
20                         num_rowid = rowid.replace("row","");
21                         $(".linktools").remove();
22                         $(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>");
23                 }
24                 });
25 });
26 function active(numlayer)
27 {
28     for (i=10; i < 11 ; i++ ) {
29         ong = i+"XX";
30             link = "link"+i;
31         if (numlayer==i) {
32             document.getElementById(ong).style.visibility="visible";
33             document.getElementById(link).style.backgroundColor="#11AA11";
34             document.getElementById(link).style.backgroundImage="url([% themelang %]/images/background-mem.gif)";
35         } else {
36             document.getElementById(ong).style.visibility="hidden";
37             document.getElementById(link).style.backgroundColor="#FFFFFF";
38             document.getElementById(link).style.backgroundImage="";
39         }
40     }
41 }
42 function Check(f) {
43     var total_errors=0;
44     $("input[name='mandatory'],select[name='mandatory']").each(function(i){
45         if($(this).val() == 1){
46             var mandatory_field = $("input[name='field_value'],select[name='field_value']").eq(i);
47             if(mandatory_field.val() == ''){
48                 mandatory_field.addClass("missing");
49                 total_errors++;
50             }
51         }
52     });
53
54     var alertString2;
55     if (total_errors==0) {
56         return true;
57     } else {
58         alertString2  = _("Form not submitted because of the following problem(s)");
59         alertString2 += "\n------------------------------------------------------------------------------------\n";
60         alertString2 += "\n- "+ total_errors+_(" mandatory fields empty (highlighted)");
61         alert(alertString2);
62         return false;
63     }
64 }
65 function CheckMultipleAdd(f) {
66
67     if (!f || isNaN(f) || !parseInt(f) == f || f <= 0) {
68         alert(_("Please enter a number of items to create."));
69         return false;
70     }
71 }
72 function Dopop(link,i) {
73     defaultvalue=document.forms[0].field_value[i].value;
74     newin=window.open(link+"&result="+defaultvalue,"valuebuilder",'width=500,height=400,toolbar=false,scrollbars=yes');
75 }
76
77 function confirm_deletion(biblionumber,itemnumber) {
78         var original = $("#row"+itemnumber).attr("class");
79         $("#row"+itemnumber).attr("class","confirm");
80     var is_confirmed = confirm(_("Are you sure you want to delete this item?"));
81     if (is_confirmed) {
82     window.location = "additem.pl?op=delitem&biblionumber="+biblionumber+"&itemnumber="+itemnumber;
83         } else {
84         $("#row"+itemnumber).attr("class","");
85     }
86 }
87
88 $(document).ready(function() {
89     $("#cataloguing_additem_itemlist  tr").hover(
90         function () {$(this).addClass("highlight");},
91         function () {$(this).removeClass("highlight");}
92     );
93 });
94 //]]>
95 </script>
96 <link type="text/css" rel="stylesheet" href="[% themelang %]/css/addbiblio.css" />
97 [% IF ( bidi ) %]
98    <link rel="stylesheet" type="text/css" href="[% themelang %]/css/right-to-left.css" />
99 [% END %]
100 </head>
101 <body id="cat_additem" class="cat">
102 [% INCLUDE 'header.inc' %]
103 <div id="breadcrumbs">
104           <a href="/cgi-bin/koha/mainpage.pl">Home</a>
105  &rsaquo; <a href="/cgi-bin/koha/cataloguing/addbooks.pl">Cataloging</a>
106  &rsaquo; Edit <a href="/cgi-bin/koha/cataloguing/addbiblio.pl?biblionumber=[% biblionumber %]">[% title |html %] [% IF ( author ) %] by [% author %][% END %] (Record #[% biblionumber %])</a>
107  &rsaquo; <a href="/cgi-bin/koha/cataloguing/additem.pl?biblionumber=[% biblionumber %]">Items</a>
108 </div>
109
110 <div id="doc3" class="yui-t7">
111
112    <div id="bd">
113         <div id="yui-main">
114
115 <h1>Items for [% title |html %] [% IF ( author ) %] by [% author %][% END %] (Record #[% biblionumber %])</h1>
116
117 [% IF ( barcode_not_unique ) %]<div class="dialog alert"><strong>Error saving item</strong>: Barcode must be unique.</div>[% END %]
118 [% 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 %]
119 [% IF ( book_on_loan ) %]<div class="dialog alert"><strong>Cannot Delete</strong>: item is checked out.</div>[% END %]
120 [% IF ( book_reserved ) %]<div class="dialogalert"><strong>Cannot Delete</strong>: item has a waiting hold.</div>[% END %]
121 [% IF ( not_same_branch ) %]<div class="dialog alert"><strong>Cannot Delete</strong>: The items do not belong to your library.</div>[% END %]
122 [% 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 %]
123
124 <div id="cataloguing_additem_itemlist">
125     [% IF ( item_loop ) %]
126         <div>
127         <table>
128             <tr>
129                 <th colspan="2">&nbsp;</th>
130                 [% FOREACH item_header_loo IN item_header_loop %]
131                     <th>
132                         [% item_header_loo.header_value %]
133                     </th>
134                 [% END %]
135             </tr>
136                 [% FOREACH item_loo IN item_loop %]
137                     [% IF ( item_loo.itemnumber == itemnumber) %]
138                         [% IF item_loo.nomod %]
139                            <tr id="row[% item_loo.itemnumber %]" class="active">
140                         [% ELSE %]
141                             <tr id="row[% item_loo.itemnumber %]" class="active editable">
142                         [% END %]
143                     [% ELSE %]
144                         [% IF item_loo.nomod %]
145                            <tr id="row[% item_loo.itemnumber %]">
146                         [% ELSE %]
147                             <tr id="row[% item_loo.itemnumber %]" class="editable">
148                         [% END %]
149                     [% END %]
150                     [% IF ( item_loo.nomod ) %] <td colspan="2">&nbsp;</td>[% ELSE %][% IF ( item_loo.hostitemflag ) %]<td><a href="additem.pl?op=edititem&amp;biblionumber=[% item_loo.hostbiblionumber %]&amp;itemnumber=[% item_loo.itemnumber %]#edititem">Edit in host</a></td>
151 <td><a class="delete" href="/cgi-bin/koha/cataloguing/additem.pl?op=delinkitem&amp;biblionumber=[% biblionumber %]&amp;hostitemnumber=[% item_loo.itemnumber %]">Delink</a></td>
152 [% ELSE %]<td><a href="additem.pl?op=edititem&amp;biblionumber=[% biblionumber %]&amp;itemnumber=[% item_loo.itemnumber %]#edititem">Edit</a></td>
153                     <td>[% IF ( item_loo.countanalytics ) %]<a href="/cgi-bin/koha/catalogue/search.pl?idx=hi&amp;q=% item_loo.itemnumber %]">View analytics</a>[% ELSE %]<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>[% END %]</td>[% END %][% END %]
154                 [% FOREACH item_valu IN item_loo.item_value %]
155                     <td>[% item_valu.field |html %]</td>
156                 [% END %]
157                 </tr>
158                 [% END %]
159         </table>
160         </div>
161     [% END %]
162 </div>
163 <div class="yui-gf">
164 <div class="yui-u first">
165 [% INCLUDE 'biblio-view-menu.inc' %]
166 </div>
167 <div class="yui-u">
168 <div id="cataloguing_additem_newitem">
169     <form method="post" action="/cgi-bin/koha/cataloguing/additem.pl" name="f">
170     <input type="hidden" name="op" value="[% op %]" />
171     [% IF (popup) %]
172         <input type="hidden" name="popup" value="1" />
173     [% END %]
174     <input type="hidden" name="biblionumber" value="[% biblionumber %]" />
175     [% IF ( opisadd ) %]
176         <h2 id="additema">Add item [% IF (circborrowernumber) %]<em>(fast cataloging)</em>[% END %]</h2>
177     [% ELSE %]
178         <h2 id="edititem">Edit Item #[% itemnumber %][% IF ( barcode ) %] / Barcode [% barcode %][% END %]</h2>
179     [% END %]
180         <fieldset class="rows">
181         <ol>
182         [% FOREACH ite IN item %]
183                <li><div class="subfield_line" style="[% ite.visibility %]" id="subfield[% ite.tag %][% ite.subfield %][% ite.random %]">
184                 [% IF ( ite.mandatory ) %]
185                <label class="required">[% ite.subfield %] - [% ite.marc_lib %]</label>
186                [% ELSE %]
187                <label>[% ite.subfield %] - [% ite.marc_lib %]</label>
188                [% END %]
189                 [% ite.marc_value %]
190                 <input type="hidden" name="tag"       value="[% ite.tag %]" />
191                 <input type="hidden" name="subfield"  value="[% ite.subfield %]" />
192                 <input type="hidden" name="mandatory" value="[% ite.mandatory %]" />
193                 [% IF ( ite.repeatable ) %]
194                     <a href="#" class="buttonPlus" onclick="CloneItemSubfield(this.parentNode); return false;">
195                         <img src="[% interface %]/[% theme %]/img/clone-subfield.png" alt="Clone" title="Clone this subfield" />
196                     </a>
197                 [% END %]
198                 [% IF ( ite.mandatory ) %] <span class="required">Required</span>[% END %]
199             </div></li>
200         [% END %]
201     </ol>
202     </fieldset>
203     <input type="hidden" name="indicator" value=" " />
204     <input type="hidden" name="indicator" value=" " />
205     <input type="hidden" name="itemnumber" value="[% itemnumber %]" />
206
207 <fieldset class="action">    [% IF ( opisadd ) %]
208     <input type="submit" name="phony_submit" value="phony_submit" id="phony_submit" style="display:none;" onclick="return false;" />
209     <!-- 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
210                 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.
211                 It is a bit tricky, but necessary in the sake of UI correctness.
212     -->
213
214     <input type="submit" name="add_submit" value="Add item" onclick="return Check(this.form)" />
215     <input type="submit" name="add_duplicate_submit" value="Add &amp; duplicate" onclick="return Check(this.form)" />
216     <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">
217         <label for="number_of_copies">Number of copies to add : </label>
218         <input type="text" id="number_of_copies" name="number_of_copies" value="" size="2" />
219         <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);" />
220     </span>
221
222     [% ELSE %]
223     <input type="hidden" name="tag" value="[% itemtagfield %]" />
224     <input type="hidden" name="subfield" value="[% itemtagsubfield %]" />
225     <input type="hidden" name="field_value" value="[% itemnumber %]" />
226     <input type="submit" value="Save changes" onclick="return Check(this.form)" />
227     [% END %]</fieldset>
228     
229     [%# Fields for fast cataloging %]
230     <input type="hidden" name="circborrowernumber" value="[% circborrowernumber %]" />
231     <input type="hidden" name="stickyduedate" value="[% stickyduedate %]" />
232     <input type="hidden" name="barcode" value="[% barcode %]" />
233     <input type="hidden" name="duedatespec" value="[% duedatespec %]" />
234     [%# End fields for fast cataloging %]
235
236
237     </form>
238 </div>
239 </div><!-- /yui-u -->
240 </div><!-- /yui-gf -->
241
242 </div>
243 </div>
244 [% INCLUDE 'intranet-bottom.inc' %]