mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-08-28 17:57:38 +00:00
See ChangeLog.
Monotone-Parent: f6c6bfab15922450127ccb9597bbc97468d695c0 Monotone-Revision: afd67b085b60bc29f1319198a1796a532db22ebf Monotone-Author: flachapelle@inverse.ca Monotone-Date: 2011-10-21T20:12:38 Monotone-Branch: ca.inverse.sogo
This commit is contained in:
@@ -51,9 +51,13 @@ UL#userList LI
|
||||
background-repeat: no-repeat;
|
||||
background-position: 4px center; }
|
||||
|
||||
UL#userList LI.normal-user
|
||||
UL#userList LI.normal-user,
|
||||
UL#userList LI.normal-person
|
||||
{ background-image: url("abcard.png"); }
|
||||
|
||||
UL#userList LI.normal-group
|
||||
{ background-image: url("ablist.png"); }
|
||||
|
||||
UL#userList LI.any-user
|
||||
{ background-image: url("abcard-anyone.png");
|
||||
border-top: 1px dotted #555; }
|
||||
|
||||
@@ -9,18 +9,18 @@ var AclEditor = {
|
||||
|
||||
var usersToSubscribe = [];
|
||||
|
||||
function addUser(userName, userID) {
|
||||
function addUser(userName, userID, type) {
|
||||
var result = false;
|
||||
if (!$(userID)) {
|
||||
var ul = $("userList");
|
||||
var lis = ul.childNodesWithTag("li");
|
||||
var newNode = nodeForUser(userName, userID, canSubscribeUsers);
|
||||
newNode.addClassName("normal-user");
|
||||
newNode.addClassName("normal-" + type);
|
||||
|
||||
var count = lis.length - 1;
|
||||
var nextLi = null;
|
||||
while (count > -1 && !nextLi) {
|
||||
if ($(lis[count]).hasClassName("normal-user")) {
|
||||
if ($(lis[count]).hasClassName("normal-person")) {
|
||||
nextLi = lis[count+1];
|
||||
}
|
||||
else {
|
||||
@@ -142,7 +142,8 @@ function subscribeToFolder(refreshCallback, refreshCallbackData) {
|
||||
var result = true;
|
||||
if (UserLogin != refreshCallbackData["folder"]) {
|
||||
result = addUser(refreshCallbackData["folderName"],
|
||||
refreshCallbackData["folder"]);
|
||||
refreshCallbackData["folder"],
|
||||
refreshCallbackData["type"]);
|
||||
}
|
||||
else
|
||||
refreshCallbackData["window"].alert(_("You cannot subscribe to a folder that you own!"));
|
||||
@@ -223,9 +224,9 @@ function onAclCloseHandler(event) {
|
||||
+ "/subscribeUsers?uids=" + usersToSubscribe.join(","));
|
||||
new Ajax.Request(url, {
|
||||
asynchronous: false,
|
||||
method: 'get',
|
||||
onFailure: function(transport) {
|
||||
log("Can't expunge current folder: " + transport.status);
|
||||
method: 'get',
|
||||
onFailure: function(transport) {
|
||||
log("Can't subscribe users: " + transport.status);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -37,15 +37,26 @@ function usersSearchCallback(http) {
|
||||
}
|
||||
|
||||
function addUserLineToTree(tree, parent, line) {
|
||||
// line[0] = uid
|
||||
// line[1] = cn
|
||||
// line[2] = email
|
||||
// line[3] = 1 if it's a group
|
||||
// line[4] = contact info
|
||||
var icon = ResourcesURL + '/busy.gif';
|
||||
|
||||
var email = line[1] + " <" + line[2] + ">";
|
||||
if (line[3] && !line[3].empty())
|
||||
email += ", " + line[3].split("\n").join("; "); // extra contact info
|
||||
tree.add(parent, 0, email, 0, '#', line[0], 'person',
|
||||
if (line[4] && !line[4].empty())
|
||||
email += ", " + line[4].split("\n").join("; "); // extra contact info
|
||||
var icon_card = 'abcard.png';
|
||||
var datatype = 'person';
|
||||
if (line[3]) {
|
||||
icon_card = 'ablist.png';
|
||||
datatype = 'group';
|
||||
}
|
||||
tree.add(parent, 0, email, 0, '#', line[0], datatype,
|
||||
'', '',
|
||||
ResourcesURL + '/abcard.png',
|
||||
ResourcesURL + '/abcard.png');
|
||||
ResourcesURL + '/' + icon_card,
|
||||
ResourcesURL + '/' + icon_card);
|
||||
if (window.opener.userFolderType != "user") {
|
||||
tree.add(parent + 1, parent, _("Please wait..."), 0, '#', null,
|
||||
null, '', '', icon, icon);
|
||||
@@ -198,6 +209,7 @@ function onConfirmFolderSelection(event) {
|
||||
if (topNode && topNode.selectedEntry) {
|
||||
var node = topNode.selectedEntry.parentNode;
|
||||
var folder = node.getAttribute("dataname");
|
||||
var type = node.getAttribute("datatype");
|
||||
|
||||
var folderName;
|
||||
if (window.opener.userFolderType == "user") {
|
||||
@@ -217,7 +229,7 @@ function onConfirmFolderSelection(event) {
|
||||
folderName = folderName.replace(/>,.*(\))?$/, ">)$1", "g");
|
||||
}
|
||||
|
||||
var data = { folderName: folderName, folder: folder, window: window };
|
||||
var data = { folderName: folderName, folder: folder, type: type, window: window };
|
||||
if (parent$(accessToSubscribedFolder(folder)))
|
||||
window.alert(_("You have already subscribed to that folder!"));
|
||||
else
|
||||
|
||||
@@ -107,6 +107,9 @@ function expandContactListCallback (http) {
|
||||
if (http.status == 200) {
|
||||
var data = http.responseText.evalJSON(true);
|
||||
// TODO: Should check for duplicated entries
|
||||
for (var i = data.length - 1; i >= 0; i--)
|
||||
// Remove contacts with no email address
|
||||
if (data[i][2].length == 0) data.splice(i, 1);
|
||||
if (data.length >= 1) {
|
||||
var text = data[0][2];
|
||||
if (data[0][1].length)
|
||||
|
||||
Reference in New Issue
Block a user