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