merge of '61b0fdce16f6c0727e58cc97232171b41008ed41'

and 'bb276eea8dc76b5c71f49df1d23424ab19015233'

Monotone-Parent: 61b0fdce16f6c0727e58cc97232171b41008ed41
Monotone-Parent: bb276eea8dc76b5c71f49df1d23424ab19015233
Monotone-Revision: f70b5b1e5f982c1feda21a5227e3bc26f8dc7f66

Monotone-Author: wsourdeau@inverse.ca
Monotone-Date: 2012-01-04T15:27:58
Monotone-Branch: ca.inverse.sogo
This commit is contained in:
Wolfgang Sourdeau committed 2012-01-04 15:27:58 +00:00
commit bedee82eaf
22 files changed
+891 -115

No files matched your search

+30 -7
View File
@@ -52,8 +52,16 @@
#import "UIxContactFoldersView.h"
Class SOGoContactSourceFolderK, SOGoGCSFolderK;
@implementation UIxContactFoldersView
+ (void) initialize
{
SOGoContactSourceFolderK = [SOGoContactSourceFolder class];
SOGoGCSFolderK = [SOGoGCSFolder class];
}
- (id) init
{
if ((self = [super init]))
@@ -110,11 +118,13 @@
folders = [self clientObject];
folder = [folders lookupPersonalFolder: @"personal" ignoringRights: YES];
contactInfos = [folder lookupContactsWithFilter: nil
onCriteria: nil
sortBy: @"c_cn"
ordering: NSOrderedAscending];
if (folder && [folder conformsToProtocol: @protocol (SOGoContactFolder)])
contactInfos = [folder lookupContactsWithFilter: nil
onCriteria: nil
sortBy: @"c_cn"
ordering: NSOrderedAscending];
else
contactInfos = nil;
return contactInfos;
}
@@ -183,7 +193,7 @@
{
folder = [folders objectAtIndex: i];
/* We first search in LDAP folders (in case of duplicated entries in GCS folders) */
if ([folder isKindOfClass: [SOGoContactSourceFolder class]])
if ([folder isKindOfClass: SOGoContactSourceFolderK])
[sortedFolders insertObject: folder atIndex: 0];
else
[sortedFolders addObject: folder];
@@ -287,10 +297,23 @@
- (NSString *) currentContactFolderClass
{
return ([currentFolder isKindOfClass: [SOGoContactSourceFolder class]]
return (([currentFolder isKindOfClass: SOGoContactSourceFolderK]
&& ![currentFolder isPersonalSource])
? @"remote" : @"local");
}
- (NSString *) currentContactFolderAclEditing
{
return ([currentFolder isKindOfClass: SOGoGCSFolderK]
? @"available": @"unavailable");
}
- (NSString *) currentContactFolderListEditing
{
return ([currentFolder isKindOfClass: SOGoGCSFolderK]
? @"available": @"unavailable");
}
- (NSString *) verticalDragHandleStyle
{
NSString *vertical;
+5
View File
@@ -139,6 +139,11 @@
pageName = "UIxContactEditor";
actionName = "new";
};
renameFolder = {
protectedBy = "Change Permissions";
actionClass = "UIxFolderActions";
actionName = "renameFolder";
};
mailer-contacts = {
protectedBy = "<public>";
pageName = "UIxContactFoldersView";
@@ -121,6 +121,8 @@
><li var:id="currentContactFolderId"
var:owner="currentContactFolderOwner"
var:class="currentContactFolderClass"
var:acl-editing="currentContactFolderAclEditing"
var:list-editing="currentContactFolderListEditing"
><var:string value="currentContactFolderName"/></li
></var:foreach
>
+39 -23
View File
@@ -258,17 +258,6 @@ function onContactContextMenuHide(event) {
this.stopObserving("contextmenu:hide", onContactContextMenuHide);
}
function onFolderMenuHide(event) {
var topNode = $('d');
if (topNode.menuSelectedEntry) {
topNode.menuSelectedEntry.deselect();
topNode.menuSelectedEntry = null;
}
if (topNode.selectedEntry)
topNode.selectedEntry.selectElement();
}
function _onContactMenuAction(folderItem, action, refresh) {
var selectedFolders = $("contactFolders").getSelectedNodes();
var folderId = $(folderItem).readAttribute("folderId");
@@ -308,8 +297,9 @@ function onContactMenuMove(event) {
function onMenuExportContact (event) {
var selectedFolders = $("contactFolders").getSelectedNodes();
var selectedFolderId = $(selectedFolders[0]).readAttribute("id");
if (selectedFolderId != "/shared") {
var canExport = (selectedFolders[0].getAttribute("owner") != "nobody");
if (canExport) {
var selectedFolderId = $(selectedFolders[0]).readAttribute("id");
var contactIds = $(document.menuTarget).collect(function(row) {
return row.getAttribute("id");
});
@@ -599,10 +589,11 @@ function newContact(sender) {
function newList(sender) {
var li = $(Contact.currentAddressBook);
if (li.hasClassName("remote"))
showAlertDialog(_("You cannot create a list in a shared address book."));
else
var listEditing = li.getAttribute("list-editing");
if (listEditing && listEditing == "available")
openContactWindow(URLForFolderID(Contact.currentAddressBook) + "/newlist");
else
showAlertDialog(_("You cannot create a list in a shared address book."));
return false;
}
@@ -1069,15 +1060,15 @@ function onMenuSharing(event) {
var folders = $("contactFolders");
var selected = folders.getSelectedNodes()[0];
var owner = selected.getAttribute("owner");
if (owner == "nobody")
showAlertDialog(_("The user rights cannot be edited for this object!"));
else {
var aclEditing = selected.getAttribute("acl-editing");
if (aclEditing && aclEditing == "available") {
var title = this.innerHTML;
var url = URLForFolderID(selected.getAttribute("id"));
openAclWindow(url + "/acls", title);
}
else
showAlertDialog(_("The user rights cannot be edited for this object!"));
}
function onAddressBooksMenuPrepareVisibility() {
@@ -1090,30 +1081,55 @@ function onAddressBooksMenuPrepareVisibility() {
var menu = $("contactFoldersMenu").down("ul");;
var listElements = menu.childNodesWithTag("li");
var modifyOption = listElements[0];
var newListOption = listElements[3];
var removeOption = listElements[5];
var exportOption = listElements[7];
var importOption = listElements[8];
var sharingOption = listElements[listElements.length - 1];
// Disable the "Sharing" and "Modify" options when address book
// is not owned by user
if (folderOwner == UserLogin || IsSuperUser) {
modifyOption.removeClassName("disabled"); // WARNING: will fail for super users anyway
sharingOption.removeClassName("disabled");
modifyOption.removeClassName("disabled"); // WARNING: will fail
// for super users
// anyway
var aclEditing = selected[0].getAttribute("acl-editing");
if (aclEditing && aclEditing == "available") {
sharingOption.removeClassName("disabled");
}
else {
sharingOption.addClassName("disabled");
}
}
else {
modifyOption.addClassName("disabled");
sharingOption.addClassName("disabled");
}
var listEditing = selected[0].getAttribute("list-editing");
if (listEditing && listEditing == "available") {
newListOption.removeClassName("disabled");
}
else {
newListOption.addClassName("disabled");
}
/* Disable the "remove" and "export ab" options when address book is
public */
if (folderOwner == "nobody") {
exportOption.addClassName("disabled");
importOption.addClassName("disabled");
removeOption.addClassName("disabled");
}
else {
exportOption.removeClassName("disabled");
removeOption.removeClassName("disabled");
importOption.removeClassName("disabled");
if (selected[0].getAttribute("id") == "/personal") {
removeOption.addClassName("disabled");
}
else {
removeOption.removeClassName("disabled");
}
}
return true;