Monotone-Parent: efb32ee0b07634ff28f86f07c618160d8d121225

Monotone-Revision: 9e683df87b2b67f61552768bc12e69f0d289640e

Monotone-Author: flachapelle@inverse.ca
Monotone-Date: 2007-11-19T22:19:17
Monotone-Branch: ca.inverse.sogo
maint-2.0.2
Francis Lachapelle 2007-11-19 22:19:17 +00:00
parent ddd0b2f653
commit ad10b8ee49
6 changed files with 36 additions and 7 deletions

View File

@ -56,7 +56,7 @@
pageName = "UIxUserRightsEditor";
};
saveUserRights = {
protectedBy = "ReadAcls";
protectedBy = "SaveAcls";
pageName = "UIxUserRightsEditor";
actionName = "saveUserRights";
};

View File

@ -24,7 +24,7 @@
"Access Contents Information" = ( "Owner", "ObjectReader" );
"Add Documents, Images, and Files" = ( "Owner", "ObjectCreator" );
"Add Folders" = ( "Owner", "FolderCreator" );
"ReadAcls" = ( "Owner", "AuthorizedSubscriber" );
"ReadAcls" = ( "Owner" );
"SaveAcls" = ( "Owner" );
"Delete Objects" = ( "Owner", "ObjectEraser" );
};

View File

@ -137,6 +137,9 @@ Element.addMethods({
if (leftDiff < 0)
menuLeft -= popup.offsetWidth;
if (popup.prepareVisibility)
popup.prepareVisibility();
popup.setStyle( { top: menuTop + "px",
left: menuLeft + "px",
visibility: "visible" } );

View File

@ -1363,6 +1363,21 @@ function browseURL(anchor, event) {
return false;
}
function onCalendarsMenuPrepareVisibility() {
var folders = $("calendarList");
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 calendar is not owned by user
if (folderOwner == UserLogin)
sharingOption.removeClassName("disabled");
else
sharingOption.addClassName("disabled");
}
}
function getMenus() {
var menus = {};
@ -1388,13 +1403,20 @@ function getMenus() {
null, "-", onMenuSharing);
menus["searchMenu"] = new Array(setSearchCriteria);
var calendarsMenu = $("calendarsMenu");
if (calendarsMenu)
calendarsMenu.prepareVisibility = onCalendarsMenuPrepareVisibility;
return menus;
}
function onMenuSharing(event) {
if ($(this).hasClassName("disabled"))
return;
var folders = $("calendarList");
var selected = folders.getSelectedNodes()[0];
/* FIXME: activation of the context menu should preferable select the entry
/* FIXME: activation of the context menu should preferably select the entry
above which the event has occured */
if (selected) {
var folderID = selected.getAttribute("id");

View File

@ -2,6 +2,8 @@
var contactSelectorAction = 'acls-contacts';
var defaultUserID = '';
var userRightsHeight;
var userRightsWidth;
function addUser(userName, userID) {
if (!$(userID)) {
@ -20,6 +22,7 @@ function addUserCallback(http) {
function setEventsOnUserNode(node) {
Event.observe(node, "mousedown", listRowMouseDownHandler);
Event.observe(node, "selectstart", listRowMouseDownHandler);
Event.observe(node, "dblclick", onOpenUserRights);
Event.observe(node, "click", onRowClick);
}
@ -97,8 +100,8 @@ function openRightsForUserID(userID) {
elements[elements.length-1] = "userRights?uid=" + userID;
window.open(elements.join("/"), "",
"width=" + this.userRightsWidth
+ ",height=" + this.userRightsHeight
"width=" + userRightsWidth
+ ",height=" + userRightsHeight
+ ",resizable=0,scrollbars=0,toolbar=0,"
+ "location=0,directories=0,status=0,menubar=0,copyhistory=0");
}
@ -138,8 +141,8 @@ function onAclLoadHandler() {
Event.observe(buttons[1], "click", onUserRemove);
}
this.userRightsHeight = window.opener.getUsersRightsWindowHeight();
this.userRightsWidth = window.opener.getUsersRightsWindowWidth();
userRightsHeight = window.opener.getUsersRightsWindowHeight();
userRightsWidth = window.opener.getUsersRightsWindowWidth();
}
FastInit.addOnLoad(onAclLoadHandler);

View File

@ -571,6 +571,7 @@ function popupMenu(event, menuId, target) {
if (popup.prepareVisibility)
popup.prepareVisibility();
popup.setStyle({ top: menuTop + "px",
left: menuLeft + "px",
visibility: "visible" });