mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-04-27 15:59:29 +00:00
Monotone-Parent: 53787a178138e23c283a66af023cbddab3f3c417
Monotone-Revision: 694c7b017aa273b513c6e1d50eea0215ccaf487c Monotone-Author: flachapelle@inverse.ca Monotone-Date: 2007-11-19T22:40:13 Monotone-Branch: ca.inverse.sogo
This commit is contained in:
@@ -709,6 +709,9 @@ function folderRenameCallback(http) {
|
||||
}
|
||||
|
||||
function onMenuSharing(event) {
|
||||
if ($(this).hasClassName("disabled"))
|
||||
return;
|
||||
|
||||
var folders = $("contactFolders");
|
||||
var selected = folders.getSelectedNodes()[0];
|
||||
var owner = selected.getAttribute("owner");
|
||||
@@ -723,6 +726,21 @@ function onMenuSharing(event) {
|
||||
}
|
||||
}
|
||||
|
||||
function onContactFoldersMenuPrepareVisibility() {
|
||||
var folders = $("contactFolders");
|
||||
var selected = folders.getSelectedNodes();
|
||||
|
||||
if (selected.length > 0) {
|
||||
var folderOwner = selected[0].getAttribute("owner");
|
||||
var sharingOption = $(this).down("ul").childElements().last();
|
||||
// Disable the "Sharing" option when address book is not owned by user
|
||||
if (folderOwner == UserLogin || IsSuperUser)
|
||||
sharingOption.removeClassName("disabled");
|
||||
else
|
||||
sharingOption.addClassName("disabled");
|
||||
}
|
||||
}
|
||||
|
||||
function getMenus() {
|
||||
var menus = {};
|
||||
menus["contactFoldersMenu"] = new Array(onMenuModify, "-", null,
|
||||
@@ -732,7 +750,11 @@ function getMenus() {
|
||||
onMenuWriteToContact, null, "-",
|
||||
onMenuDeleteContact);
|
||||
menus["searchMenu"] = new Array(setSearchCriteria);
|
||||
|
||||
|
||||
var contactFoldersMenu = $("contactFoldersMenu");
|
||||
if (contactFoldersMenu)
|
||||
contactFoldersMenu.prepareVisibility = onContactFoldersMenuPrepareVisibility;
|
||||
|
||||
return menus;
|
||||
}
|
||||
|
||||
|
||||
@@ -1371,7 +1371,7 @@ function onCalendarsMenuPrepareVisibility() {
|
||||
var folderOwner = selected[0].getAttribute("owner");
|
||||
var sharingOption = $(this).down("ul").childElements().last();
|
||||
// Disable the "Sharing" option when calendar is not owned by user
|
||||
if (folderOwner == UserLogin)
|
||||
if (folderOwner == UserLogin || IsSuperUser)
|
||||
sharingOption.removeClassName("disabled");
|
||||
else
|
||||
sharingOption.addClassName("disabled");
|
||||
|
||||
Reference in New Issue
Block a user