View | Details | Raw Unified | Return to bug 10347
Collapse All | Expand All

(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/additem.tt (-24 / +29 lines)
Lines 42-64 $(document).ready(function(){ Link Here
42
        "bAutoWidth": false
42
        "bAutoWidth": false
43
    } ) );
43
    } ) );
44
44
45
    var multiCopyControl = $("#add_multiple_copies_span");
46
    var addMultipleBlock = $("#addmultiple");
47
    var addSingleBlock = $("#addsingle");
48
    multiCopyControl.hide();
49
    $("#add_multiple_copies").on("click",function(e){
50
        e.preventDefault;
51
        addMultipleBlock.toggle();
52
        addSingleBlock.toggle();
53
        multiCopyControl.toggle();
54
    });
55
    $("#cancel_add_multiple").on("click",function(e){
56
        e.preventDefault();
57
        addMultipleBlock.toggle();
58
        addSingleBlock.toggle();
59
        multiCopyControl.toggle();
60
    });
45
});
61
});
46
function active(numlayer)
62
47
{
48
    for (i=10; i < 11 ; i++ ) {
49
        ong = i+"XX";
50
            link = "link"+i;
51
        if (numlayer==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)";
55
        } else {
56
            document.getElementById(ong).style.visibility="hidden";
57
            document.getElementById(link).style.backgroundColor="#FFFFFF";
58
            document.getElementById(link).style.backgroundImage="";
59
        }
60
    }
61
}
62
function Check(f) {
63
function Check(f) {
63
    var total_errors = CheckMandatorySubfields(f);
64
    var total_errors = CheckMandatorySubfields(f);
64
    if (total_errors > 0) {
65
    if (total_errors > 0) {
Lines 236-249 $(document).ready(function() { Link Here
236
		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.
237
		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.
237
		It is a bit tricky, but necessary in the sake of UI correctness.
238
		It is a bit tricky, but necessary in the sake of UI correctness.
238
    -->
239
    -->
239
240
    <span id="addsingle">
240
    <input type="submit" name="add_submit" value="Add item" onclick="return Check(this.form)" />
241
        <input type="submit" name="add_submit" value="Add item" onclick="return Check(this.form)" />
241
    <input type="submit" name="add_duplicate_submit" value="Add &amp; duplicate" onclick="return Check(this.form)" />
242
        <input type="submit" name="add_duplicate_submit" value="Add &amp; duplicate" onclick="return Check(this.form)" />
242
    <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">
243
    </span>
243
    <label for="number_of_copies">Number of items to add : </label>
244
    <span id="addmultiple">
244
	<input type="text" id="number_of_copies" name="number_of_copies" value="" size="2" />
245
        <input type="button" name="add_multiple_copies" id="add_multiple_copies" value="Add multiple copies of this item" />
245
	<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);" />
246
    </span>
246
    </span>
247
    <fieldset id="add_multiple_copies_span">
248
        <label for="number_of_copies">Number of copies of this item to add: </label>
249
        <input type="text" id="number_of_copies" name="number_of_copies" value="" size="2" />
250
        <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>
251
        <div class="hint"><p>The barcode you enter will be incremented for each additional item.</p></div>
252
    </fieldset>
247
253
248
    [% ELSE %]
254
    [% ELSE %]
249
    <input type="hidden" name="tag" value="[% itemtagfield %]" />
255
    <input type="hidden" name="tag" value="[% itemtagfield %]" />
250
- 

Return to bug 10347