]> err.no Git - scalable-opengroupware.org/commitdiff
git-svn-id: http://svn.opengroupware.org/SOGo/inverse/trunk@1360 d1b88da0-ebda-0310...
authorwolfgang <wolfgang@d1b88da0-ebda-0310-925b-ed51d893ca5b>
Thu, 7 Feb 2008 22:06:27 +0000 (22:06 +0000)
committerwolfgang <wolfgang@d1b88da0-ebda-0310-925b-ed51d893ca5b>
Thu, 7 Feb 2008 22:06:27 +0000 (22:06 +0000)
ChangeLog
SoObjects/SOGo/SOGoUser.m
UI/Templates/ContactsUI/UIxContactsFilterPanel.wox
UI/WebServerResources/UIxContactsUserFolders.js
UI/WebServerResources/generic.css

index 20676529256d217cc27c7e940affb364d7744ab7..001304afead99b335eb6a0415dddeb6c6ec1e2b4 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
 2008-02-07  Wolfgang Sourdeau  <wsourdeau@inverse.ca>
 
+       * SoObjects/SOGo/SOGoUser.m ([SOGoUser -mailAccounts]): if the
+       loginname for the default mail account contains an "@", it should
+       be url-escaped to avoid confusing NSURL.
+
        * SoObjects/SOGo/SOGoUserFolder.m ([-login]): removed useless
        method.
        ([SOGoUserFolder -ownerInContext:_ctx]): compute the owner name
index 81187c6d150d2bce9da372b049a18f7bbc2632c8..a9ec7d78a562846deacf79d3293c4a2d34d973fc 100644 (file)
@@ -454,14 +454,16 @@ NSString *SOGoWeekStartFirstFullWeek = @"FirstFullWeek";
 {
   NSMutableDictionary *mailAccount, *identity;
   NSMutableArray *identities;
-  NSString *name, *fullName;
+  NSString *name, *fullName, *userName;
   NSArray *mails;
   unsigned int count, max;
 
   mailAccount = [NSMutableDictionary dictionary];
+  userName = [[login stringByReplacingString: @"@" withString: @"%40"]
+              stringByEscapingURL];
   name = [NSString stringWithFormat: @"%@@%@",
-                  login, fallbackIMAP4Server];
-  [mailAccount setObject: login forKey: @"userName"];
+                  userName, fallbackIMAP4Server];
+  [mailAccount setObject: userName forKey: @"userName"];
   [mailAccount setObject: fallbackIMAP4Server forKey: @"serverName"];
   [mailAccount setObject: name forKey: @"name"];
 
index 046ae8599c00f40dcd3ae2c55f8e67c1220ceccd..8f771dedab9d5a0a934a8aa1077a18dc4cfc8a5c 100644 (file)
@@ -5,9 +5,6 @@
     xmlns:const="http://www.skyrix.com/od/constant"
     xmlns:label="OGo:label"
     >
-    <span id="toolbar">
-    </span>
-
     <div class="menu" id="searchMenu">
       <ul id="searchOptions" class="choiceMenu">
         <li id="name_or_address"><var:string
index ee22fd26d37997f92f87c7329f99f79a04b99989..5048e1237d87793f769ab46558af419ba1608e8a 100644 (file)
@@ -88,56 +88,61 @@ function onFolderTreeItemClick(event) {
       topNode.selectedEntry.deselect();
    this.selectElement();
    topNode.selectedEntry = this;
+
+   if (window.opener.userFolderType == "user")
+     $("addButton").disabled = false;
+   else {
+     var dataname = this.parentNode.getAttribute("dataname");
+     $("addButton").disabled = (dataname.indexOf(":") == -1);
+   };
 }
 
 function userFoldersCallback(http) {
-   if (http.readyState == 4) {
-      document.userFoldersRequest = null;
-      var div = $("folders");
-      if (http.status == 200) {
-        var response = http.responseText;
-        div.innerHTML = buildTree(http.responseText);
-        div.clean = false;
-        var nodes = document.getElementsByClassName("node", $("d"));
-        for (i = 0; i < nodes.length; i++)
-          Event.observe(nodes[i], "click", onFolderTreeItemClick.bindAsEventListener(nodes[i]));
-      }
-      else if (http.status == 404) {
-        div.innerHTML = "";
-      }
-   }
+  document.userFoldersRequest = null;
+  var div = $("folders");
+  if (http.status == 200) {
+    var response = http.responseText;
+    div.innerHTML = buildTree(http.responseText);
+    div.clean = false;
+    var nodes = document.getElementsByClassName("node", $("d"));
+    for (i = 0; i < nodes.length; i++)
+      $(nodes[i]).observe("click", onFolderTreeItemClick);
+  }
+  else if (http.status == 404)
+    div.innerHTML = "";
 }
 
 function onConfirmFolderSelection(event) {
   var topNode = $("d");
   if (topNode && topNode.selectedEntry) {
-      var node = topNode.selectedEntry.parentNode;
-      var folder = node.getAttribute("dataname");
-      var folderName;
-      if (window.opener.userFolderType == "user") {
-        var spans = document.getElementsByClassName("nodeName",
-                                                    topNode.selectedEntry);
-        var email = spans[0].innerHTML;
-        email = email.replace("&lt;", "<");
-        email = email.replace("&gt;", ">");
-        folderName = email;
-      }
-      else {
-        var spans1 = document.getElementsByClassName("nodeName",
+    var node = topNode.selectedEntry.parentNode;
+    var folder = node.getAttribute("dataname");
+
+    var folderName;
+    if (window.opener.userFolderType == "user") {
+      var spans = document.getElementsByClassName("nodeName",
+                                                 topNode.selectedEntry);
+      var email = spans[0].innerHTML;
+      email = email.replace("&lt;", "<");
+      email = email.replace("&gt;", ">");
+      folderName = email;
+    }
+    else {
+      var spans1 = document.getElementsByClassName("nodeName",
                                                   node);
-        var spans2 = document.getElementsByClassName("nodeName",
-                                                     node.parentNode.previousSibling);
-        var email = spans2[0].innerHTML;
-        email = email.replace("&lt;", "<");
-        email = email.replace("&gt;", ">");
-        folderName = spans1[0].innerHTML + ' (' + email + ')';
-      }
-      var data = { folderName: folderName, folder: folder, window: window };
-      if (parent$(accessToSubscribedFolder(folder)))
-       window.alert(clabels["You have already subscribed to that folder!"]);
-      else
-       window.opener.subscribeToFolder(window.opener.userFolderCallback, data);
-   }
+      var spans2 = document.getElementsByClassName("nodeName",
+                                                  node.parentNode.previousSibling);
+      var email = spans2[0].innerHTML;
+      email = email.replace("&lt;", "<");
+      email = email.replace("&gt;", ">");
+      folderName = spans1[0].innerHTML + ' (' + email + ')';
+    }
+    var data = { folderName: folderName, folder: folder, window: window };
+    if (parent$(accessToSubscribedFolder(folder)))
+      window.alert(clabels["You have already subscribed to that folder!"]);
+    else
+      window.opener.subscribeToFolder(window.opener.userFolderCallback, data);
+  }
 }
 
 function onFolderSearchKeyDown(event) {
@@ -150,7 +155,9 @@ function onFolderSearchKeyDown(event) {
 
 function initUserFoldersWindow() {
   $("searchValue").observe("keydown", onFolderSearchKeyDown);
-  $("addButton").observe("click",  onConfirmFolderSelection);
+  var addButton = $("addButton");
+  addButton.observe("click", onConfirmFolderSelection);
+  addButton.disabled = true;
 }
 
 FastInit.addOnLoad(initUserFoldersWindow);
index 0200a3222499b0181097dbdc62e718b1eff444fd..05b62c6b903d2d3c8b8d0b14cc6181c9a0eb46e0 100644 (file)
@@ -585,6 +585,7 @@ A.button:active
   -moz-border-left-colors: #9c9a94 #000; }
 
 INPUT.button,
+INPUT.button:disabled,
 A.button,
 A[class~="_disabled"].button:active
 { cursor: default;
@@ -601,6 +602,9 @@ A[class~="_disabled"].button:active
   text-decoration: none;
   color: inherit; }
 
+INPUT.button:disabled
+{ color: #999; }
+
 A.button
 { padding: 4px; }