mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-10-11 23:07:12 +00:00
merge of '32ac613ce54828e76c41d1e1457a982917bf0b8e'
and 'bee60405e7b87d3e239c75247535e09b1a7e0943' Monotone-Parent: 32ac613ce54828e76c41d1e1457a982917bf0b8e Monotone-Parent: bee60405e7b87d3e239c75247535e09b1a7e0943 Monotone-Revision: 49f34fbd1c71d08a025aff7ebece50001773fa8e Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2007-05-25T15:46:07 Monotone-Branch: ca.inverse.sogo
This commit is contained in:
commit
516cb950f1
54 files changed
+1375
-725
No files matched your search
@@ -29,10 +29,11 @@
|
||||
{
|
||||
BOOL prepared;
|
||||
BOOL publishInFreeBusy;
|
||||
NSArray *acls;
|
||||
NSArray *aclUsers;
|
||||
NSArray *savedUIDs;
|
||||
NSMutableArray *users;
|
||||
NSString *currentUser;
|
||||
NSString *defaultUserID;
|
||||
}
|
||||
|
||||
- (NSArray *) aclsForObject;
|
||||
|
||||
+20
-15
@@ -29,6 +29,7 @@
|
||||
#import <SoObjects/SOGo/LDAPUserManager.h>
|
||||
#import <SoObjects/SOGo/SOGoContentObject.h>
|
||||
#import <SoObjects/SOGo/SOGoPermissions.h>
|
||||
#import <SoObjects/SOGo/NSArray+Utilities.h>
|
||||
|
||||
#import "UIxAclEditor.h"
|
||||
|
||||
@@ -38,11 +39,12 @@
|
||||
{
|
||||
if ((self = [super init]))
|
||||
{
|
||||
acls = nil;
|
||||
aclUsers = nil;
|
||||
prepared = NO;
|
||||
publishInFreeBusy = NO;
|
||||
users = [NSMutableArray new];
|
||||
currentUser = nil;
|
||||
defaultUserID = nil;
|
||||
savedUIDs = nil;
|
||||
}
|
||||
|
||||
@@ -54,15 +56,16 @@
|
||||
[savedUIDs release];
|
||||
[users release];
|
||||
[currentUser release];
|
||||
[defaultUserID release];
|
||||
[super dealloc];
|
||||
}
|
||||
|
||||
- (NSArray *) aclsForObject
|
||||
{
|
||||
if (!acls)
|
||||
acls = [[self clientObject] acls];
|
||||
if (!aclUsers)
|
||||
aclUsers = [[self clientObject] aclUsers];
|
||||
|
||||
return acls;
|
||||
return aclUsers;
|
||||
}
|
||||
|
||||
- (NSString *) _displayNameForUID: (NSString *) uid
|
||||
@@ -86,30 +89,32 @@
|
||||
|
||||
- (NSString *) defaultUserID
|
||||
{
|
||||
return SOGoDefaultUserID;
|
||||
if (!defaultUserID)
|
||||
ASSIGN (defaultUserID, [[self clientObject] defaultUserID]);
|
||||
|
||||
return defaultUserID;
|
||||
}
|
||||
|
||||
- (void) _prepareUsers
|
||||
{
|
||||
NSEnumerator *aclsEnum;
|
||||
NSDictionary *currentAcl;
|
||||
NSString *currentUID, *ownerLogin;
|
||||
|
||||
ownerLogin = [[self clientObject] ownerInContext: context];
|
||||
if (!defaultUserID)
|
||||
ASSIGN (defaultUserID, [[self clientObject] defaultUserID]);
|
||||
|
||||
aclsEnum = [[self aclsForObject] objectEnumerator];
|
||||
currentAcl = [aclsEnum nextObject];
|
||||
while (currentAcl)
|
||||
currentUID = [aclsEnum nextObject];
|
||||
while (currentUID)
|
||||
{
|
||||
currentUID = [currentAcl objectForKey: @"c_uid"];
|
||||
if (!([currentUID isEqualToString: ownerLogin]
|
||||
|| [currentUID isEqualToString: SOGoDefaultUserID]
|
||||
|| [users containsObject: currentUID]))
|
||||
[users addObject: currentUID];
|
||||
currentAcl = [aclsEnum nextObject];
|
||||
|
||||
prepared = YES;
|
||||
|| [currentUID isEqualToString: defaultUserID]))
|
||||
[users addObjectUniquely: currentUID];
|
||||
currentUID = [aclsEnum nextObject];
|
||||
}
|
||||
|
||||
prepared = YES;
|
||||
}
|
||||
|
||||
- (NSArray *) usersForObject
|
||||
|
||||
@@ -34,6 +34,7 @@
|
||||
{
|
||||
NSMutableArray *userRights;
|
||||
NSString *uid;
|
||||
NSString *defaultUserID;
|
||||
}
|
||||
|
||||
- (NSString *) userDisplayName;
|
||||
|
||||
@@ -25,6 +25,7 @@
|
||||
#import <NGObjWeb/WORequest.h>
|
||||
#import <SoObjects/SOGo/LDAPUserManager.h>
|
||||
#import <SoObjects/SOGo/SOGoPermissions.h>
|
||||
#import <SoObjects/SOGo/SOGoObject.h>
|
||||
|
||||
#import "UIxUserRightsEditor.h"
|
||||
|
||||
@@ -36,6 +37,7 @@
|
||||
{
|
||||
uid = nil;
|
||||
userRights = [NSMutableArray new];
|
||||
defaultUserID = nil;
|
||||
}
|
||||
|
||||
return self;
|
||||
@@ -45,6 +47,7 @@
|
||||
{
|
||||
[uid release];
|
||||
[userRights release];
|
||||
[defaultUserID release];
|
||||
[super dealloc];
|
||||
}
|
||||
|
||||
@@ -55,7 +58,10 @@
|
||||
|
||||
- (BOOL) userIsDefaultUser
|
||||
{
|
||||
return [uid isEqualToString: SOGoDefaultUserID];
|
||||
if (!defaultUserID)
|
||||
ASSIGN (defaultUserID, [[self clientObject] defaultUserID]);
|
||||
|
||||
return [uid isEqualToString: defaultUserID];
|
||||
}
|
||||
|
||||
- (NSString *) userDisplayName
|
||||
@@ -75,24 +81,22 @@
|
||||
NSString *newUID;
|
||||
LDAPUserManager *um;
|
||||
SOGoObject *clientObject;
|
||||
unsigned int count;
|
||||
|
||||
response = NO;
|
||||
|
||||
newUID = [[context request] formValueForKey: @"uid"];
|
||||
if ([newUID length] > 0)
|
||||
{
|
||||
if (!defaultUserID)
|
||||
ASSIGN (defaultUserID, [[self clientObject] defaultUserID]);
|
||||
|
||||
um = [LDAPUserManager sharedUserManager];
|
||||
if ([newUID isEqualToString: SOGoDefaultUserID]
|
||||
if ([newUID isEqualToString: defaultUserID]
|
||||
|| [[um getEmailForUID: newUID] length] > 0)
|
||||
{
|
||||
ASSIGN (uid, newUID);
|
||||
clientObject = [self clientObject];
|
||||
[userRights addObjectsFromArray: [clientObject aclsForUser: uid]];
|
||||
count = [userRights count];
|
||||
if (!count || (count == 1 && [[userRights objectAtIndex: 0]
|
||||
isEqualToString: SOGoRole_None]))
|
||||
[userRights setArray: [clientObject defaultAclRoles]];
|
||||
|
||||
response = YES;
|
||||
}
|
||||
|
||||
@@ -43,7 +43,7 @@
|
||||
"New Card" = "New Card";
|
||||
"New List" = "New List";
|
||||
"Modify" = "Modify";
|
||||
"Access Rights..." = "Access Rights...";
|
||||
"Sharing..." = "Sharing...";
|
||||
"Write" = "Write";
|
||||
"Delete" = "Delete";
|
||||
"Instant Message" = "Instant Message";
|
||||
|
||||
@@ -50,7 +50,7 @@
|
||||
"New Card" = "Nouvelle fiche";
|
||||
"New List" = "Nouvelle liste";
|
||||
"Modify" = "Modifier";
|
||||
"Access Rights..." = "Partage...";
|
||||
"Sharing..." = "Partage...";
|
||||
"Write" = "Écrire";
|
||||
"Delete" = "Effacer";
|
||||
"Instant Message" = "Message instantané";
|
||||
|
||||
@@ -39,9 +39,7 @@
|
||||
- (NSString *) flatContentAsString
|
||||
{
|
||||
NSMutableString *content;
|
||||
NSString *superContent, *urlText, *newUrlText;
|
||||
NSRange httpRange, rest, currentURL;
|
||||
unsigned int length;
|
||||
NSString *superContent;
|
||||
|
||||
content = [NSMutableString string];
|
||||
superContent = [[super flatContentAsString] stringByEscapingHTMLString];
|
||||
|
||||
@@ -35,6 +35,24 @@
|
||||
"Account: " = "Account: ";
|
||||
"Shared Account: " = "Shared Account: ";
|
||||
|
||||
/* acls */
|
||||
"Default Roles" = "Default Roles";
|
||||
|
||||
"List and see this folder" = "List and see this folder";
|
||||
"Read mails from this folder" = "Read mails from this folder";
|
||||
"Mark mails read and unread" = "Mark mails read and unread";
|
||||
"Modify the flags of the mails in this folder" = "Modify the flags of the mails in this folder";
|
||||
"Insert, copy and move mails into this folder" = "Insert, copy and move mails into this folder";
|
||||
"Post mails" = "Post mails";
|
||||
"Add subfolders to this folder" = "Add subfolders to this folder";
|
||||
"Remove this folder" = "Remove this folder";
|
||||
"Erase mails from this folder" = "Erase mails from this folder";
|
||||
"Expunge this folder" = "Expunge this folder";
|
||||
"Modify the acl of this folder" = "Modify the acl of this folder";
|
||||
|
||||
"Update" = "Update";
|
||||
"Cancel" = "Cancel";
|
||||
|
||||
/* Mail edition */
|
||||
|
||||
"From" = "From";
|
||||
|
||||
@@ -34,6 +34,24 @@
|
||||
"Account: " = "Compte : ";
|
||||
"Shared Account: " = "Compte Partagé ";
|
||||
|
||||
/* acls */
|
||||
"Default Roles" = "Rôles par défaut";
|
||||
|
||||
"List and see this folder" = "Lister et voir ce dossier";
|
||||
"Read mails from this folder" = "Lire les messages de ce dossier";
|
||||
"Mark mails read and unread" = "Marquer les messages comme lus ou non-lus";
|
||||
"Modify the flags of the mails in this folder" = "Modifier les indicateurs sur les messages";
|
||||
"Insert, copy and move mails into this folder" = "Insérer, copier et déplacer des messages dans ce dossier";
|
||||
"Post mails" = "Poster des messages";
|
||||
"Add subfolders to this folder" = "Ajouter des sous-dossiers à ce dossier";
|
||||
"Remove this folder" = "Effacer ce dossier";
|
||||
"Erase mails from this folder" = "Effacer des messages de ce dossier";
|
||||
"Expunge this folder" = "Compacter ce dossier";
|
||||
"Modify the acl of this folder" = "Administrer les droits sur ce dossier";
|
||||
|
||||
"Update" = "Mettre à jour";
|
||||
"Cancel" = "Annuler";
|
||||
|
||||
/* Mail edition */
|
||||
|
||||
"From" = "De";
|
||||
@@ -106,7 +124,7 @@
|
||||
"New Folder..." = "Nouveau dossier...";
|
||||
"Compact This Folder" = "Compacter ce dossier";
|
||||
"Search Messages..." = "Rechercher dans les messages...";
|
||||
"Properties..." = "Propriétés";
|
||||
"Sharing..." = "Partage...";
|
||||
"New Subfolder..." = "Nouveau sous-dossier...";
|
||||
"Rename Folder..." = "Renommer le dossier...";
|
||||
"Delete Folder" = "Supprimer le dossier...";
|
||||
|
||||
@@ -21,7 +21,6 @@ MailerUI_OBJC_FILES += \
|
||||
UIxMailTreeBlock.m \
|
||||
UIxMailTreeBlockJS.m \
|
||||
UIxMailFolderMenu.m \
|
||||
UIxMailSplashView.m \
|
||||
\
|
||||
UIxMailListView.m \
|
||||
UIxMailView.m \
|
||||
@@ -39,7 +38,7 @@ MailerUI_OBJC_FILES += \
|
||||
\
|
||||
UIxFilterList.m \
|
||||
\
|
||||
UIxMailFolderACLEditor.m
|
||||
UIxMailUserRightsEditor.m
|
||||
# UIxSieveEditor.m
|
||||
|
||||
MailerUI_RESOURCE_FILES += \
|
||||
|
||||
@@ -18,7 +18,6 @@
|
||||
Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
|
||||
02111-1307, USA.
|
||||
*/
|
||||
// $Id: MailerUIProduct.m 603 2005-02-22 23:12:45Z helge $
|
||||
|
||||
#import <Foundation/NSObject.h>
|
||||
|
||||
@@ -28,7 +27,5 @@
|
||||
|
||||
@end
|
||||
|
||||
#include "common.h"
|
||||
|
||||
@implementation MailerUIProduct
|
||||
@end /* MailerUIProduct */
|
||||
@@ -1,42 +0,0 @@
|
||||
/*
|
||||
Copyright (C) 2005 SKYRIX Software AG
|
||||
|
||||
This file is part of OpenGroupware.org.
|
||||
|
||||
OGo is free software; you can redistribute it and/or modify it under
|
||||
the terms of the GNU Lesser General Public License as published by the
|
||||
Free Software Foundation; either version 2, or (at your option) any
|
||||
later version.
|
||||
|
||||
OGo is distributed in the hope that it will be useful, but WITHOUT ANY
|
||||
WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
|
||||
License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with OGo; see the file COPYING. If not, write to the
|
||||
Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
|
||||
02111-1307, USA.
|
||||
*/
|
||||
|
||||
#include <SOGoUI/UIxComponent.h>
|
||||
|
||||
// TODO: implement
|
||||
|
||||
/*
|
||||
UIxMailFolderACLEditor
|
||||
|
||||
A component to edit IMAP4 ACLs on folders. It works on SOGoMailFolder
|
||||
objects.
|
||||
*/
|
||||
|
||||
@interface UIxMailFolderACLEditor : UIxComponent
|
||||
{
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
#include "common.h"
|
||||
|
||||
@implementation UIxMailFolderACLEditor
|
||||
@end /* UIxMailFolderACLEditor */
|
||||
@@ -1,29 +0,0 @@
|
||||
/* UIxMailSplashView - this file is part of SOGo
|
||||
*
|
||||
* Copyright (C) 2006 Inverse groupe conseil
|
||||
*
|
||||
* Author: Wolfgang Sourdeau <wsourdeau@inverse.ca>
|
||||
*
|
||||
* This file is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2, or (at your option)
|
||||
* any later version.
|
||||
*
|
||||
* This file is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; see the file COPYING. If not, write to
|
||||
* the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
* Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#import <SOGoUI/UIxComponent.h>
|
||||
|
||||
@interface UIxMailSplashView : UIxComponent
|
||||
@end
|
||||
|
||||
@implementation UIxMailSplashView
|
||||
@end /* UIxMailSplashView */
|
||||
@@ -0,0 +1,58 @@
|
||||
/* UIxMailUserRightsEditor.h - this file is part of SOGo
|
||||
*
|
||||
* Copyright (C) 2007 Inverse groupe conseil
|
||||
*
|
||||
* Author: Wolfgang Sourdeau <wsourdeau@inverse.ca>
|
||||
*
|
||||
* This file is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2, or (at your option)
|
||||
* any later version.
|
||||
*
|
||||
* This file is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; see the file COPYING. If not, write to
|
||||
* the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
* Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#ifndef UIXMAILUSERRIGHTSEDITOR_H
|
||||
#define UIXMAILUSERRIGHTSEDITOR_H
|
||||
|
||||
#import <UI/Common/UIxUserRightsEditor.h>
|
||||
|
||||
@interface UIxMailUserRightsEditor : UIxUserRightsEditor
|
||||
|
||||
- (void) setUserCanReadMails: (BOOL) userCanReadMails;
|
||||
- (BOOL) userCanReadMails;
|
||||
|
||||
- (void) setUserCanWriteMails: (BOOL) userCanWriteMails;
|
||||
- (BOOL) userCanWriteMails;
|
||||
|
||||
- (void) setUserCanInsertMails: (BOOL) userCanInsertMails;
|
||||
- (BOOL) userCanInsertMails;
|
||||
|
||||
- (void) setUserCanMarkMailsRead: (BOOL) userCanMarkMailsRead;
|
||||
- (BOOL) userCanMarkMailsRead;
|
||||
|
||||
- (void) setUserCanEraseMails: (BOOL) userCanEraseMails;
|
||||
- (BOOL) userCanEraseMails;
|
||||
|
||||
- (void) setUserCanCreateSubfolders: (BOOL) userCanCreateSubfolders;
|
||||
- (BOOL) userCanCreateSubfolders;
|
||||
|
||||
- (void) setUserCanPostMails: (BOOL) userCanPostMails;
|
||||
- (BOOL) userCanPostMails;
|
||||
|
||||
- (void) setUserIsAdministrator: (BOOL) userIsAdministrator;
|
||||
- (BOOL) userIsAdministrator;
|
||||
|
||||
- (void) updateRights;
|
||||
|
||||
@end
|
||||
|
||||
#endif /* UIXMAILUSERRIGHTSEDITOR_H */
|
||||
@@ -0,0 +1,238 @@
|
||||
/* UIxMailUserRightsEditor.m - this file is part of SOGo
|
||||
*
|
||||
* Copyright (C) 2007 Inverse groupe conseil
|
||||
*
|
||||
* Author: Wolfgang Sourdeau <wsourdeau@inverse.ca>
|
||||
*
|
||||
* This file is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2, or (at your option)
|
||||
* any later version.
|
||||
*
|
||||
* This file is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; see the file COPYING. If not, write to
|
||||
* the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
* Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#import <Foundation/NSArray.h>
|
||||
#import <Foundation/NSEnumerator.h>
|
||||
#import <NGObjWeb/WORequest.h>
|
||||
#import <SoObjects/SOGo/SOGoPermissions.h>
|
||||
|
||||
#import "UIxMailUserRightsEditor.h"
|
||||
|
||||
@implementation UIxMailUserRightsEditor
|
||||
|
||||
- (void) setUserCanSeeFolder: (BOOL) userCanSeeFolder
|
||||
{
|
||||
if (userCanSeeFolder)
|
||||
[self appendRight: SOGoRole_ObjectViewer];
|
||||
else
|
||||
[self removeRight: SOGoRole_ObjectViewer];
|
||||
}
|
||||
|
||||
- (BOOL) userCanSeeFolder
|
||||
{
|
||||
return [userRights containsObject: SOGoRole_ObjectViewer];
|
||||
}
|
||||
|
||||
- (void) setUserCanReadMails: (BOOL) userCanReadMails
|
||||
{
|
||||
if (userCanReadMails)
|
||||
[self appendRight: SOGoRole_ObjectReader];
|
||||
else
|
||||
[self removeRight: SOGoRole_ObjectReader];
|
||||
}
|
||||
|
||||
- (BOOL) userCanReadMails
|
||||
{
|
||||
return [userRights containsObject: SOGoRole_ObjectReader];
|
||||
}
|
||||
|
||||
- (void) setUserCanMarkMailsRead: (BOOL) userCanMarkMailsRead
|
||||
{
|
||||
if (userCanMarkMailsRead)
|
||||
[self appendRight: SOGoMailRole_SeenKeeper];
|
||||
else
|
||||
[self removeRight: SOGoMailRole_SeenKeeper];
|
||||
}
|
||||
|
||||
- (BOOL) userCanMarkMailsRead
|
||||
{
|
||||
return [userRights containsObject: SOGoMailRole_SeenKeeper];
|
||||
}
|
||||
|
||||
- (void) setUserCanWriteMails: (BOOL) userCanWriteMails
|
||||
{
|
||||
if (userCanWriteMails)
|
||||
[self appendRight: SOGoMailRole_Writer];
|
||||
else
|
||||
[self removeRight: SOGoMailRole_Writer];
|
||||
}
|
||||
|
||||
- (BOOL) userCanWriteMails
|
||||
{
|
||||
return [userRights containsObject: SOGoMailRole_Writer];
|
||||
}
|
||||
|
||||
- (void) setUserCanInsertMails: (BOOL) userCanInsertMails
|
||||
{
|
||||
if (userCanInsertMails)
|
||||
[self appendRight: SOGoRole_ObjectCreator];
|
||||
else
|
||||
[self removeRight: SOGoRole_ObjectCreator];
|
||||
}
|
||||
|
||||
- (BOOL) userCanInsertMails
|
||||
{
|
||||
return [userRights containsObject: SOGoRole_ObjectCreator];
|
||||
}
|
||||
|
||||
- (void) setUserCanPostMails: (BOOL) userCanPostMails
|
||||
{
|
||||
if (userCanPostMails)
|
||||
[self appendRight: SOGoMailRole_Poster];
|
||||
else
|
||||
[self removeRight: SOGoMailRole_Poster];
|
||||
}
|
||||
|
||||
- (BOOL) userCanPostMails
|
||||
{
|
||||
return [userRights containsObject: SOGoMailRole_Poster];
|
||||
}
|
||||
|
||||
- (void) setUserCanCreateSubfolders: (BOOL) userCanCreateSubfolders
|
||||
{
|
||||
if (userCanCreateSubfolders)
|
||||
[self appendRight: SOGoRole_FolderCreator];
|
||||
else
|
||||
[self removeRight: SOGoRole_FolderCreator];
|
||||
}
|
||||
|
||||
- (BOOL) userCanCreateSubfolders
|
||||
{
|
||||
return [userRights containsObject: SOGoRole_FolderCreator];
|
||||
}
|
||||
|
||||
- (void) setUserCanRemoveFolder: (BOOL) userCanRemoveFolder
|
||||
{
|
||||
if (userCanRemoveFolder)
|
||||
[self appendRight: SOGoRole_ObjectEraser];
|
||||
else
|
||||
[self removeRight: SOGoRole_ObjectEraser];
|
||||
}
|
||||
|
||||
- (BOOL) userCanRemoveFolder
|
||||
{
|
||||
return [userRights containsObject: SOGoRole_ObjectEraser];
|
||||
}
|
||||
|
||||
- (void) setUserCanEraseMails: (BOOL) userCanEraseMails
|
||||
{
|
||||
if (userCanEraseMails)
|
||||
[self appendRight: SOGoMailRole_MessageEraser];
|
||||
else
|
||||
[self removeRight: SOGoMailRole_MessageEraser];
|
||||
}
|
||||
|
||||
- (BOOL) userCanEraseMails
|
||||
{
|
||||
return [userRights containsObject: SOGoMailRole_MessageEraser];
|
||||
}
|
||||
|
||||
- (void) setUserCanExpungeFolder: (BOOL) userCanExpungeFolder
|
||||
{
|
||||
if (userCanExpungeFolder)
|
||||
[self appendRight: SOGoMailRole_Expunger];
|
||||
else
|
||||
[self removeRight: SOGoMailRole_Expunger];
|
||||
}
|
||||
|
||||
- (BOOL) userCanExpungeFolder
|
||||
{
|
||||
return [userRights containsObject: SOGoMailRole_Expunger];
|
||||
}
|
||||
|
||||
- (void) setUserIsAdministrator: (BOOL) userIsAdministrator
|
||||
{
|
||||
if (userIsAdministrator)
|
||||
[self appendRight: SOGoMailRole_Administrator];
|
||||
else
|
||||
[self removeRight: SOGoMailRole_Administrator];
|
||||
}
|
||||
|
||||
- (BOOL) userIsAdministrator
|
||||
{
|
||||
return [userRights containsObject: SOGoMailRole_Administrator];
|
||||
}
|
||||
|
||||
- (void) updateRights
|
||||
{
|
||||
WORequest *request;
|
||||
|
||||
request = [context request];
|
||||
|
||||
if ([[request formValueForKey: SOGoRole_ObjectViewer] length] > 0)
|
||||
[self appendRight: SOGoRole_ObjectViewer];
|
||||
else
|
||||
[self removeRight: SOGoRole_ObjectViewer];
|
||||
|
||||
if ([[request formValueForKey: SOGoRole_ObjectReader] length] > 0)
|
||||
[self appendRight: SOGoRole_ObjectReader];
|
||||
else
|
||||
[self removeRight: SOGoRole_ObjectReader];
|
||||
|
||||
if ([[request formValueForKey: SOGoMailRole_SeenKeeper] length] > 0)
|
||||
[self appendRight: SOGoMailRole_SeenKeeper];
|
||||
else
|
||||
[self removeRight: SOGoMailRole_SeenKeeper];
|
||||
|
||||
if ([[request formValueForKey: SOGoMailRole_Writer] length] > 0)
|
||||
[self appendRight: SOGoMailRole_Writer];
|
||||
else
|
||||
[self removeRight: SOGoMailRole_Writer];
|
||||
|
||||
if ([[request formValueForKey: SOGoRole_ObjectCreator] length] > 0)
|
||||
[self appendRight: SOGoRole_ObjectCreator];
|
||||
else
|
||||
[self removeRight: SOGoRole_ObjectCreator];
|
||||
|
||||
if ([[request formValueForKey: SOGoMailRole_Poster] length] > 0)
|
||||
[self appendRight: SOGoMailRole_Poster];
|
||||
else
|
||||
[self removeRight: SOGoMailRole_Poster];
|
||||
|
||||
if ([[request formValueForKey: SOGoRole_FolderCreator] length] > 0)
|
||||
[self appendRight: SOGoRole_FolderCreator];
|
||||
else
|
||||
[self removeRight: SOGoRole_FolderCreator];
|
||||
|
||||
if ([[request formValueForKey: SOGoRole_ObjectEraser] length] > 0)
|
||||
[self appendRight: SOGoRole_ObjectEraser];
|
||||
else
|
||||
[self removeRight: SOGoRole_ObjectEraser];
|
||||
|
||||
if ([[request formValueForKey: SOGoMailRole_MessageEraser] length] > 0)
|
||||
[self appendRight: SOGoMailRole_MessageEraser];
|
||||
else
|
||||
[self removeRight: SOGoMailRole_MessageEraser];
|
||||
|
||||
if ([[request formValueForKey: SOGoMailRole_Expunger] length] > 0)
|
||||
[self appendRight: SOGoMailRole_Expunger];
|
||||
else
|
||||
[self removeRight: SOGoMailRole_Expunger];
|
||||
|
||||
if ([[request formValueForKey: SOGoMailRole_Administrator] length] > 0)
|
||||
[self appendRight: SOGoMailRole_Administrator];
|
||||
else
|
||||
[self removeRight: SOGoMailRole_Administrator];
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
+15
-18
@@ -1,5 +1,5 @@
|
||||
{ /* -*-javascript-*- */
|
||||
requires = ( MAIN, CommonUI, Mailer ); /* , Sieve */
|
||||
requires = ( MAIN, MainUI, CommonUI, Mailer ); /* , Sieve */
|
||||
|
||||
publicResources = (
|
||||
"uix.css",
|
||||
@@ -131,15 +131,20 @@
|
||||
pageName = "UIxMailListView";
|
||||
actionName = "deleteFolder";
|
||||
};
|
||||
editACL = {
|
||||
protectedBy = "View";
|
||||
pageName = "UIxMailFolderACLEditor";
|
||||
};
|
||||
compose = {
|
||||
protectedBy = "View";
|
||||
actionClass = "UIxMailEditorAction";
|
||||
actionName = "compose";
|
||||
};
|
||||
userRights = {
|
||||
protectedBy = "ReadAcls";
|
||||
pageName = "UIxMailUserRightsEditor";
|
||||
};
|
||||
saveUserRights = {
|
||||
protectedBy = "SaveAcls";
|
||||
pageName = "UIxMailUserRightsEditor";
|
||||
actionName = "saveUserRights";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
@@ -255,24 +260,16 @@
|
||||
};
|
||||
};
|
||||
methods = {
|
||||
view = {
|
||||
protectedBy = "View";
|
||||
pageName = "UIxMailAccountView";
|
||||
};
|
||||
getMail = {
|
||||
protectedBy = "View";
|
||||
pageName = "UIxMailAccountView";
|
||||
};
|
||||
compose = {
|
||||
protectedBy = "View";
|
||||
actionClass = "UIxMailEditorAction";
|
||||
actionName = "compose";
|
||||
};
|
||||
createFolder = {
|
||||
protectedBy = "View";
|
||||
pageName = "UIxMailAccountView";
|
||||
actionName = "createFolder";
|
||||
};
|
||||
mailboxes = {
|
||||
protectedBy = "View";
|
||||
pageName = "UIxMailAccountView";
|
||||
actionName = "listMailboxes";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
@@ -70,7 +70,7 @@
|
||||
|
||||
"New Calendar..." = "New Calendar...";
|
||||
"Delete Calendar" = "Delete Calendar";
|
||||
"Access Rights..." = "Access Rights...";
|
||||
"Sharing..." = "Sharing...";
|
||||
"Export Calendar..." = "Export Calendar...";
|
||||
"Publish Calendar..." = "Publish Calendar...";
|
||||
"Reload Remote Calendars" = "Reload Remote Calendars";
|
||||
|
||||
@@ -71,7 +71,7 @@
|
||||
|
||||
"New Calendar..." = "Nouvel agenda...";
|
||||
"Delete Calendar" = "Effacer l'agenda";
|
||||
"Access Rights..." = "Partage";
|
||||
"Sharing..." = "Partage...";
|
||||
"Export Calendar..." = "Exporter l'agenda...";
|
||||
"Publish Calendar..." = "Publier l'agenda...";
|
||||
"Reload Remote Calendars" = "Recharger les agendas distants";
|
||||
|
||||
@@ -7,9 +7,8 @@
|
||||
>
|
||||
<div class="menu" id="searchMenu">
|
||||
<ul id="searchOptions">
|
||||
<li id="name_or_address"
|
||||
onmousedown="return false;"
|
||||
onmouseup="setSearchCriteria(event);"><var:string label:value="Name or Email"/></li>
|
||||
<li id="name_or_address"><var:string
|
||||
label:value="Name or Email"/></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -14,23 +14,24 @@
|
||||
<div class="menu" id="contactFoldersMenu">
|
||||
<ul>
|
||||
<li><var:string label:value="Modify" /></li>
|
||||
<li id="accessRightsMenuEntry"><var:string label:value="Access Rights..." /></li>
|
||||
<li class="separator"></li>
|
||||
<li class="disabled"><var:string label:value="New Card" /></li>
|
||||
<li class="disabled"><var:string label:value="New List" /></li>
|
||||
<li class="separator"></li>
|
||||
<li class="disabled"><var:string label:value="Delete" /></li>
|
||||
<li><!-- separator --></li>
|
||||
<li><var:string label:value="New Card" /></li>
|
||||
<li><var:string label:value="New List" /></li>
|
||||
<li><!-- separator --></li>
|
||||
<li><var:string label:value="Delete" /></li>
|
||||
<li><!-- separator --></li>
|
||||
<li><var:string label:value="Sharing..." /></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="menu" id="contactMenu">
|
||||
<ul>
|
||||
<li id="modifyContactMenuEntry" onmouseup="return onMenuEditContact(event, this);"><var:string label:value="Modify" /></li>
|
||||
<li class="separator"></li>
|
||||
<li id="writeToContactMenuEntry" onmouseup="return onMenuWriteToContact(event, this);"><var:string label:value="Write" /></li>
|
||||
<li class="disabled" id="imContactMenuEntry"><var:string label:value="Instant Message" /></li>
|
||||
<li class="separator"></li>
|
||||
<li id="deleteContactMenuEntry" onmouseup="return onMenuDeleteContact(event, this);"><var:string label:value="Delete" /></li>
|
||||
<li><var:string label:value="Modify" /></li>
|
||||
<li><!-- separator --></li>
|
||||
<li><var:string label:value="Write" /></li>
|
||||
<li><var:string label:value="Instant Message" /></li>
|
||||
<li><!-- separator --></li>
|
||||
<li><var:string label:value="Delete" /></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -1,43 +0,0 @@
|
||||
<?xml version='1.0' standalone='yes'?>
|
||||
<div style="padding: 1em;"
|
||||
xmlns="http://www.w3.org/1999/xhtml"
|
||||
xmlns:var="http://www.skyrix.com/od/binding"
|
||||
xmlns:const="http://www.skyrix.com/od/constant"
|
||||
xmlns:uix="OGo:uix"
|
||||
xmlns:rsrc="OGo:url"
|
||||
xmlns:label="OGo:label">
|
||||
<h2>
|
||||
SOGo Mail - <var:string value="objectTitle" />
|
||||
|
||||
<var:if condition="clientObject.isSharedAccount">
|
||||
<var:string label:value="Shared Account: " />
|
||||
</var:if>
|
||||
|
||||
</h2>
|
||||
<var:if condition="clientObject.isSharedAccount">
|
||||
<div>
|
||||
<var:string label:value="Share: " />
|
||||
<var:string value="clientObject.sharedAccountName" />
|
||||
</div>
|
||||
</var:if>
|
||||
|
||||
<h3>Email</h3>
|
||||
<p>
|
||||
<a href="INBOX/" onclick="initMailboxSelection(currentMailbox + '/INBOX'); openMailbox(currentMailbox + '/INBOX'); return false;"><img rsrc:src="read-messages.png" /><var:string label:value="Read messages" /></a><br />
|
||||
<a href="#" onclick="clickedCompose(this);"><img rsrc:src="write-message.png" /><var:string label:value="Write a new message" /></a><br />
|
||||
</p>
|
||||
|
||||
<h3>Accounts</h3>
|
||||
<p>
|
||||
<a href=""><img rsrc:src="account-settings.png" />View settings for this account</a><br />
|
||||
<a href=""><img rsrc:src="create-account.png" />Create a new account</a> [TBD: not in Agenor]<br />
|
||||
</p>
|
||||
|
||||
<h3>Advanced Features</h3>
|
||||
<p>
|
||||
<a href=""><img rsrc:src="search-messages.png" />Search messages</a><br />
|
||||
<a href=""><img rsrc:src="manage-filters.png" />Manage message filters</a><br />
|
||||
<a href=""><img rsrc:src="manage-imap.png" />Manage folder subscriptions</a><br />
|
||||
<a href=""><img rsrc:src="offline-settings.png" />Offline settings</a> [TBD: not in Agenor]<br />
|
||||
</p>
|
||||
</div>
|
||||
@@ -1,13 +0,0 @@
|
||||
<?xml version='1.0' standalone='yes'?>
|
||||
<var:component
|
||||
xmlns="http://www.w3.org/1999/xhtml"
|
||||
xmlns:var="http://www.skyrix.com/od/binding"
|
||||
xmlns:const="http://www.skyrix.com/od/constant"
|
||||
xmlns:uix="OGo:uix"
|
||||
xmlns:rsrc="OGo:url"
|
||||
xmlns:label="OGo:label"
|
||||
className="UIxPageFrame"
|
||||
title="panelTitle"
|
||||
const:popup="YES">
|
||||
TODO: IMAP4 ACL editor
|
||||
</var:component>
|
||||
@@ -30,7 +30,7 @@
|
||||
<li><var:string label:value="Compact This Folder" /></li>
|
||||
<li><!-- separator --></li>
|
||||
<li><var:string label:value="Search Messages..." /></li>
|
||||
<li><var:string label:value="Properties..." /></li>
|
||||
<li><var:string label:value="Sharing..." /></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
@@ -46,7 +46,7 @@
|
||||
<li><var:string label:value="Empty Trash" /></li>
|
||||
<li><!-- separator --></li>
|
||||
<li><var:string label:value="Search Messages..." /></li>
|
||||
<li><var:string label:value="Properties..." /></li>
|
||||
<li><var:string label:value="Sharing..." /></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
@@ -63,7 +63,7 @@
|
||||
<li><var:string label:value="Delete Folder" /></li>
|
||||
<li><!-- separator --></li>
|
||||
<li><var:string label:value="Search Messages..." /></li>
|
||||
<li><var:string label:value="Properties..." /></li>
|
||||
<li><var:string label:value="Sharing..." /></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -1,43 +0,0 @@
|
||||
<?xml version='1.0' standalone='yes'?>
|
||||
<div style="padding: 1em;"
|
||||
xmlns="http://www.w3.org/1999/xhtml"
|
||||
xmlns:var="http://www.skyrix.com/od/binding"
|
||||
xmlns:const="http://www.skyrix.com/od/constant"
|
||||
xmlns:uix="OGo:uix"
|
||||
xmlns:rsrc="OGo:url"
|
||||
xmlns:label="OGo:label">
|
||||
<h2>
|
||||
SOGo Mail - <var:string value="objectTitle" />
|
||||
|
||||
<var:if condition="clientObject.isSharedAccount">
|
||||
<var:string label:value="Shared Account: " />
|
||||
</var:if>
|
||||
|
||||
</h2>
|
||||
<var:if condition="clientObject.isSharedAccount">
|
||||
<div>
|
||||
<var:string label:value="Share: " />
|
||||
<var:string value="clientObject.sharedAccountName" />
|
||||
</div>
|
||||
</var:if>
|
||||
|
||||
<h3>Email</h3>
|
||||
<p>
|
||||
<a href="INBOX/" onclick="initMailboxSelection(currentMailbox + '/INBOX'); openMailbox(currentMailbox + '/INBOX'); return false;"><img rsrc:src="read-messages.png" /><var:string label:value="Read messages" /></a><br />
|
||||
<a href="#" onclick="clickedCompose(this);"><img rsrc:src="write-message.png" /><var:string label:value="Write a new message" /></a><br />
|
||||
</p>
|
||||
|
||||
<h3>Accounts</h3>
|
||||
<p>
|
||||
<a href=""><img rsrc:src="account-settings.png" />View settings for this account</a><br />
|
||||
<a href=""><img rsrc:src="create-account.png" />Create a new account</a> [TBD: not in Agenor]<br />
|
||||
</p>
|
||||
|
||||
<h3>Advanced Features</h3>
|
||||
<p>
|
||||
<a href=""><img rsrc:src="search-messages.png" />Search messages</a><br />
|
||||
<a href=""><img rsrc:src="manage-filters.png" />Manage message filters</a><br />
|
||||
<a href=""><img rsrc:src="manage-imap.png" />Manage folder subscriptions</a><br />
|
||||
<a href=""><img rsrc:src="offline-settings.png" />Offline settings</a> [TBD: not in Agenor]<br />
|
||||
</p>
|
||||
</div>
|
||||
@@ -0,0 +1,88 @@
|
||||
<?xml version="1.0" standalone="yes"?>
|
||||
<!DOCTYPE var:component>
|
||||
<var:component xmlns="http://www.w3.org/1999/xhtml"
|
||||
xmlns:var="http://www.skyrix.com/od/binding"
|
||||
xmlns:const="http://www.skyrix.com/od/constant"
|
||||
xmlns:uix="OGo:uix"
|
||||
xmlns:label="OGo:label"
|
||||
xmlns:rsrc="OGo:url"
|
||||
className="UIxPageFrame"
|
||||
title="title"
|
||||
const:toolbar="none"
|
||||
const:popup="YES">
|
||||
<form id="userRightsForm" const:href="saveUserRights">
|
||||
<input type="hidden" name="uid" var:value="uid"/>
|
||||
<div class="title">
|
||||
<var:if condition="userIsDefaultUser">
|
||||
<label><span class="value"><var:string label:value="Default Roles"
|
||||
/></span></label>
|
||||
</var:if><var:if condition="userIsDefaultUser" const:negate="YES">
|
||||
<label><var:string label:value="User rights for:"/><br/>
|
||||
<span class="value"><var:string value="userDisplayName"
|
||||
/></span></label></var:if>
|
||||
</div>
|
||||
<div class="calendarUserRights">
|
||||
<label><input type="checkbox" class="checkBox"
|
||||
const:name="ObjectViewer"
|
||||
var:checked="userCanSeeFolder"/><var:string
|
||||
label:value="List and see this folder"/></label>
|
||||
<br/>
|
||||
<label><input type="checkbox" class="checkBox"
|
||||
const:name="ObjectReader"
|
||||
var:checked="userCanReadMails"/><var:string
|
||||
label:value="Read mails from this folder"/></label>
|
||||
<br/>
|
||||
<label><input type="checkbox" class="checkBox"
|
||||
const:name="MailSeenKeeper"
|
||||
var:checked="userCanMarkMailsRead"/><var:string
|
||||
label:value="Mark mails read and unread"/></label>
|
||||
<br/>
|
||||
<label><input type="checkbox" class="checkBox"
|
||||
const:name="MailWriter"
|
||||
var:checked="userCanWriteMails"/><var:string
|
||||
label:value="Modify the flags of the mails in this folder"/></label>
|
||||
<br/>
|
||||
<label><input type="checkbox" class="checkBox"
|
||||
const:name="ObjectCreator"
|
||||
var:checked="userCanInsertMails"/><var:string
|
||||
label:value="Insert, copy and move mails into this folder"/></label>
|
||||
<br/>
|
||||
<label><input type="checkbox" class="checkBox"
|
||||
const:name="MailPoster"
|
||||
var:checked="userCanPostMails"/><var:string
|
||||
label:value="Post mails"/></label>
|
||||
<br/>
|
||||
<label><input type="checkbox" class="checkBox"
|
||||
const:name="FolderCreator"
|
||||
var:checked="userCanCreateSubfolders"/><var:string
|
||||
label:value="Add subfolders to this folder"/></label>
|
||||
<br/>
|
||||
<label><input type="checkbox" class="checkBox"
|
||||
const:name="ObjectEraser"
|
||||
var:checked="userCanRemoveFolder"/><var:string
|
||||
label:value="Remove this folder"/></label>
|
||||
<br/>
|
||||
<label><input type="checkbox" class="checkBox"
|
||||
const:name="MailMessageEraser"
|
||||
var:checked="userCanEraseMails"/><var:string
|
||||
label:value="Erase mails from this folder"/></label>
|
||||
<br/>
|
||||
<label><input type="checkbox" class="checkBox"
|
||||
const:name="MailExpunger"
|
||||
var:checked="userCanExpungeFolder"/><var:string
|
||||
label:value="Expunge this folder"/></label>
|
||||
<br/>
|
||||
<label><input type="checkbox" class="checkBox"
|
||||
const:name="MailAdministrator"
|
||||
var:checked="userIsAdministrator"/><var:string
|
||||
label:value="Modify the acl of this folder"/></label>
|
||||
<br/>
|
||||
</div>
|
||||
<div class="buttons">
|
||||
<input const:name="updateButton" id="updateButton"
|
||||
class="button" type="submit" label:value="Update"/>
|
||||
<input const:name="cancelButton" id="cancelButton"
|
||||
class="button" type="button" label:value="Cancel"/>
|
||||
</div>
|
||||
</form>
|
||||
</var:component>
|
||||
@@ -7,9 +7,7 @@
|
||||
>
|
||||
<div class="menu" id="searchMenu">
|
||||
<ul id="searchOptions">
|
||||
<li id="name_or_address"
|
||||
onmousedown="return false;"
|
||||
onmouseup="setSearchCriteria(event);"><var:string label:value="Title or Description"/></li>
|
||||
<li><var:string label:value="Title or Description"/></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -14,10 +14,7 @@
|
||||
<div class="menu" id="monthListMenu">
|
||||
<ul>
|
||||
<var:foreach list="monthMenuItems" item="monthMenuItem"
|
||||
><li
|
||||
onmousedown="return false;"
|
||||
onclick="return onMonthMenuItemClick(this);"
|
||||
var:month="monthMenuItem"
|
||||
><li var:month="monthMenuItem"
|
||||
><var:string value="monthMenuItemLabel" /></li>
|
||||
</var:foreach
|
||||
></ul>
|
||||
@@ -26,41 +23,37 @@
|
||||
<div class="menu" id="yearListMenu">
|
||||
<ul>
|
||||
<var:foreach list="yearMenuItems" item="yearMenuItem"
|
||||
><li
|
||||
onmousedown="return false;"
|
||||
onclick="return onYearMenuItemClick(this);"
|
||||
><var:string value="yearMenuItem" /></li>
|
||||
><li><var:string value="yearMenuItem" /></li>
|
||||
</var:foreach
|
||||
></ul>
|
||||
</div>
|
||||
|
||||
<div class="menu" id="appointmentsListMenu">
|
||||
<ul>
|
||||
<li onmouseup="newEvent(this, 'event');"><var:string label:value="New Event..."/></li>
|
||||
<li class="separator"></li>
|
||||
<li onmouseup="newEvent(this, 'task');"><var:string label:value="New Task..."/></li>
|
||||
<li onmouseup="editEvent();"><var:string label:value="Edit Selected Event..."/></li>
|
||||
<li onmouseup="deleteEvent();"><var:string label:value="Delete Selected Event"/></li>
|
||||
<li class="separator"></li>
|
||||
<li onmouseup="onSelectAll();"><var:string label:value="Select All"/></li>
|
||||
<li class="separator"></li>
|
||||
<li onmouseup="onToggleWorkweekDaysOnly();"><var:string label:value="Workweek days only" /></li>
|
||||
<li onmouseup="onToggleTasksInView();"><var:string label:value="Tasks in View"/></li>
|
||||
<li><var:string label:value="New Event..."/></li>
|
||||
<li><!-- separator --></li>
|
||||
<li><var:string label:value="New Task..."/></li>
|
||||
<li><var:string label:value="Edit Selected Event..."/></li>
|
||||
<li><var:string label:value="Delete Selected Event"/></li>
|
||||
<li><!-- separator --></li>
|
||||
<li><var:string label:value="Select All"/></li>
|
||||
<li><!-- separator --></li>
|
||||
<li><var:string label:value="Workweek days only"/></li>
|
||||
<li><var:string label:value="Tasks in View"/></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="menu" id="calendarsMenu">
|
||||
<ul>
|
||||
<li class="disabled" id="newCalendarMenuEntry"><var:string label:value="New Calendar..."/></li>
|
||||
<li class="disabled" id="deleteCalendarMenuEntry"><var:string label:value="Delete Calendar"/></li>
|
||||
<li id="accessRightsMenuEntry"><var:string label:value="Access Rights..." /></li>
|
||||
<li class="separator"></li>
|
||||
<li class="disabled" id="exportCalendarMenuEntry"><var:string label:value="Export Calendar..."/></li>
|
||||
<li class="disabled" id="publishCalendarMenuEntry"><var:string label:value="Publish Calendar..."/></li>
|
||||
<li class="separator"></li>
|
||||
<li class="disabled" id="publishCalendarMenuEntry"><var:string label:value="Reload Remote Calendars"/></li>
|
||||
<li class="separator"></li>
|
||||
<li class="disabled" id="calendarPropertiesMenuEntry"><var:string label:value="Properties"/></li>
|
||||
<li><var:string label:value="New Calendar..."/></li>
|
||||
<li><var:string label:value="Delete Calendar"/></li>
|
||||
<li><!-- separator --></li>
|
||||
<li><var:string label:value="Export Calendar..."/></li>
|
||||
<li><var:string label:value="Publish Calendar..."/></li>
|
||||
<li><!-- separator --></li>
|
||||
<li><var:string label:value="Reload Remote Calendars"/></li>
|
||||
<li><!-- separator --></li>
|
||||
<li><var:string label:value="Sharing..." /></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -22,8 +22,9 @@
|
||||
<label><var:string label:value="Owner:"/><br/>
|
||||
<span class="value"><strong><var:string value="ownerName"/></strong></span></label><br/>
|
||||
</div>
|
||||
<input id="defaultRolesBtn" type="button"
|
||||
class="button" label:value="Default Roles"/>
|
||||
<var:if condition="clientObject.hasSupportForDefaultRoles"
|
||||
><input id="defaultRolesBtn" type="button"
|
||||
class="button" label:value="Default Roles"/></var:if>
|
||||
<div class="userSelector" id="userRoles">
|
||||
<var:if condition="currentUserIsOwner">
|
||||
<span id="userSelectorButtons">
|
||||
|
||||
@@ -91,7 +91,7 @@ function contactsListCallback(http) {
|
||||
function onContactFoldersContextMenu(event) {
|
||||
var menu = $("contactFoldersMenu");
|
||||
Event.observe(menu, "hideMenu", onContactFoldersContextMenuHide, false);
|
||||
onMenuClick(event, "contactFoldersMenu");
|
||||
popupMenu(event, "contactFoldersMenu", this);
|
||||
|
||||
var topNode = $("contactFolders");
|
||||
var selectedNodes = topNode.getSelectedRows();
|
||||
@@ -105,7 +105,7 @@ function onContactFoldersContextMenu(event) {
|
||||
function onContactContextMenu(event, element) {
|
||||
var menu = $("contactMenu");
|
||||
Event.observe(menu, "hideMenu", onContactContextMenuHide, false);
|
||||
onMenuClick(event, "contactMenu");
|
||||
popupMenu(event, "contactMenu", element);
|
||||
|
||||
var topNode = $("contactsList");
|
||||
var selectedNodes = topNode.getSelectedRows();
|
||||
@@ -235,31 +235,23 @@ function onContactRowDblClick(event, node) {
|
||||
return false;
|
||||
}
|
||||
|
||||
function onMenuEditContact(event, node) {
|
||||
var node = getParentMenu(node).menuTarget.parentNode;
|
||||
var contactId = node.getAttribute('id');
|
||||
function onMenuEditContact(event) {
|
||||
var contactId = document.menuTarget.getAttribute('id');
|
||||
|
||||
openContactWindow(null,
|
||||
URLForFolderID(currentContactFolder)
|
||||
+ "/" + contactId + "/edit");
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
function onMenuWriteToContact(event, node) {
|
||||
var node = getParentMenu(node).menuTarget.parentNode;
|
||||
var contactId = node.getAttribute('id');
|
||||
function onMenuWriteToContact(event) {
|
||||
var contactId = document.menuTarget.getAttribute('id');
|
||||
|
||||
openMailComposeWindow(ApplicationBaseURL + currentContactFolder
|
||||
+ "/" + contactId + "/write");
|
||||
|
||||
return false;
|
||||
openMailComposeWindow(ApplicationBaseURL + currentContactFolder
|
||||
+ "/" + contactId + "/write");
|
||||
}
|
||||
|
||||
function onMenuDeleteContact(event, node) {
|
||||
uixDeleteSelectedContacts(node);
|
||||
|
||||
return false;
|
||||
function onMenuDeleteContact(event) {
|
||||
uixDeleteSelectedContacts(this);
|
||||
}
|
||||
|
||||
function onToolbarEditSelectedContacts(event) {
|
||||
@@ -594,9 +586,8 @@ function configureContactFolders() {
|
||||
if (contactFolders) {
|
||||
Event.observe(contactFolders, "selectionchange", onFolderSelectionChange, false);
|
||||
var lis = contactFolders.childNodesWithTag("li");
|
||||
for (var i = 0; i < lis.length; i++) {
|
||||
for (var i = 0; i < lis.length; i++)
|
||||
setEventsOnContactFolder(lis[i]);
|
||||
}
|
||||
|
||||
lookupDeniedFolders();
|
||||
contactFolders.setStyle({ visibility: 'visible' });
|
||||
@@ -612,21 +603,27 @@ function setEventsOnContactFolder(node) {
|
||||
Event.observe(node, "contextmenu", onContactFoldersContextMenu, false);
|
||||
}
|
||||
|
||||
function onAccessRightsMenuEntryMouseUp(event) {
|
||||
var folders = $("contactFolders");
|
||||
var selected = folders.getSelectedNodes()[0];
|
||||
var title = this.innerHTML;
|
||||
var url = URLForFolderID(selected.getAttribute("id"))
|
||||
function onMenuSharing(event) {
|
||||
var folders = $("contactFolders");
|
||||
var selected = folders.getSelectedNodes()[0];
|
||||
var title = this.innerHTML;
|
||||
var url = URLForFolderID(selected.getAttribute("id"));
|
||||
|
||||
openAclWindow(url + "/acls", title);
|
||||
openAclWindow(url + "/acls", title);
|
||||
}
|
||||
|
||||
function initializeMenus() {
|
||||
var menus = new Array("contactFoldersMenu", "contactMenu", "searchMenu");
|
||||
initMenusNamed(menus);
|
||||
menus["menuIds"] = new Array("contactFoldersMenu", "contactMenu",
|
||||
"searchMenu");
|
||||
menus["contactFoldersMenu"] = new Array(null, "-", null,
|
||||
null, "-", null, "-",
|
||||
onMenuSharing);
|
||||
menus["contactMenu"] = new Array(onMenuEditContact, "-",
|
||||
onMenuWriteToContact, null, "-",
|
||||
onMenuDeleteContact);
|
||||
menus["searchMenu"] = new Array(setSearchCriteria);
|
||||
|
||||
var menuEntry = $("accessRightsMenuEntry");
|
||||
Event.observe(menuEntry, "mouseup", onAccessRightsMenuEntryMouseUp, false);
|
||||
initMenus();
|
||||
}
|
||||
|
||||
function configureSearchField() {
|
||||
|
||||
@@ -1,178 +1,236 @@
|
||||
Element.addMethods({
|
||||
|
||||
addInterface: function(element, objectInterface) {
|
||||
element = $(element);
|
||||
Object.extend(element, objectInterface);
|
||||
if (element.bind)
|
||||
element.bind();
|
||||
},
|
||||
|
||||
childNodesWithTag: function(element, tagName) {
|
||||
element = $(element);
|
||||
var matchingNodes = new Array();
|
||||
var tagName = tagName.toUpperCase();
|
||||
|
||||
for (var i = 0; i < element.childNodes.length; i++) {
|
||||
if (typeof(element.childNodes[i]) == "object"
|
||||
&& element.childNodes[i].tagName
|
||||
&& element.childNodes[i].tagName.toUpperCase() == tagName)
|
||||
matchingNodes.push(element.childNodes[i]);
|
||||
}
|
||||
if (navigator.vendor == "Apple Computer, Inc." || navigator.vendor == "KDE") { // WebCore/KHTML
|
||||
/*
|
||||
Crossbrowser HTMLElement Prototyping
|
||||
Copyright (C) 2005 Jason Davis, http://www.browserland.org
|
||||
Additional thanks to Brothercake, http://www.brothercake.com
|
||||
|
||||
return matchingNodes;
|
||||
},
|
||||
This code is licensed under the LGPL:
|
||||
http://www.gnu.org/licenses/lgpl.html
|
||||
*/
|
||||
|
||||
getParentWithTagName: function(element, tagName) {
|
||||
element = $(element);
|
||||
var currentElement = element;
|
||||
tagName = tagName.toUpperCase();
|
||||
|
||||
currentElement = currentElement.parentNode;
|
||||
while (currentElement
|
||||
&& currentElement.tagName != tagName) {
|
||||
currentElement = currentElement.parentNode;
|
||||
}
|
||||
|
||||
return currentElement;
|
||||
},
|
||||
|
||||
cascadeLeftOffset: function(element) {
|
||||
element = $(element);
|
||||
var currentElement = element;
|
||||
(function(c) {
|
||||
for (var i in c)
|
||||
window["HTML" + i + "Element"] = document.createElement(c[ i ]).constructor;
|
||||
})({
|
||||
Html: "html", Head: "head", Link: "link", Title: "title", Meta: "meta",
|
||||
Base: "base", IsIndex: "isindex", Style: "style", Body: "body", Form: "form",
|
||||
Select: "select", OptGroup: "optgroup", Option: "option", Input: "input",
|
||||
TextArea: "textarea", Button: "button", Label: "label", FieldSet: "fieldset",
|
||||
Legend: "legend", UList: "ul", OList: "ol", DList: "dl", Directory: "dir",
|
||||
Menu: "menu", LI: "li", Div: "div", Paragraph: "p", Heading: "h1", Quote: "q",
|
||||
Pre: "pre", BR: "br", BaseFont: "basefont", Font: "font", HR: "hr", Mod: "ins",
|
||||
Anchor: "a", Image: "img", Object: "object", Param: "param", Applet: "applet",
|
||||
Map: "map", Area: "area", Script: "script", Table: "table", TableCaption: "caption",
|
||||
TableCol: "col", TableSection: "tbody", TableRow: "tr", TableCell: "td",
|
||||
FrameSet: "frameset", Frame: "frame", IFrame: "iframe"
|
||||
});
|
||||
|
||||
var offset = 0;
|
||||
while (currentElement) {
|
||||
offset += currentElement.offsetLeft;
|
||||
currentElement = currentElement.getParentWithTagName("div");
|
||||
}
|
||||
|
||||
return offset;
|
||||
},
|
||||
|
||||
cascadeTopOffset: function(element) {
|
||||
element = $(element);
|
||||
var currentElement = element;
|
||||
var offset = 0;
|
||||
|
||||
var i = 0;
|
||||
while (currentElement
|
||||
&& currentElement instanceof HTMLElement) {
|
||||
offset += currentElement.offsetTop;
|
||||
currentElement = currentElement.parentNode;
|
||||
i++;
|
||||
}
|
||||
|
||||
return offset;
|
||||
},
|
||||
|
||||
dump: function(element, additionalInfo, additionalKeys) {
|
||||
element = $(element);
|
||||
var id = element.getAttribute("id");
|
||||
var nclass = element.getAttribute("class");
|
||||
function HTMLElement() {}
|
||||
//HTMLElement.prototype = HTMLHtmlElement.__proto__.__proto__;
|
||||
var HTMLDocument = document.constructor;
|
||||
var HTMLCollection = document.links.constructor;
|
||||
var HTMLOptionsCollection = document.createElement("select").options.constructor;
|
||||
var Text = document.createTextNode("").constructor;
|
||||
//var Node = Text;
|
||||
|
||||
var str = element.tagName;
|
||||
if (id)
|
||||
str += "; id = " + id;
|
||||
if (nclass)
|
||||
str += "; class = " + nclass;
|
||||
|
||||
if (additionalInfo)
|
||||
str += "; " + additionalInfo;
|
||||
|
||||
if (additionalKeys)
|
||||
for (var i = 0; i < additionalKeys.length; i++) {
|
||||
var value = element.getAttribute(additionalKeys[i]);
|
||||
if (value)
|
||||
str += "; " + additionalKeys[i] + " = " + value;
|
||||
}
|
||||
|
||||
log (str);
|
||||
},
|
||||
// More efficient for Safari 2
|
||||
function Document() {}
|
||||
function Event() {}
|
||||
function HTMLCollection() {}
|
||||
function HTMLElement() {}
|
||||
function Node() {}
|
||||
Document.prototype = window["[[DOMDocument]]"];
|
||||
Event.prototype = window["[[DOMEvent]]"];
|
||||
HTMLCollection.prototype = window["[[HTMLCollection.prototype]]"];
|
||||
HTMLElement.prototype = window["[[DOMElement.prototype]]"];
|
||||
Node.prototype = window["[[DOMNode.prototype]]"];
|
||||
}
|
||||
|
||||
getSelectedNodes: function(element) {
|
||||
element = $(element);
|
||||
var selArray = new Array();
|
||||
/* custom extensions to the DOM api */
|
||||
HTMLElement.prototype.addInterface = function(objectInterface) {
|
||||
Object.extend(this, objectInterface);
|
||||
if (this.bind)
|
||||
this.bind();
|
||||
}
|
||||
|
||||
for (var i = 0; i < element.childNodes.length; i++) {
|
||||
node = element.childNodes.item(i);
|
||||
if (node.nodeType == 1
|
||||
&& isNodeSelected(node))
|
||||
selArray.push(node);
|
||||
}
|
||||
|
||||
return selArray;
|
||||
},
|
||||
|
||||
getSelectedNodesId: function(element) {
|
||||
element = $(element);
|
||||
var selArray = new Array();
|
||||
|
||||
for (var i = 0; i < element.childNodes.length; i++) {
|
||||
node = element.childNodes.item(i);
|
||||
if (node.nodeType == 1
|
||||
&& isNodeSelected(node))
|
||||
selArray.push(node.getAttribute("id"));
|
||||
}
|
||||
|
||||
return selArray;
|
||||
},
|
||||
HTMLElement.prototype.childNodesWithTag = function(tagName) {
|
||||
var matchingNodes = new Array();
|
||||
var tagName = tagName.toUpperCase();
|
||||
|
||||
onContextMenu: function(element, event) {
|
||||
element = $(element);
|
||||
var popup = element.sogoContextMenu;
|
||||
|
||||
if (document.currentPopupMenu)
|
||||
hideMenu(event, document.currentPopupMenu);
|
||||
|
||||
var menuTop = event.pageY;
|
||||
var menuLeft = event.pageX;
|
||||
var heightDiff = (window.innerHeight
|
||||
- (menuTop + popup.offsetHeight));
|
||||
if (heightDiff < 0)
|
||||
menuTop += heightDiff;
|
||||
|
||||
var leftDiff = (window.innerWidth
|
||||
- (menuLeft + popup.offsetWidth));
|
||||
if (leftDiff < 0)
|
||||
menuLeft -= popup.offsetWidth;
|
||||
|
||||
popup.style.top = menuTop + "px;";
|
||||
popup.style.left = menuLeft + "px;";
|
||||
popup.style.visibility = "visible;";
|
||||
|
||||
bodyOnClick = "" + document.body.getAttribute("onclick");
|
||||
document.body.setAttribute("onclick", "onBodyClick(event);");
|
||||
document.currentPopupMenu = popup;
|
||||
},
|
||||
|
||||
attachMenu: function(element, menuName) {
|
||||
element = $(element);
|
||||
element.sogoContextMenu = $(menuName);
|
||||
element.addEventListener("contextmenu", element.onContextMenu, true);
|
||||
},
|
||||
|
||||
select: function(element) {
|
||||
element = $(element);
|
||||
element.addClassName('_selected');
|
||||
},
|
||||
|
||||
deselect: function(element) {
|
||||
element = $(element);
|
||||
element.removeClassName('_selected');
|
||||
},
|
||||
|
||||
deselectAll: function(element) {
|
||||
element = $(element);
|
||||
var nodes;
|
||||
if (element.tagName == 'TABLE')
|
||||
nodes = element.getSelectedRows();
|
||||
else
|
||||
nodes = element.childNodes;
|
||||
for (var i = 0; i < nodes.length; i++) {
|
||||
var node = nodes.item(i);
|
||||
if (node.nodeType == 1)
|
||||
node.deselect();
|
||||
}
|
||||
for (var i = 0; i < this.childNodes.length; i++) {
|
||||
if (typeof(this.childNodes[i]) == "object"
|
||||
&& this.childNodes[i].tagName
|
||||
&& this.childNodes[i].tagName.toUpperCase() == tagName)
|
||||
matchingNodes.push(this.childNodes[i]);
|
||||
}
|
||||
|
||||
}); // Element.addMethods
|
||||
return matchingNodes;
|
||||
}
|
||||
|
||||
HTMLElement.prototype.addClassName = function(className) {
|
||||
var classStr = '' + this.getAttribute("class");
|
||||
|
||||
position = classStr.indexOf(className, 0);
|
||||
if (position < 0) {
|
||||
classStr = classStr + ' ' + className;
|
||||
this.setAttribute('class', classStr);
|
||||
}
|
||||
}
|
||||
|
||||
HTMLElement.prototype.removeClassName = function(className) {
|
||||
var classStr = '' + this.getAttribute('class');
|
||||
|
||||
position = classStr.indexOf(className, 0);
|
||||
while (position > -1) {
|
||||
classStr1 = classStr.substring(0, position);
|
||||
classStr2 = classStr.substring(position + 10, classStr.length);
|
||||
classStr = classStr1 + classStr2;
|
||||
position = classStr.indexOf(className, 0);
|
||||
}
|
||||
|
||||
this.setAttribute('class', classStr);
|
||||
}
|
||||
|
||||
HTMLElement.prototype.hasClassName = function(className) {
|
||||
var classStr = '' + this.getAttribute('class');
|
||||
position = classStr.indexOf(className, 0);
|
||||
return (position > -1);
|
||||
}
|
||||
|
||||
HTMLElement.prototype.getParentWithTagName = function(tagName) {
|
||||
var currentElement = this;
|
||||
tagName = tagName.toUpperCase();
|
||||
|
||||
currentElement = currentElement.parentNode;
|
||||
while (currentElement
|
||||
&& currentElement.tagName != tagName) {
|
||||
currentElement = currentElement.parentNode;
|
||||
}
|
||||
|
||||
return currentElement;
|
||||
}
|
||||
|
||||
HTMLElement.prototype.cascadeLeftOffset = function() {
|
||||
var currentElement = this;
|
||||
|
||||
var offset = 0;
|
||||
while (currentElement) {
|
||||
offset += currentElement.offsetLeft;
|
||||
currentElement = currentElement.getParentWithTagName("div");
|
||||
}
|
||||
|
||||
return offset;
|
||||
}
|
||||
|
||||
HTMLElement.prototype.cascadeTopOffset = function() {
|
||||
var currentElement = this;
|
||||
var offset = 0;
|
||||
|
||||
var i = 0;
|
||||
|
||||
while (currentElement
|
||||
&& currentElement instanceof HTMLElement) {
|
||||
offset += currentElement.offsetTop;
|
||||
currentElement = currentElement.parentNode;
|
||||
i++;
|
||||
}
|
||||
|
||||
return offset;
|
||||
}
|
||||
|
||||
HTMLElement.prototype.dump = function(additionalInfo, additionalKeys) {
|
||||
var id = this.getAttribute("id");
|
||||
var nclass = this.getAttribute("class");
|
||||
|
||||
var str = this.tagName;
|
||||
if (id)
|
||||
str += "; id = " + id;
|
||||
if (nclass)
|
||||
str += "; class = " + nclass;
|
||||
|
||||
if (additionalInfo)
|
||||
str += "; " + additionalInfo;
|
||||
|
||||
if (additionalKeys)
|
||||
for (var i = 0; i < additionalKeys.length; i++) {
|
||||
var value = this.getAttribute(additionalKeys[i]);
|
||||
if (value)
|
||||
str += "; " + additionalKeys[i] + " = " + value;
|
||||
}
|
||||
|
||||
log (str);
|
||||
}
|
||||
|
||||
HTMLElement.prototype.getSelectedNodes = function() {
|
||||
var selArray = new Array();
|
||||
|
||||
for (var i = 0; i < this.childNodes.length; i++) {
|
||||
node = this.childNodes.item(i);
|
||||
if (node.nodeType == 1
|
||||
&& isNodeSelected(node))
|
||||
selArray.push(node);
|
||||
}
|
||||
|
||||
return selArray;
|
||||
}
|
||||
|
||||
HTMLElement.prototype.getSelectedNodesId = function() {
|
||||
var selArray = new Array();
|
||||
|
||||
for (var i = 0; i < this.childNodes.length; i++) {
|
||||
node = this.childNodes.item(i);
|
||||
if (node.nodeType == 1
|
||||
&& isNodeSelected(node))
|
||||
selArray.push(node.getAttribute("id"));
|
||||
}
|
||||
|
||||
return selArray;
|
||||
}
|
||||
|
||||
HTMLElement.prototype.onContextMenu = function(event) {
|
||||
var popup = this.sogoContextMenu;
|
||||
|
||||
if (document.currentPopupMenu)
|
||||
hideMenu(event, document.currentPopupMenu);
|
||||
|
||||
var menuTop = event.pageY;
|
||||
var menuLeft = event.pageX;
|
||||
var heightDiff = (window.innerHeight
|
||||
- (menuTop + popup.offsetHeight));
|
||||
if (heightDiff < 0)
|
||||
menuTop += heightDiff;
|
||||
|
||||
var leftDiff = (window.innerWidth
|
||||
- (menuLeft + popup.offsetWidth));
|
||||
if (leftDiff < 0)
|
||||
menuLeft -= popup.offsetWidth;
|
||||
|
||||
popup.style.top = menuTop + "px;";
|
||||
popup.style.left = menuLeft + "px;";
|
||||
popup.style.visibility = "visible;";
|
||||
|
||||
bodyOnClick = "" + document.body.getAttribute("onclick");
|
||||
document.body.setAttribute("onclick", "onBodyClick(event);");
|
||||
document.currentPopupMenu = popup;
|
||||
}
|
||||
|
||||
HTMLElement.prototype.attachMenu = function(menuName) {
|
||||
this.sogoContextMenu = $(menuName);
|
||||
Event.observe(this, "contextmenu", this.onContextMenu);
|
||||
}
|
||||
|
||||
HTMLElement.prototype.select = function() {
|
||||
this.addClassName('_selected');
|
||||
}
|
||||
|
||||
HTMLElement.prototype.deselect = function() {
|
||||
this.removeClassName('_selected');
|
||||
}
|
||||
|
||||
HTMLElement.prototype.deselectAll = function () {
|
||||
for (var i = 0; i < this.childNodes.length; i++) {
|
||||
var node = this.childNodes.item(i);
|
||||
if (node.nodeType == 1)
|
||||
node.deselect();
|
||||
}
|
||||
}
|
||||
@@ -2,6 +2,15 @@ String.prototype.trim = function() {
|
||||
return this.replace(/(^\s+|\s+$)/g, '');
|
||||
}
|
||||
|
||||
String.prototype.repeat = function(count) {
|
||||
var newString = "";
|
||||
for (var i = 0; i < count; i++) {
|
||||
newString += this;
|
||||
}
|
||||
|
||||
return newString;
|
||||
}
|
||||
|
||||
String.prototype.capitalize = function() {
|
||||
return this.replace(/\w+/g,
|
||||
function(a) {
|
||||
|
||||
@@ -4,6 +4,10 @@ var currentMessages = new Array();
|
||||
var maxCachedMessages = 20;
|
||||
var cachedMessages = new Array();
|
||||
var currentMailbox = '';
|
||||
|
||||
var usersRightsWindowHeight = 320;
|
||||
var usersRightsWindowWidth = 400;
|
||||
|
||||
/* mail list */
|
||||
|
||||
function openMessageWindow(msguid, url) {
|
||||
@@ -113,6 +117,14 @@ function openAddressbook(sender) {
|
||||
return false;
|
||||
}
|
||||
|
||||
function onMenuSharing(event) {
|
||||
var folderID = document.menuTarget.getAttribute("dataname");
|
||||
var urlstr = URLForFolderID(folderID) + "/acls";
|
||||
event.preventDefault();
|
||||
|
||||
openAclWindow(urlstr);
|
||||
}
|
||||
|
||||
/* mail list DOM changes */
|
||||
|
||||
function markMailInWindow(win, msguid, markread) {
|
||||
@@ -1059,13 +1071,14 @@ function initializeMenus() {
|
||||
"messageContentMenu", "label-menu",
|
||||
"mark-menu");
|
||||
menus["accountIconMenu"] = new Array(null, null, null, null, null, null,
|
||||
null, null, null, null);
|
||||
null, null, null, onMenuSharing);
|
||||
menus["inboxIconMenu"] = new Array(null, null, null, "-", null, null,
|
||||
null, "-", null, null);
|
||||
null, "-", null, onMenuSharing);
|
||||
menus["trashIconMenu"] = new Array(null, null, null, "-", null, null, null,
|
||||
null, "-", null, null);
|
||||
null, "-", null, onMenuSharing);
|
||||
menus["mailboxIconMenu"] = new Array(null, null, null, "-", null, null,
|
||||
null, null, null, "-", null, null);
|
||||
null, null, null, "-", null,
|
||||
onMenuSharing);
|
||||
menus["addressMenu"] = new Array(newContactFromEmail, newEmailTo, null);
|
||||
menus["messageListMenu"] = new Array(onMenuOpenMessage, "-",
|
||||
onMenuReplyToSender,
|
||||
|
||||
@@ -23,28 +23,36 @@ var usersRightsWindowHeight = 250;
|
||||
var usersRightsWindowWidth = 502;
|
||||
|
||||
function newEvent(sender, type) {
|
||||
var day = sender.getAttribute("day");
|
||||
if (!day)
|
||||
day = currentDay;
|
||||
var day = sender.getAttribute("day");
|
||||
if (!day)
|
||||
day = currentDay;
|
||||
|
||||
var user = UserLogin;
|
||||
if (sender.parentNode.getAttribute("id") != "toolbar"
|
||||
&& currentView == "multicolumndayview" && type == "event")
|
||||
user = sender.parentNode.parentNode.getAttribute("user");
|
||||
var user = UserLogin;
|
||||
if (sender.parentNode.getAttribute("id") != "toolbar"
|
||||
&& currentView == "multicolumndayview" && type == "event")
|
||||
user = sender.parentNode.parentNode.getAttribute("user");
|
||||
|
||||
var hour = sender.getAttribute("hour");
|
||||
var urlstr = UserFolderURL + "../" + user + "/Calendar/new" + type;
|
||||
var params = new Array();
|
||||
if (day)
|
||||
params.push("day=" + day);
|
||||
if (hour)
|
||||
params.push("hm=" + hour);
|
||||
if (params.length > 0)
|
||||
urlstr += "?" + params.join("&");
|
||||
var hour = sender.getAttribute("hour");
|
||||
var urlstr = UserFolderURL + "../" + user + "/Calendar/new" + type;
|
||||
var params = new Array();
|
||||
if (day)
|
||||
params.push("day=" + day);
|
||||
if (hour)
|
||||
params.push("hm=" + hour);
|
||||
if (params.length > 0)
|
||||
urlstr += "?" + params.join("&");
|
||||
|
||||
window.open(urlstr, "", "width=490,height=470,resizable=0");
|
||||
|
||||
return false; /* stop following the link */
|
||||
}
|
||||
|
||||
window.open(urlstr, "", "width=490,height=470,resizable=0");
|
||||
function onMenuNewEventClick(event) {
|
||||
newEvent(this, "event");
|
||||
}
|
||||
|
||||
return false; /* stop following the link */
|
||||
function onMenuNewTaskClick(event) {
|
||||
newEvent(this, "task");
|
||||
}
|
||||
|
||||
function _editEventId(id, owner) {
|
||||
@@ -549,7 +557,7 @@ function onAppointmentContextMenu(event, element) {
|
||||
var menu = $("appointmentsListMenu");
|
||||
|
||||
Event.observe(menu, "hideMenu", onAppointmentContextMenuHide);
|
||||
onMenuClick(event, "appointmentsListMenu");
|
||||
popupMenu(event, "appointmentsListMenu", element);
|
||||
|
||||
var topNode = $("appointmentsList");
|
||||
var selectedNodes = topNode.getSelectedRows();
|
||||
@@ -714,22 +722,20 @@ function popupMonthMenu(event, menuId) {
|
||||
}
|
||||
}
|
||||
|
||||
function onMonthMenuItemClick(node) {
|
||||
var month = '' + node.getAttribute("month");
|
||||
function onMonthMenuItemClick(event) {
|
||||
var month = '' + this.getAttribute("month");
|
||||
var year = '' + $("yearLabel").innerHTML;
|
||||
|
||||
changeDateSelectorDisplay(year+month+"01", true);
|
||||
|
||||
return false;
|
||||
changeDateSelectorDisplay(year + month + "01", true);
|
||||
|
||||
// event.cancelBubble();
|
||||
}
|
||||
|
||||
function onYearMenuItemClick(node) {
|
||||
function onYearMenuItemClick(event) {
|
||||
var month = '' + $("monthLabel").getAttribute("month");;
|
||||
var year = '' + node.innerHTML;
|
||||
var year = '' + this.innerHTML;
|
||||
|
||||
changeDateSelectorDisplay(year+month+"01", true);
|
||||
|
||||
return false;
|
||||
changeDateSelectorDisplay(year + month + "01", true);
|
||||
}
|
||||
|
||||
function onSearchFormSubmit() {
|
||||
@@ -977,22 +983,46 @@ function browseURL(anchor, event) {
|
||||
}
|
||||
|
||||
function initializeMenus() {
|
||||
var menus = new Array("monthListMenu", "yearListMenu",
|
||||
"appointmentsListMenu", "calendarsMenu", "searchMenu");
|
||||
menus["menuIds"] = new Array("monthListMenu", "yearListMenu",
|
||||
"appointmentsListMenu",
|
||||
"calendarsMenu",
|
||||
"searchMenu");
|
||||
var dateMenu = new Array();
|
||||
for (var i = 0; i < 12; i++)
|
||||
dateMenu.push(onMonthMenuItemClick);
|
||||
menus["monthListMenu"] = dateMenu;
|
||||
|
||||
$("calendarSelector").attachMenu("calendarsMenu");
|
||||
dateMenu = new Array();
|
||||
for (var i = 0; i < 11; i++)
|
||||
dateMenu.push(onYearMenuItemClick);
|
||||
menus["yearListMenu"] = dateMenu;
|
||||
|
||||
var accessRightsMenuEntry = $("accessRightsMenuEntry");
|
||||
Event.observe(accessRightsMenuEntry, "mouseup", onAccessRightsMenuEntryMouseUp);
|
||||
menus["appointmentsListMenu"] = new Array(onMenuNewEventClick, "-",
|
||||
onMenuNewTaskClick,
|
||||
editEvent, deleteEvent, "-",
|
||||
onSelectAll, "-",
|
||||
null, null);
|
||||
menus["calendarsMenu"] = new Array(null, null, "-", null, null, "-",
|
||||
null, "-", onMenuSharing);
|
||||
menus["searchMenu"] = new Array(setSearchCriteria);
|
||||
|
||||
initMenus();
|
||||
var selector = $("calendarSelector");
|
||||
if (selector)
|
||||
selector.attachMenu("calendarsMenu");
|
||||
}
|
||||
|
||||
function onAccessRightsMenuEntryMouseUp(event) {
|
||||
function onMenuSharing(event) {
|
||||
var folders = $("calendarList");
|
||||
var selected = folders.getSelectedNodes()[0];
|
||||
var folderID = selected.getAttribute("id");
|
||||
var urlstr = URLForFolderID(folderID) + "/acls";
|
||||
/* FIXME: activation of the context menu should preferable select the entry
|
||||
above which the event has occured */
|
||||
if (selected) {
|
||||
var folderID = selected.getAttribute("id");
|
||||
var urlstr = URLForFolderID(folderID) + "/acls";
|
||||
|
||||
openAclWindow(urlstr);
|
||||
openAclWindow(urlstr);
|
||||
}
|
||||
}
|
||||
|
||||
function configureDragHandles() {
|
||||
|
||||
@@ -119,15 +119,20 @@ function onOpenUserRights(event) {
|
||||
|
||||
function onAclLoadHandler() {
|
||||
defaultUserID = $("defaultUserID").value;
|
||||
Event.observe($("defaultRolesBtn"), "click", openRightsForDefaultUser);
|
||||
var defaultRolesBtn = $("defaultRolesBtn");
|
||||
if (defaultRolesBtn)
|
||||
Event.observe(defaultRolesBtn, "click", openRightsForDefaultUser);
|
||||
var ul = $("userList");
|
||||
var lis = ul.childNodesWithTag("li");
|
||||
for (var i = 0; i < lis.length; i++)
|
||||
setEventsOnUserNode(lis[i]);
|
||||
|
||||
var buttons = $("userSelectorButtons").childNodesWithTag("a");
|
||||
Event.observe(buttons[0], "click", onUserAdd);
|
||||
Event.observe(buttons[1], "click", onUserRemove);
|
||||
var buttonArea = $("userSelectorButtons");
|
||||
if (buttonArea) {
|
||||
var buttons = buttonArea.childNodesWithTag("a");
|
||||
Event.observe(buttons[0], "click", onUserAdd);
|
||||
Event.observe(buttons[1], "click", onUserRemove);
|
||||
}
|
||||
|
||||
this.userRightsHeight = window.opener.getUsersRightsWindowHeight();
|
||||
this.userRightsWidth = window.opener.getUsersRightsWindowWidth();
|
||||
|
||||
@@ -0,0 +1,49 @@
|
||||
DIV.title
|
||||
{ color: #000;
|
||||
vertical-align: bottom;
|
||||
padding-top: 15px;
|
||||
padding-left: 1em;
|
||||
height: 33px;
|
||||
background-color: #fff;
|
||||
border-bottom: 1px solid #555; }
|
||||
|
||||
DIV.title SPAN.value
|
||||
{ margin-left: 1em;
|
||||
font-size: 18px;
|
||||
font-weight: bold; }
|
||||
|
||||
DIV.calendarUserRights
|
||||
{ margin: 1em;}
|
||||
|
||||
DIV.calendarUserRights > TABLE
|
||||
{ background-color: #fff;
|
||||
width: 45em;
|
||||
color: #999;
|
||||
border-collapse: collapse;
|
||||
border-bottom: 1px solid #fff;
|
||||
border-right: 1px solid #fff;
|
||||
border-top: 2px solid #222;
|
||||
border-left: 2px solid #222;
|
||||
-moz-border-top-colors: #9c9a94 #000 transparent;
|
||||
-moz-border-left-colors: #9c9a94 #000 transparent; }
|
||||
|
||||
DIV.calendarUserRights > TABLE TR.permissions TH
|
||||
{ color: #00f;
|
||||
/* background-color: #ddd;
|
||||
*/ border-bottom: 1px solid #999; }
|
||||
|
||||
DIV.calendarUserRights > TABLE TH
|
||||
{ width: 15em; }
|
||||
|
||||
DIV.calendarUserRights > TABLE TD.eventType
|
||||
{ width: 5em;
|
||||
text-align: right;
|
||||
border-right: 1px solid #999; }
|
||||
|
||||
DIV.calendarUserRights > TABLE TD
|
||||
{ text-align: center;
|
||||
border-top: 1px solid #cecbff; }
|
||||
|
||||
DIV.buttons
|
||||
{ text-align: right;
|
||||
margin: 1em; }
|
||||
@@ -0,0 +1,9 @@
|
||||
function onCancelClick(event) {
|
||||
window.close();
|
||||
}
|
||||
|
||||
function initACLButtons() {
|
||||
$("cancelButton").addEventListener("click", onCancelClick, false);
|
||||
}
|
||||
|
||||
window.addEventListener("load", initACLButtons, false);
|
||||
@@ -218,8 +218,6 @@ DIV#toolbar
|
||||
white-space: nowrap;
|
||||
overflow: auto; }
|
||||
|
||||
BODY.popup { min-width: 400px; }
|
||||
|
||||
BODY.popup DIV#toolbar
|
||||
{ border-top: 0px; }
|
||||
|
||||
|
||||
@@ -573,8 +573,14 @@ function log(message) {
|
||||
logWindow = logWindow.opener;
|
||||
}
|
||||
var logConsole = logWindow.document.getElementById("logConsole");
|
||||
if (logConsole)
|
||||
logConsole.innerHTML += message.replace("<", "<", "g") + '<br />' + "\n";
|
||||
if (logConsole) {
|
||||
var logMessage = message.replace("<", "<", "g");
|
||||
logMessage = logMessage.replace("\r\n", "<br />\n", "g");
|
||||
logMessage = logMessage.replace("\n", "<br />\n", "g");
|
||||
logMessage = logMessage.replace(" ", " ", "g");
|
||||
logMessage += '<br />' + "\n";
|
||||
logConsole.innerHTML += logMessage;
|
||||
}
|
||||
}
|
||||
|
||||
function backtrace() {
|
||||
@@ -684,10 +690,9 @@ function popupSearchMenu(event) {
|
||||
function setSearchCriteria(event) {
|
||||
searchValue = $("searchValue");
|
||||
searchCriteria = $("searchCriteria");
|
||||
|
||||
var node = event.target;
|
||||
searchValue.setAttribute("ghost-phrase", node.innerHTML);
|
||||
searchCriteria = node.getAttribute('id');
|
||||
|
||||
searchValue.setAttribute("ghost-phrase", this.innerHTML);
|
||||
// searchCriteria = this.getAttribute('id');
|
||||
}
|
||||
|
||||
function checkSearchValue(event) {
|
||||
@@ -910,7 +915,8 @@ function initMenus() {
|
||||
var menuId = menus["menuIds"][i];
|
||||
var callbacks = menus[menuId];
|
||||
var menuDIV = $(menuId);
|
||||
initMenu(menuDIV, callbacks);
|
||||
if (menuDIV)
|
||||
initMenu(menuDIV, callbacks);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1077,11 +1083,11 @@ function indexColor(number) {
|
||||
|
||||
var onLoadHandler = function (event) {
|
||||
queryParameters = parseQueryParameters('' + window.location);
|
||||
if (!$(document.body).hasClassName("popup")) {
|
||||
if (!document.body.hasClassName("popup")) {
|
||||
initLogConsole();
|
||||
initializeMenus();
|
||||
initCriteria();
|
||||
}
|
||||
initializeMenus();
|
||||
initTabs();
|
||||
configureDragHandles();
|
||||
configureSortableTableHeaders();
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 54 B |
Reference in new issue
Block a user