mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-23 09:53:15 +00:00
Merge branch '3.8'
Conflicts: composer.json composer.lock lib/Alchemy/Phrasea/Application.php lib/Alchemy/Phrasea/Controller/Admin/Publications.php lib/Alchemy/Phrasea/Controller/Admin/Users.php lib/Alchemy/Phrasea/Controller/Client/Root.php lib/Alchemy/Phrasea/Controller/Prod/Feed.php lib/Alchemy/Phrasea/Controller/Prod/Root.php lib/Alchemy/Phrasea/Controller/Report/Activity.php lib/Alchemy/Phrasea/Controller/Report/Export.php lib/Alchemy/Phrasea/Controller/Report/Informations.php lib/Alchemy/Phrasea/Controller/Report/Root.php lib/classes/API/V1/adapter.php lib/classes/Feed/Aggregate.php lib/classes/Feed/Collection.php lib/classes/format.php tests/Alchemy/Tests/Phrasea/Controller/Admin/PublicationTest.php tests/Alchemy/Tests/Phrasea/Controller/Prod/FeedTest.php tests/Alchemy/Tests/Phrasea/Controller/Report/ExportTest.php tests/Alchemy/Tests/Phrasea/Controller/Root/RSSFeedTest.php tests/classes/Feed/Feed_CollectionTest.php tests/classes/api/v1/api_v1_adapterTest.php
This commit is contained in:
@@ -790,68 +790,27 @@ function print() {
|
||||
}
|
||||
|
||||
function csv() {
|
||||
var button = $(".form_csv input[name=submit]");
|
||||
var button = $("#export_csv");
|
||||
|
||||
button.unbind("click").bind("click", function (e) {
|
||||
e.preventDefault();
|
||||
var $this = $(this);
|
||||
var $formm = $this.closest("form");
|
||||
|
||||
if ($this.closest("#dialog").length > 0) {
|
||||
var $form = $("#dialog").data("dataForm");
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
var $form = $this.closest(".ui-tabs-panel").find(".report_form");
|
||||
}
|
||||
|
||||
$form.find("input[name=printcsv]").val("on");
|
||||
//clone form and submit
|
||||
var clone = $form.clone().appendTo($this);
|
||||
|
||||
if (button.data('ajaxRunning')) {
|
||||
button.data('ajaxQuery').abort();
|
||||
button.data('ajaxRunning', false);
|
||||
}
|
||||
clone.attr("action", $form.find("input[name=action]").val())
|
||||
.attr("method",'POST')
|
||||
.removeAttr("onsubmit")
|
||||
.find("input[name=printcsv]").val("on");
|
||||
|
||||
var query = $.ajax({
|
||||
type: "POST",
|
||||
url: $form.find("input[name=action]").val(),
|
||||
dataType: "json",
|
||||
data: $form.serializeArray(),
|
||||
beforeSend: function () {
|
||||
$formm.after("<div></div>");
|
||||
$formm.next("div").addClass("onload");
|
||||
button.data('ajaxRunning', true);
|
||||
},
|
||||
timeOut: function () {
|
||||
button.data('ajaxRunning', false);
|
||||
},
|
||||
error: function () {
|
||||
button.data('ajaxRunning', false);
|
||||
},
|
||||
success: function (data) {
|
||||
$formm.next("div").remove();
|
||||
button.data('ajaxRunning', false);
|
||||
$form.find("input[name=printcsv]").val("off");
|
||||
|
||||
if (typeof data.rs === "object") {
|
||||
var $key = $this.closest("table").attr("class");
|
||||
var $csv = data.rs[$key];
|
||||
$formm.find("textarea[name=csv]").val($csv);
|
||||
}
|
||||
else if (data.rs === false) {
|
||||
$("body").append("<div id='dialog'>Une erreur s'est produite</div>");
|
||||
$("#dialog").dialog({
|
||||
close: function () {
|
||||
$(this).remove();
|
||||
}
|
||||
});
|
||||
}
|
||||
else {
|
||||
$formm.find("textarea[name=csv]").val(data.rs);
|
||||
}
|
||||
$formm.find("input[name=doit]").trigger('click');
|
||||
}
|
||||
});
|
||||
button.data('ajaxQuery', query);
|
||||
$(clone).submit().remove();
|
||||
});
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user