diff --git a/templates/web/prod/upload/lazaret.html.twig b/templates/web/prod/upload/lazaret.html.twig index b79d30ba65..eb0c9f19d0 100644 --- a/templates/web/prod/upload/lazaret.html.twig +++ b/templates/web/prod/upload/lazaret.html.twig @@ -176,25 +176,32 @@ emptying = true; f(); }); - + var data; //add lazaret file click action $("button.add-lazaret", scope).bind('click', function () { var that = $(this); var lazaretId = getLazaretId(that); var destinationCollectionId = getDestinationId(that); + var container = $(this).closest('.wrapper-item'); var form = $(this).closest("form"); + /*fix POST on firefox*/ + data = form.serializeArray(); + var allData = that.parent().closest('.wrapper-item').find(".change-record-wrapper").html(); + that.closest(".form-backup ").append(allData); + that.parent().closest('.wrapper-item').find(".change-record ").remove(); + $.ajax({ type: 'POST', url: '/prod/lazaret/' + lazaretId + '/force-add/', dataType: 'json', - data: form.serializeArray(), + data: data, beforeSend: function () { startAjax(that); }, success: function (data) { if (data.success) { - that.closest(".wrapper-item").remove(); + container.remove(); } else { var html = _.template($("#alert_error_tpl").html(), { content: data.message @@ -219,6 +226,12 @@ $("button.delete-lazaret", scope).bind('click', function () { var that = $(this); var lazaretId = getLazaretId(that); + var container = $(this).closest('.wrapper-item'); + var form = $(this).closest("form"); + data = form.serializeArray(); + var allData = that.parent().closest('.wrapper-item').find(".change-record-wrapper").html(); + that.closest(".form-backup ").append(allData); + that.parent().closest('.wrapper-item').find(".change-record ").remove(); $.ajax({ type: 'POST', @@ -229,7 +242,7 @@ }, success: function (data) { if (data.success) { - that.closest(".wrapper-item").remove(); + container.remove(); } else { var html = _.template($("#alert_error_tpl").html(), { content: data.message @@ -362,17 +375,24 @@ var form = $(this).closest("form"); $(".record_id").val(recordId); + + var form = $(this).closest("form"); + data = form.serializeArray(); + var allData = that.parent().closest('.wrapper-item').find(".change-record-wrapper").html(); + that.closest(".form-backup ").append(allData); + that.parent().closest('.wrapper-item').find(".change-record ").remove(); + $.ajax({ type: 'POST', url: '/prod/lazaret/' + lazaretId + '/accept/', dataType: 'json', - data: form.serializeArray(), + data: data, beforeSend: function () { startAjax(that); }, success: function (data) { if (data.success) { - that.closest(".wrapper-item").remove(); + container.remove(); } else { var html = _.template($("#alert_error_tpl").html(), { content: data.message @@ -425,82 +445,85 @@
{{ border_checker_from_fqcn(check.getCheckClassname()).getMessage(app['translator']) }}
{% endfor %} - + {# bloc to backup initial value of status list#}