From 278f788be772f3249c444bcd47ebe3b050369a28 Mon Sep 17 00:00:00 2001 From: Wolfgang Sourdeau Date: Wed, 20 Jan 2010 16:28:56 +0000 Subject: [PATCH] Monotone-Parent: aac9836bd4e13254359c01d70b0151a7f9045aff Monotone-Revision: 055c6c35ac3904cb01f393842e5fef9041d23588 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2010-01-20T16:28:56 Monotone-Branch: ca.inverse.sogo --- ChangeLog | 9 +++++++++ UI/Common/UIxAclEditor.m | 6 ++++++ UI/Templates/UIxAclEditor.wox | 22 ++++++++++++++++----- UI/WebServerResources/UIxAclEditor.css | 7 ++++--- UI/WebServerResources/UIxAclEditor.js | 27 +++++++++----------------- 5 files changed, 45 insertions(+), 26 deletions(-) diff --git a/ChangeLog b/ChangeLog index 2635f4b7c..b2ed36b5a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,14 @@ 2010-01-20 Wolfgang Sourdeau + * UI/WebServerResources/UIxAclEditor.js (saveAcls): removed + method. + (nodeForUser): don't add a checkbox if "canSubscribeUsers" is + false. + + * UI/Common/UIxAclEditor.m (-canSubscribeUsers): new accessor that + returns whether the clientObject has the required method to + subscribe users. + * UI/PreferencesUI/UIxPreferences.m (-itemTimeFormatTexts): the default time format is not taken from the domain defaults rather than the user locale. diff --git a/UI/Common/UIxAclEditor.m b/UI/Common/UIxAclEditor.m index 786ca17d8..c9684bdde 100644 --- a/UI/Common/UIxAclEditor.m +++ b/UI/Common/UIxAclEditor.m @@ -159,6 +159,12 @@ return [self _displayNameForUID: currentUser]; } +- (BOOL) canSubscribeUsers +{ + return [[self clientObject] + respondsToSelector: @selector (subscribeUser:reallyDo:)]; +} + - (BOOL) currentUserIsSubscribed { SOGoGCSFolder *folder; diff --git a/UI/Templates/UIxAclEditor.wox b/UI/Templates/UIxAclEditor.wox index 6e3a9d8af..300df5598 100644 --- a/UI/Templates/UIxAclEditor.wox +++ b/UI/Templates/UIxAclEditor.wox @@ -11,6 +11,15 @@ const:toolbar="SOGoAclOwner.toolbar" const:popup="YES"> + +
@@ -39,12 +48,15 @@ >
  • +
  • + var:checked="currentUserIsSubscribed" + var:disabled="currentUserIsSubscribed" + /> +
    diff --git a/UI/WebServerResources/UIxAclEditor.css b/UI/WebServerResources/UIxAclEditor.css index 1f941ea66..39aae7d61 100644 --- a/UI/WebServerResources/UIxAclEditor.css +++ b/UI/WebServerResources/UIxAclEditor.css @@ -59,14 +59,15 @@ UL#userList UL#userList LI { clear: both; cursor: pointer; + height: 2em; text-align: right; padding-left: 3px; } -SPAN.userFullName -{ float: left; } - DIV#userSelectorButtons A.smallToolbarButton { float: left; } +SPAN.userFullName +{ float: left; } + LABEL.subscriptionArea { padding-right: 5px; } diff --git a/UI/WebServerResources/UIxAclEditor.js b/UI/WebServerResources/UIxAclEditor.js index 58a4ffc7b..fe13aceaf 100644 --- a/UI/WebServerResources/UIxAclEditor.js +++ b/UI/WebServerResources/UIxAclEditor.js @@ -68,30 +68,21 @@ function nodeForUser(userName, userId) { span.appendChild(document.createTextNode(" " + userName)); node.appendChild(span); - var label = $(document.createElement("label")); - label.addClassName("class", "subscriptionArea"); - var cb = document.createElement("input"); - cb.type = "checkbox"; - label.appendChild(cb); - label.appendChild(document.createTextNode(getLabel("Subscribe User"))); - node.appendChild(label); + if (canSubscribeUsers) { + var label = $(document.createElement("label")); + label.addClassName("subscriptionArea"); + var cb = document.createElement("input"); + cb.type = "checkbox"; + label.appendChild(cb); + label.appendChild(document.createTextNode(getLabel("Subscribe User"))); + node.appendChild(label); + } setEventsOnUserNode(node); return node; } -function saveAcls() { - var uidList = new Array(); - var users = $("userList").childNodesWithTag("li"); - for (var i = 0; i < users.length; i++) - uidList.push(users[i].getAttribute("id")); - $("userUIDS").value = uidList.join(","); - $("aclForm").submit(); - - return false; -} - function onUserAdd(event) { openUserFolderSelector(null, "user");