mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-03-10 09:21:23 +00:00
We can now show links to the address book
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
/* 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
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -38,6 +38,7 @@
|
||||
#import <GDLContentStore/GCSFolderManager.h>
|
||||
|
||||
#import <SOGo/SOGoPermissions.h>
|
||||
#import <SOGo/SOGoSystemDefaults.h>
|
||||
#import <SOGo/SOGoUser.h>
|
||||
#import <SOGo/SOGoUserDefaults.h>
|
||||
#import <SOGo/SOGoUserManager.h>
|
||||
@@ -418,4 +419,10 @@ Class SOGoContactSourceFolderK, SOGoGCSFolderK;
|
||||
return [super defaultAction];
|
||||
}
|
||||
|
||||
- (BOOL) isPublicAccessEnabled
|
||||
{
|
||||
// NOTE: This method is the same found in Common/UIxAclEditor.m
|
||||
return [[SOGoSystemDefaults sharedSystemDefaults] enablePublicAccess];
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
/*
|
||||
Copyright (C) 2006-2012 Inverse inc.
|
||||
Copyright (C) 2004-2005 SKYRIX Software AG
|
||||
Copyright (C) 2006-2014 Inverse inc.
|
||||
|
||||
This file is part of SOGo.
|
||||
|
||||
@@ -24,6 +23,7 @@
|
||||
#import <SoObjects/SOGo/NSArray+Utilities.h>
|
||||
#import <SoObjects/SOGo/NSDictionary+Utilities.h>
|
||||
#import <SoObjects/SOGo/NSString+Utilities.h>
|
||||
#import <SoObjects/SOGo/SOGoSystemDefaults.h>
|
||||
|
||||
#import <NGObjWeb/NSException+HTTP.h>
|
||||
#import <NGObjWeb/WOContext.h>
|
||||
@@ -179,6 +179,8 @@
|
||||
data = [NSDictionary dictionaryWithObjectsAndKeys:
|
||||
[[self clientObject] nameInContainer], @"id",
|
||||
newContactsList, @"cards",
|
||||
[self cardDavURL], @"cardDavURL",
|
||||
[self publicCardDavURL], @"publicCardDavURL",
|
||||
nil];
|
||||
|
||||
result = [self responseWithStatus: 200
|
||||
@@ -255,4 +257,40 @@
|
||||
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 */
|
||||
|
||||
@@ -114,21 +114,21 @@
|
||||
<div id="addressbookProperties" class="f-dropdown icons-dropdown">
|
||||
<ul class="button-group">
|
||||
<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 data-ng-hide="addressbook.isRemote">
|
||||
<li>
|
||||
<span class="button" data-ng-click="edit()"><i class="icon-pencil"><!-- rename --></i></span>
|
||||
</li>
|
||||
<li data-ng-show="addressbook.isOwned">
|
||||
<span class="button" data-ng-click="share()"><i class="icon-share"><!-- share --></i></span>
|
||||
</li>
|
||||
<li data-ng-hide="addressbook.isRemote">
|
||||
<li>
|
||||
<span class="button" data-ng-click="importCards()"><i class="icon-file"><!-- import --></i></span>
|
||||
</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>
|
||||
</li>
|
||||
<li data-ng-hide="addressbook.isRemote">
|
||||
<li>
|
||||
<span class="button" data-ng-click="confirmDelete(addressbook)"><i class="icon-trash"><!-- delete --></i></span>
|
||||
</li>
|
||||
</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>
|
||||
</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 -->
|
||||
<div id="folderSubscribe" class="sg-dropdown-content"
|
||||
data-sg-subscribe="contact"
|
||||
@@ -171,7 +187,7 @@
|
||||
<a class="icon" href="#"
|
||||
data-dropdown-toggle="#addressbookProperties"
|
||||
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>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
@@ -139,6 +139,9 @@
|
||||
}
|
||||
});
|
||||
};
|
||||
$scope.currentFolderIsConfigurable = function(folder) {
|
||||
return ($scope.addressbook.id == folder.id && !folder.isRemote);
|
||||
};
|
||||
$scope.edit = function(i) {
|
||||
if (!$rootScope.addressbook.isRemote) {
|
||||
if (angular.isUndefined(i)) {
|
||||
|
||||
@@ -477,6 +477,29 @@ $column-gutter: 0;
|
||||
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 {
|
||||
text-align: right;
|
||||
.button {
|
||||
|
||||
Reference in New Issue
Block a user