Use a POST to copy/move contacts
By submitting the ajax request as a post, we avoid reaching the web server url length limit. Fixes #1887
This commit is contained in:
parent
d77f6be450
commit
a51fb9e28b
|
@ -257,14 +257,16 @@ function _onContactMenuAction(folderItem, action, refresh) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
var url = ApplicationBaseURL + selectedFolderId + "/" + action
|
var url = ApplicationBaseURL + selectedFolderId + "/" + action;
|
||||||
+ "?folder=" + folderId + "&uid="
|
|
||||||
+ contactIds.join("&uid=");
|
|
||||||
|
|
||||||
if (refresh)
|
if (refresh)
|
||||||
triggerAjaxRequest(url, actionContactCallback, selectedFolderId);
|
triggerAjaxRequest(url, actionContactCallback, selectedFolderId,
|
||||||
|
('folder='+ folderId + '&uid=' + contactIds.join('&uid=')),
|
||||||
|
{ "Content-type": "application/x-www-form-urlencoded" });
|
||||||
|
|
||||||
else
|
else
|
||||||
triggerAjaxRequest(url, actionContactCallback);
|
triggerAjaxRequest(url, actionContactCallback, null,
|
||||||
|
('folder='+ folderId + '&uid=' + contactIds.join('&uid=')),
|
||||||
|
{ "Content-type": "application/x-www-form-urlencoded" });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -313,7 +315,7 @@ function actionContactCallback(http) {
|
||||||
if (parseInt(http.status) == 403)
|
if (parseInt(http.status) == 403)
|
||||||
showAlertDialog(_("You don't have the required privileges to perform the operation."));
|
showAlertDialog(_("You don't have the required privileges to perform the operation."));
|
||||||
else if (error)
|
else if (error)
|
||||||
showAlertDialog(labels[error]);
|
showAlertDialog(_(error));
|
||||||
refreshCurrentFolder();
|
refreshCurrentFolder();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1579,11 +1581,11 @@ function dropSelectedContacts(action, toId) {
|
||||||
var fromId = $(selectedFolders[0]).id;
|
var fromId = $(selectedFolders[0]).id;
|
||||||
if ((!currentFolderIsRemote() || action != "move")
|
if ((!currentFolderIsRemote() || action != "move")
|
||||||
&& fromId.substring(1) != toId) {
|
&& fromId.substring(1) != toId) {
|
||||||
var url = ApplicationBaseURL + fromId + "/" + action
|
|
||||||
+ "?folder=" + toId + "&uid="
|
|
||||||
+ contactIds.join("&uid=");
|
|
||||||
|
|
||||||
triggerAjaxRequest(url, actionContactCallback, fromId);
|
var url = ApplicationBaseURL + fromId + "/" + action;
|
||||||
|
triggerAjaxRequest(url, actionContactCallback, fromId,
|
||||||
|
('folder='+ toId + '&uid=' + contactIds.join('&uid=')),
|
||||||
|
{ "Content-type": "application/x-www-form-urlencoded" });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue