export: use POST request

This commit is contained in:
yuri
2016-09-22 14:52:11 +03:00
parent 0c44e0d101
commit 2a8baa2f34
2 changed files with 13 additions and 14 deletions
+8 -4
View File
@@ -226,6 +226,10 @@ class Record extends Base
public function actionExport($params, $data, $request)
{
if (!$request->isPost()) {
throw new BadRequest();
}
if ($this->getConfig()->get('exportDisabled') && !$this->getUser()->isAdmin()) {
throw new Forbidden();
}
@@ -234,10 +238,10 @@ class Record extends Base
throw new Forbidden();
}
$ids = $request->get('ids');
$where = $request->get('where');
$byWhere = $request->get('byWhere');
$selectData = $request->get('selectData');
$ids = isset($data['ids']) ? $data['ids'] : null;
$where = isset($data['where']) ? json_decode(json_encode($data['where']), true) : null;
$byWhere = isset($data['byWhere']) ? $data['byWhere'] : false;
$selectData = isset($data['selectData']) ? json_decode(json_encode($data['selectData']), true) : null;
$params = array();
if ($byWhere) {
+5 -10
View File
@@ -309,16 +309,11 @@ Espo.define('views/record/list', 'view', function (Dep) {
data.ids = this.checkedList;
}
$.ajax({
url: this.scope + '/action/export',
type: 'GET',
data: data,
success: function (data) {
if ('id' in data) {
window.location = this.getBasePath() + '?entryPoint=download&id=' + data.id;
}
}.bind(this),
});
this.ajaxPostRequest(this.scope + '/action/export', data).then(function (data) {
if ('id' in data) {
window.location = this.getBasePath() + '?entryPoint=download&id=' + data.id;
}
}.bind(this));
},
massAction: function (name) {