Lines 17-22
Link Here
|
17 |
browser.show(); |
17 |
browser.show(); |
18 |
|
18 |
|
19 |
$(document).ready(function(){ |
19 |
$(document).ready(function(){ |
|
|
20 |
[% IF opisadd && Koha.Preference('RecordItemLimit') && item_loop.size > Koha.Preference('RecordItemLimit') %] |
21 |
$("#f fieldset.rows").hide(); |
22 |
[% END %] |
20 |
|
23 |
|
21 |
// Remove the onclick event defined in browser.js, |
24 |
// Remove the onclick event defined in browser.js, |
22 |
// otherwise the deletion confirmation will not work correctly |
25 |
// otherwise the deletion confirmation will not work correctly |
Lines 118-123
function CheckMultipleAdd(f) {
Link Here
|
118 |
if (f>99) { |
121 |
if (f>99) { |
119 |
return confirm(_("You are about to add %s items. Continue?").format(f)); |
122 |
return confirm(_("You are about to add %s items. Continue?").format(f)); |
120 |
} |
123 |
} |
|
|
124 |
[% IF Koha.Preference('RecordItemLimit') %] |
125 |
[% SET max_new_items = Koha.Preference('RecordItemLimit') - item_loop.size %] |
126 |
if (f > [% max_new_items %]) { |
127 |
alert(_("You are exceeding the [% Koha.Preference('RecordItemLimit') %] limit of items per record. You can only add [% max_new_items %] new item(s).")); |
128 |
return false; |
129 |
} |
130 |
[% END %] |
121 |
} |
131 |
} |
122 |
function Dopop(link,i) { |
132 |
function Dopop(link,i) { |
123 |
defaultvalue=document.forms[0].field_value[i].value; |
133 |
defaultvalue=document.forms[0].field_value[i].value; |
Lines 336-366
function confirm_deletion() {
Link Here
|
336 |
<input type="hidden" name="itemnumber" value="[% itemnumber %]" /> |
346 |
<input type="hidden" name="itemnumber" value="[% itemnumber %]" /> |
337 |
|
347 |
|
338 |
<fieldset class="action"> [% IF ( opisadd ) %] |
348 |
<fieldset class="action"> [% IF ( opisadd ) %] |
339 |
<input type="submit" name="phony_submit" value="phony_submit" id="phony_submit" style="display:none;" onclick="return false;" /> |
349 |
[% IF Koha.Preference('RecordItemLimit') && item_loop.size > Koha.Preference('RecordItemLimit') %] |
340 |
<!-- 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 |
350 |
<div class="dialog alert"> |
341 |
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. |
351 |
[% item_loop.size %] items are attached to this record exceeding the threshold of [% Koha.Preference('RecordItemLimit') %] items. You cannot add more items. |
342 |
It is a bit tricky, but necessary in the sake of UI correctness. |
352 |
</div> |
343 |
--> |
353 |
[% ELSE %] |
344 |
<span id="addsingle"> |
354 |
<input type="submit" name="phony_submit" value="phony_submit" id="phony_submit" style="display:none;" onclick="return false;" /> |
345 |
<input type="submit" name="add_submit" value="Add item" onclick="return Check(this.form)" /> |
355 |
<!-- 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 |
346 |
<input type="submit" name="add_duplicate_submit" value="Add & duplicate" onclick="return Check(this.form)" /> |
356 |
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. |
347 |
</span> |
357 |
It is a bit tricky, but necessary in the sake of UI correctness. |
348 |
<span id="addmultiple"> |
358 |
--> |
349 |
<input type="button" name="add_multiple_copies" id="add_multiple_copies" value="Add multiple copies of this item" /> |
359 |
<span id="addsingle"> |
350 |
</span> |
360 |
<input type="submit" name="add_submit" value="Add item" onclick="return Check(this.form)" /> |
351 |
<fieldset id="add_multiple_copies_span"> |
361 |
<input type="submit" name="add_duplicate_submit" value="Add & duplicate" onclick="return Check(this.form)" /> |
352 |
<label for="number_of_copies">Number of copies of this item to add: </label> |
362 |
</span> |
353 |
<input type="text" id="number_of_copies" name="number_of_copies" value="" size="2" /> |
363 |
<span id="addmultiple"> |
354 |
<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> |
364 |
<input type="button" name="add_multiple_copies" id="add_multiple_copies" value="Add multiple copies of this item" /> |
355 |
<div class="hint"><p>The barcode you enter will be incremented for each additional item.</p></div> |
365 |
</span> |
356 |
</fieldset> |
366 |
<fieldset id="add_multiple_copies_span"> |
|
|
367 |
<label for="number_of_copies">Number of copies of this item to add: </label> |
368 |
<input type="text" id="number_of_copies" name="number_of_copies" value="" size="2" /> |
369 |
<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> |
370 |
<div class="hint"><p>The barcode you enter will be incremented for each additional item.</p></div> |
371 |
</fieldset> |
372 |
[% END %] |
357 |
|
373 |
|
358 |
[% ELSE %] |
374 |
[% ELSE %] |
359 |
<input type="hidden" name="tag" value="[% itemtagfield %]" /> |
375 |
<input type="hidden" name="tag" value="[% itemtagfield %]" /> |
360 |
<input type="hidden" name="subfield" value="[% itemtagsubfield %]" /> |
376 |
<input type="hidden" name="subfield" value="[% itemtagsubfield %]" /> |
361 |
<input type="hidden" name="field_value" value="[% itemnumber %]" /> |
377 |
<input type="hidden" name="field_value" value="[% itemnumber %]" /> |
362 |
<input type="submit" value="Save changes" onclick="return Check(this.form)"> |
378 |
<input type="submit" value="Save changes" onclick="return Check(this.form)"> |
363 |
<input type="button" id="addnewitem" value="Add a new item"> |
379 |
[% IF Koha.Preference('RecordItemLimit') && item_loop.size > Koha.Preference('RecordItemLimit') %] |
|
|
380 |
<input type="button" id="addnewitem" value="Add a new item" disabled="disabled" title="[% item_loop.size %] item(s) are attached to this record exceeding the threshold of [% Koha.Preference('RecordItemLimit') %] items. You cannot add more items."> |
381 |
[% ELSE %] |
382 |
<input type="button" id="addnewitem" value="Add a new item"> |
383 |
[% END %] |
364 |
<a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% biblionumber %]">Cancel</a> |
384 |
<a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% biblionumber %]">Cancel</a> |
365 |
[% END %]</fieldset> |
385 |
[% END %]</fieldset> |
366 |
|
386 |
|