mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-05-21 19:35:38 +00:00
* UI/WebServerResources/generic.js (openGenericWindow):
New method that opens a simple new window. * UI/WebServerResources/ContactsUI.js (onMenuRawContact): New callback to show the vCard content from the menu. * UI/WebServerResources/ContactsUI.js (onContactMenuPrepareVisibility): Enable the export and raw functions only on vcards contacts. * UI/Templates/ContactsUI/UIxContactFoldersView.wox: New contextual menu item: Show vCard content * UI/Contacts/UIxContactFolderActions.m (rawAction): New method that returns the raw contact data for all the contact uids provided Monotone-Parent: f03db6cb5531dddabab4e8678d856fe593d3745d Monotone-Revision: e853157abbabf35bc95273da8bc10b2d3b142627 Monotone-Author: jraby@inverse.ca Monotone-Date: 2012-07-05T21:16:02
This commit is contained in:
@@ -290,6 +290,20 @@ function onMenuExportContact (event) {
|
||||
}
|
||||
}
|
||||
|
||||
function onMenuRawContact (event) {
|
||||
var selectedFolders = $("contactFolders").getSelectedNodes();
|
||||
var canExport = (selectedFolders[0].getAttribute("owner") != "nobody");
|
||||
if (canExport) {
|
||||
var selectedFolderId = $(selectedFolders[0]).readAttribute("id");
|
||||
var contactIds = document.menuTarget.collect(function(row) {
|
||||
return row.readAttribute("id");
|
||||
});
|
||||
var url = ApplicationBaseURL + selectedFolderId + "/raw"
|
||||
+ "?uid=" + contactIds.join("&uid=");
|
||||
openGenericWindow(url);
|
||||
}
|
||||
}
|
||||
|
||||
function actionContactCallback(http) {
|
||||
if (http.readyState == 4)
|
||||
if (isHttpStatus204(http.status)) {
|
||||
@@ -1176,6 +1190,19 @@ function onContactMenuPrepareVisibility() {
|
||||
deleteOption.removeClassName("disabled");
|
||||
moveOption.removeClassName("disabled");
|
||||
}
|
||||
|
||||
var exportOption = elements[10];
|
||||
var rawOption = elements[11];
|
||||
if ($(selectedFolder).getAttribute("owner") == "nobody") {
|
||||
// public folders (ldap) cannot export or show raw contacts
|
||||
exportOption.addClassName("disabled");
|
||||
rawOption.addClassName("disabled");
|
||||
}
|
||||
else {
|
||||
exportOption.removeClassName("disabled");
|
||||
rawOption.removeClassName("disabled");
|
||||
}
|
||||
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -1197,7 +1224,7 @@ getMenus = function() {
|
||||
onMenuWriteToContact, onMenuAIMContact,
|
||||
"-", onMenuDeleteContact, "-",
|
||||
"moveContactMenu", "copyContactMenu",
|
||||
onMenuExportContact);
|
||||
onMenuExportContact, onMenuRawContact);
|
||||
menus["searchMenu"] = new Array(setSearchCriteria, setSearchCriteria);
|
||||
|
||||
var contactFoldersMenu = $("contactFoldersMenu");
|
||||
|
||||
Reference in New Issue
Block a user