We can now show links to the address book

This commit is contained in:
Ludovic Marcotte
2014-11-25 09:36:24 -05:00
parent 8842e6f4cf
commit 25fc08a38d
5 changed files with 96 additions and 9 deletions
+8 -1
View File
@@ -1,6 +1,6 @@
/* UIxContactFoldersView.m - this file is part of SOGo /* UIxContactFoldersView.m - this file is part of SOGo
* *
* Copyright (C) 2006-2013 Inverse inc. * Copyright (C) 2006-2014 Inverse inc.
* *
* This file is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
@@ -38,6 +38,7 @@
#import <GDLContentStore/GCSFolderManager.h> #import <GDLContentStore/GCSFolderManager.h>
#import <SOGo/SOGoPermissions.h> #import <SOGo/SOGoPermissions.h>
#import <SOGo/SOGoSystemDefaults.h>
#import <SOGo/SOGoUser.h> #import <SOGo/SOGoUser.h>
#import <SOGo/SOGoUserDefaults.h> #import <SOGo/SOGoUserDefaults.h>
#import <SOGo/SOGoUserManager.h> #import <SOGo/SOGoUserManager.h>
@@ -418,4 +419,10 @@ Class SOGoContactSourceFolderK, SOGoGCSFolderK;
return [super defaultAction]; return [super defaultAction];
} }
- (BOOL) isPublicAccessEnabled
{
// NOTE: This method is the same found in Common/UIxAclEditor.m
return [[SOGoSystemDefaults sharedSystemDefaults] enablePublicAccess];
}
@end @end
+40 -2
View File
@@ -1,6 +1,5 @@
/* /*
Copyright (C) 2006-2012 Inverse inc. Copyright (C) 2006-2014 Inverse inc.
Copyright (C) 2004-2005 SKYRIX Software AG
This file is part of SOGo. This file is part of SOGo.
@@ -24,6 +23,7 @@
#import <SoObjects/SOGo/NSArray+Utilities.h> #import <SoObjects/SOGo/NSArray+Utilities.h>
#import <SoObjects/SOGo/NSDictionary+Utilities.h> #import <SoObjects/SOGo/NSDictionary+Utilities.h>
#import <SoObjects/SOGo/NSString+Utilities.h> #import <SoObjects/SOGo/NSString+Utilities.h>
#import <SoObjects/SOGo/SOGoSystemDefaults.h>
#import <NGObjWeb/NSException+HTTP.h> #import <NGObjWeb/NSException+HTTP.h>
#import <NGObjWeb/WOContext.h> #import <NGObjWeb/WOContext.h>
@@ -179,6 +179,8 @@
data = [NSDictionary dictionaryWithObjectsAndKeys: data = [NSDictionary dictionaryWithObjectsAndKeys:
[[self clientObject] nameInContainer], @"id", [[self clientObject] nameInContainer], @"id",
newContactsList, @"cards", newContactsList, @"cards",
[self cardDavURL], @"cardDavURL",
[self publicCardDavURL], @"publicCardDavURL",
nil]; nil];
result = [self responseWithStatus: 200 result = [self responseWithStatus: 200
@@ -255,4 +257,40 @@
return result; return result;
} }
- (NSString *) cardDavURL
{
NSString *davURL, *baseCardDAVURL;
davURL = @"";
if ([[self clientObject] respondsToSelector: @selector(realDavURL)])
davURL = [[[self clientObject] realDavURL] absoluteString];
if ([davURL hasSuffix: @"/"])
baseCardDAVURL = [davURL substringToIndex: [davURL length] - 1];
else
baseCardDAVURL = davURL;
return [NSString stringWithFormat: @"%@/", baseCardDAVURL];
}
- (NSString *) publicCardDavURL
{
if ([[self clientObject] respondsToSelector: @selector(publicDavURL)] &&
[[SOGoSystemDefaults sharedSystemDefaults] enablePublicAccess])
{
NSString *davURL, *basePublicCardDAVURL;
davURL = [[[self clientObject] publicDavURL] absoluteString];
if ([davURL hasSuffix: @"/"])
basePublicCardDAVURL = [davURL substringToIndex: [davURL length] - 1];
else
basePublicCardDAVURL = davURL;
return [NSString stringWithFormat: @"%@/", basePublicCardDAVURL];
}
return @"";
}
@end /* UIxContactsListActions */ @end /* UIxContactsListActions */
@@ -114,21 +114,21 @@
<div id="addressbookProperties" class="f-dropdown icons-dropdown"> <div id="addressbookProperties" class="f-dropdown icons-dropdown">
<ul class="button-group"> <ul class="button-group">
<li> <li>
<span class="button"><i class="icon-hyperlink"><!-- links --></i></span> <span class="button" data-sg-dropdown-content-toggle="#addressbookLinks"><i class="icon-hyperlink"><!-- links --></i></span>
</li> </li>
<li data-ng-hide="addressbook.isRemote"> <li>
<span class="button" data-ng-click="edit()"><i class="icon-pencil"><!-- rename --></i></span> <span class="button" data-ng-click="edit()"><i class="icon-pencil"><!-- rename --></i></span>
</li> </li>
<li data-ng-show="addressbook.isOwned"> <li data-ng-show="addressbook.isOwned">
<span class="button" data-ng-click="share()"><i class="icon-share"><!-- share --></i></span> <span class="button" data-ng-click="share()"><i class="icon-share"><!-- share --></i></span>
</li> </li>
<li data-ng-hide="addressbook.isRemote"> <li>
<span class="button" data-ng-click="importCards()"><i class="icon-file"><!-- import --></i></span> <span class="button" data-ng-click="importCards()"><i class="icon-file"><!-- import --></i></span>
</li> </li>
<li data-ng-hide="addressbook.isRemote"> <li>
<span class="button" data-ng-click="exportCards()"><i class="icon-ion-ios7-upload-outline"><!-- export --></i></span> <span class="button" data-ng-click="exportCards()"><i class="icon-ion-ios7-upload-outline"><!-- export --></i></span>
</li> </li>
<li data-ng-hide="addressbook.isRemote"> <li>
<span class="button" data-ng-click="confirmDelete(addressbook)"><i class="icon-trash"><!-- delete --></i></span> <span class="button" data-ng-click="confirmDelete(addressbook)"><i class="icon-trash"><!-- delete --></i></span>
</li> </li>
</ul> </ul>
@@ -139,6 +139,22 @@
<li><a class="tiny" data-ui-sref="addressbook.new({addressbookId: addressbook.id, contactType: 'list'})"><var:string label:value="New List"/></a></li> <li><a class="tiny" data-ui-sref="addressbook.new({addressbookId: addressbook.id, contactType: 'list'})"><var:string label:value="New List"/></a></li>
</ul> </ul>
<!-- dropdown menu for addressbook links -->
<div id="addressbookLinks" class="sg-dropdown-content joyride-tip-guide">
<span class="joyride-nub left"><!-- dropdown nub --></span>
<div class="joyride-content-wrapper">
<ul>
<li class="title"><var:string label:value="Links to this Address Book"/></li>
<li class="subtitle"><var:string label:value="CardDAV URL for Authenticated User Access"/></li>
<li class="value">{{addressbook.cardDavURL}}</li>
<var:if condition="isPublicAccessEnabled">
<li class="subtitle"><var:string label:value="CardDAV URL for Public Access"/></li>
<li class="value">{{addressbook.publicCardDavURL}}</li>
</var:if>
</ul>
</div>
</div>
<!-- dropdown menu for subscriptions --> <!-- dropdown menu for subscriptions -->
<div id="folderSubscribe" class="sg-dropdown-content" <div id="folderSubscribe" class="sg-dropdown-content"
data-sg-subscribe="contact" data-sg-subscribe="contact"
@@ -171,7 +187,7 @@
<a class="icon" href="#" <a class="icon" href="#"
data-dropdown-toggle="#addressbookProperties" data-dropdown-toggle="#addressbookProperties"
data-options="align:right" data-options="align:right"
data-ng-show="addressbook.id==folder.id"><i class="icon-cog"><!-- options --></i></a> data-ng-show="currentFolderIsConfigurable(folder)"><i class="icon-cog"><!-- options --></i></a>
</span> </span>
</li> </li>
</ul> </ul>
+3
View File
@@ -139,6 +139,9 @@
} }
}); });
}; };
$scope.currentFolderIsConfigurable = function(folder) {
return ($scope.addressbook.id == folder.id && !folder.isRemote);
};
$scope.edit = function(i) { $scope.edit = function(i) {
if (!$rootScope.addressbook.isRemote) { if (!$rootScope.addressbook.isRemote) {
if (angular.isUndefined(i)) { if (angular.isUndefined(i)) {
@@ -477,6 +477,29 @@ $column-gutter: 0;
width: 350px; width: 350px;
} }
#addressbookLinks {
background-color: #fff;
width: 450px;
height: 135px;
cursor: none;
.title {
background-color: $secondary-color;
padding: $f-dropdown-list-padding;
text-transform: uppercase;
}
.subtitle {
background-color: #6F5A73;
padding: $f-dropdown-list-padding;
}
.value {
color: #000;
font-weight: bold;
}
}
.buttonsToolbar { .buttonsToolbar {
text-align: right; text-align: right;
.button { .button {