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

(-)a/koha-tmpl/intranet-tmpl/prog/js/additem.js (-4 / +3 lines)
Lines 161-168 function cloneItemBlock(index, unique_item_fields, callback) { Link Here
161
        }
161
        }
162
    }
162
    }
163
163
164
    var random = Math.floor(Math.random()*100000); // get a random itemid.
165
    var clone = $("<div id='itemblock"+random+"'></div>")
166
    $.ajax({
164
    $.ajax({
167
        url: "/cgi-bin/koha/services/itemrecorddisplay.pl",
165
        url: "/cgi-bin/koha/services/itemrecorddisplay.pl",
168
        dataType: 'html',
166
        dataType: 'html',
Lines 171-176 function cloneItemBlock(index, unique_item_fields, callback) { Link Here
171
        },
169
        },
172
        success: function(data, textStatus, jqXHR) {
170
        success: function(data, textStatus, jqXHR) {
173
            /* Create the item block */
171
            /* Create the item block */
172
            var random = Math.floor(Math.random()*100000); // get a random itemid.
173
            var clone = $("<div/>", { id: 'itemblock'+random });
174
            $("#outeritemblock").append(clone);
174
            $(clone).append(data);
175
            $(clone).append(data);
175
            /* Change all itemid fields value */
176
            /* Change all itemid fields value */
176
            $(clone).find("input[name='itemid']").each(function(){
177
            $(clone).find("input[name='itemid']").each(function(){
Lines 209-215 function cloneItemBlock(index, unique_item_fields, callback) { Link Here
209
                }
210
                }
210
            });
211
            });
211
212
212
            $("#outeritemblock").append(clone);
213
            if (typeof callback === "function"){
213
            if (typeof callback === "function"){
214
                var cloneIndex = "itemblock"+random;
214
                var cloneIndex = "itemblock"+random;
215
                callback(cloneIndex);
215
                callback(cloneIndex);
216
- 

Return to bug 18183