]> err.no Git - scalable-opengroupware.org/commitdiff
git-svn-id: http://svn.opengroupware.org/SOGo/inverse/trunk@1196 d1b88da0-ebda-0310...
authorwolfgang <wolfgang@d1b88da0-ebda-0310-925b-ed51d893ca5b>
Wed, 24 Oct 2007 17:12:23 +0000 (17:12 +0000)
committerwolfgang <wolfgang@d1b88da0-ebda-0310-925b-ed51d893ca5b>
Wed, 24 Oct 2007 17:12:23 +0000 (17:12 +0000)
15 files changed:
ChangeLog
SOPE/sope-gdl1/GDLContentStore/ChangeLog
SOPE/sope-gdl1/GDLContentStore/GCSFolderManager.m
SoObjects/SOGo/NSArray+Utilities.m
SoObjects/SOGo/NSDictionary+Utilities.m
SoObjects/SOGo/SOGoUser.m
UI/Scheduler/English.lproj/Localizable.strings
UI/Scheduler/French.lproj/Localizable.strings
UI/Scheduler/German.lproj/Localizable.strings
UI/Scheduler/UIxCalendarSelector.m
UI/Scheduler/UIxComponentEditor.m
UI/Templates/SchedulerUI/UIxCalendarSelector.wox
UI/WebServerResources/MailerUI.js
UI/WebServerResources/SchedulerUI.css
UI/WebServerResources/SchedulerUI.js

index e0077923389acba69f11c9e61a0b51015e256804..9cc24ef9fe81f6b5127a17e7beb9c347a7ce488d 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,13 @@
 2007-10-23  Wolfgang Sourdeau  <wsourdeau@inverse.ca>
 
+       * SoObjects/SOGo/NSArray+Utilities.m
+       ([NSArray -stringsWithFormat:format]): replace instances of NSNull
+       with empty strings.
+
+       * SoObjects/SOGo/NSDictionary+Utilities.m ([NSDictionary
+       -keysWithFormat:keyFormat]): replace instances of NSNull with
+       empty strings.
+
        * SoObjects/Contacts/SOGoContactLDAPFolder.m: if "displayName" is
        empty, use "c_cn" instead.
 
index 888196051742e9cfd4b115acfb11c597013547e4..dae4f0dc59d2afe657e2bff92f73c4e8227f36c5 100644 (file)
@@ -1,3 +1,9 @@
+2007-10-24  Wolfgang Sourdeau  <wsourdeau@inverse.ca>
+
+       * GCSFolderManager.m ([GCSFolderManager -baseTableNameWithUID:]):
+       prefix the table names with "sogo" to avoid problems with
+       digits-only identifiers.
+
 2007-10-19  Wolfgang Sourdeau  <wsourdeau@inverse.ca>
 
        * GCSFolderManager.m ([GCSFolderManager -baseTableNameWithUID:]):
index bee84b5d11a64bc5d7dc92910fa91aa88bd3bc9d..b664d54ed9e63bd1915eecb608877b0f0775e96c 100644 (file)
@@ -624,7 +624,7 @@ static NSCharacterSet *asciiAlphaNumericCS  = nil;
   unsigned int count, max, done;
   NSMutableString *newUID;
 
-  newUID = [NSMutableString string];
+  newUID = [NSMutableString stringWithString: @"sogo"];
   now = [NSDate date];
 
   max = [_uid length];
index 4845b33df7040f3bf0f97082e4d1a8e616edfd11..3f5a78b5ae4203772ccfa0f4787f93c4281f1114 100644 (file)
@@ -20,6 +20,7 @@
  * Boston, MA 02111-1307, USA.
  */
 
+#import <Foundation/NSNull.h>
 #import <Foundation/NSString.h>
 
 #import "NSArray+Utilities.h"
   currentObject = [objects nextObject];
   while (currentObject)
     {
-      [formattedStrings
-        addObject: [NSString stringWithFormat: format, currentObject]];
+      if ([currentObject isKindOfClass: [NSNull class]])
+       [formattedStrings addObject: @""];
+      else
+       [formattedStrings
+         addObject: [NSString stringWithFormat: format, currentObject]];
       currentObject = [objects nextObject];
     }
 
index 666aef023a77ecdd9dfa713daa51f0280956b3a1..485b9dfb21b417d49fc033d297fdf28439d90c11 100644 (file)
@@ -22,6 +22,7 @@
 
 #import <Foundation/NSArray.h>
 #import <Foundation/NSData.h>
+#import <Foundation/NSNull.h>
 #import <Foundation/NSString.h>
 
 #import "NSArray+Utilities.h"
   for (count = 0; count < max; count++)
     {
       value = [self objectForKey: [allKeys objectAtIndex: count]];
-      [keysWithFormat replaceString: [keys objectAtIndex: count]
-                     withString: [value description]];
+      if ([value isKindOfClass: [NSNull class]])
+       [keysWithFormat replaceString: [keys objectAtIndex: count]
+                       withString: @""];
+      else
+       [keysWithFormat replaceString: [keys objectAtIndex: count]
+                       withString: [value description]];
     }
 
   return keysWithFormat;
index 2354d868fff9e66bb46196e192f25d710bae0d26..5ea1146c648f77056530bf68f357fbb386d190cc 100644 (file)
@@ -336,9 +336,6 @@ NSString *SOGoWeekStartFirstFullWeek = @"FirstFullWeek";
 
 - (NSString *) language
 {
-  NSArray *bLanguages;
-  WOContext *context;
-
   if (!language)
     {
       language = [[self userDefaults] stringForKey: @"Language"];
index 69afbd28c34cf98ac7c99e69d69b46091b64d6fe..0ce7d868f7ee4c7b054a4728eb353c1048e77a15 100644 (file)
@@ -379,8 +379,8 @@ validate_endbeforestart    = "Enddate is before startdate!";
 "eventDeleteConfirmation" = "Erasing this event will be permanent.\\nWould you like to continue?";
 "taskDeleteConfirmation" = "Erasing this task will be permanent.\\nWould you like to continue?";
 
-"Are you sure you want to delete the selected calendar?"
-= "Are you sure you want to delete the selected calendar?";
+"Are you sure you want to delete the calendar \"%{0}\"?"
+= "Are you sure you want to delete the calendar \"%{0}\"?";
 
 /* Legend */
 "Required participant" = "Required participant";
index 3adda5cff614631cefabbdc11f49a4d64b6c8849..1c69351f332dfb4a1a5fb8cbe61d8b45eb9355bb 100644 (file)
@@ -377,8 +377,8 @@ validate_endbeforestart    = "La date de fin est avant la date de début !";
 "eventDeleteConfirmation" = "L'effacement de cet événement sera permanent.\\nVoulez-vous continuer?";
 "taskDeleteConfirmation" = "L'effacement de cette tâche sera permanent.\\nVoulez-vous continuer?";
 
-"Are you sure you want to delete the selected calendar?"
-= "Voulez-vous vraiment supprimer l'agenda sélectionné ?";
+"Are you sure you want to delete the calendar \"%{0}\"?"
+= "Voulez-vous vraiment supprimer l'agenda «%{0}»?";
 
 /* Legend */
 "Required participant" = "Participant obligatoire";
index 2093ad21d6c313674c58a8a0e40c23a1f300cffa..e3ea85ee5b16f5c83717f4a6447bcfdca25e6ce5 100644 (file)
@@ -366,8 +366,8 @@ validate_endbeforestart    = "Ihr Beginn ist nach dem Ende";
 "eventDeleteConfirmation" = "L'effacement de cet événement sera permanent.\\nVoulez-vous continuer?";
 "taskDeleteConfirmation" = "L'effacement de cette tâche sera permanent.\\nVoulez-vous continuer?";
 
-"Are you sure you want to delete the selected calendar?"
-= "Are you sure you want to delete the selected calendar?";
+"Are you sure you want to delete the calendar \"%{0}\"?"
+= "Are you sure you want to delete the calendar \"%{0}\"?";
 
 /* Legend */
 "Required participant" = "Participant obligatoire";
index 6bee8aad627f0030961b3c4687b55fc68a809f57..7fad6b0f3c9549ff360dbc193e9db6399e56f459 100644 (file)
@@ -148,6 +148,12 @@ colorForNumber (unsigned int number)
   return currentCalendar;
 }
 
+- (NSString *) currentCalendarClass
+{
+  return [currentCalendar
+          keysWithFormat: @"colorBox calendarFolder%{folder}"];
+}
+
 - (NSString *) currentCalendarStyle
 {
   return [currentCalendar
index a972885d656924f12209bcc0c0653f81f83baf70..e62c64127ef8ce5def6034099dcc5384ae8715f2 100644 (file)
 
   calendar = [[self clientObject] container];
   
-  return calendar;
+  return [calendar nameInContainer];
 }
 
 /* priorities */
index 6340a725703722e9229fc5e851556a4ca6497a7a..eac42da1c3b7572d8e8c46d80982580b3c315e13 100644 (file)
@@ -10,6 +10,8 @@
     <var:foreach list="calendars" item="currentCalendar">
 .calendarFolder<var:string value="currentCalendar.folder" />
 { background-color: <var:string value="currentCalendar.color" /> !important; }
+div.colorBox.calendarFolder<var:string value="currentCalendar.folder" />
+{ color: <var:string value="currentCalendar.color" /> !important; }
     </var:foreach>
   </style>
   <div id="calendarSelector">
@@ -34,8 +36,8 @@
          <input type="checkbox" class="checkBox"
            const:disabled="disabled"
            var:checked="currentCalendar.active" />
-         <div class="colorBox" var:style="currentCalendarStyle">OO</div>
-         <var:string value="currentCalendar.displayName"
+         <div var:class="currentCalendarClass">OO</div
+         ><var:string value="currentCalendar.displayName"
            /></li>
       </var:foreach>
     </ul>
index c51a3ecc1bd2b70f8c9577c24b8805574a96a4a1..a2c35ed5514da47ac8428bae028bfaaa4838cb0f 100644 (file)
@@ -16,6 +16,8 @@ var usersRightsWindowWidth = 400;
 
 var pageContent;
 
+var deleteMessageRequestCount = 0;
+
 /* mail list */
 
 function openMessageWindow(msguid, url) {
@@ -203,47 +205,45 @@ function ml_lowlight(sender) {
 
 /* bulk delete of messages */
 
-function uixDeleteSelectedMessages(sender) {
-  var failCount = 0;
-   
+function deleteSelectedMessages(sender) {
   var messageList = $("messageList");
   var rowIds = messageList.getSelectedRowsId();
 
   for (var i = 0; i < rowIds.length; i++) {
     var url, http;
     var rowId = rowIds[i].substr(4);
-    /* send AJAX request (synchronously) */
-
     var messageId = currentMailbox + "/" + rowId;
     url = ApplicationBaseURL + messageId + "/trash";
-    http = createHTTPClient();
-    http.open("POST", url, false /* not async */);
-    http.url = url;
-    http.send("");
-    if (!isHttpStatus204(http.status)) { /* request failed */
-      failCount++;
-      http = null;
-      continue;
-    } else {
-      deleteCachedMessage(messageId);
-      if (currentMessages[currentMailbox] == rowId) {
+    deleteMessageRequestCount++;
+    var data = { "id": rowId, "mailbox": currentMailbox, "messageId": messageId };
+    triggerAjaxRequest(url, deleteSelectedMessagesCallback, data);
+  }
+
+  return false;
+}
+
+function deleteSelectedMessagesCallback(http) {
+  if (http.readyState == 4) {
+    if (isHttpStatus204(http.status)) {
+      var data = http.callbackData;
+      deleteCachedMessage(data["messageId"]);
+      if (currentMailbox == data["mailbox"]) {
+       
        var div = $('messageContent');
-       div.update();
-       currentMessages[currentMailbox] = null;
+       if (currentMessages[currentMailbox] == data["id"]) {
+         div.update();
+         currentMessages[currentMailbox] = null;       
+       }
+
+       var row = $("row_" + data["id"]);
+       row.parentNode.removeChild(row);
+
+       deleteMessageRequestCount--;
       }
     }
-    http = null;
-    
-    /* remove from page */
-    /* line-through would be nicer, but hiding is OK too */
-    var row = $(rowIds[i]);
-    row.parentNode.removeChild(row);
   }
-
-  if (failCount > 0)
-    alert("Could not delete " + failCount + " messages!");
-   
-  return false;
+  else
+    log ("deleteSelectedMessagesCallback: problem during ajax request " + http.status);
 }
 
 function moveMessages(rowIds, folder) {
@@ -285,7 +285,7 @@ function moveMessages(rowIds, folder) {
 }
 
 function onMenuDeleteMessage(event) {
-  uixDeleteSelectedMessages();
+  deleteSelectedMessages();
   preventDefault(event);
 }
 
index 970062ce038b3d86e8a29821430d15083b901dbd..609da77c4bef98cca0682f69423320fed3751b70 100644 (file)
@@ -48,6 +48,7 @@ DIV.colorBox
   border: 1px solid #333;
   font-weight: normal; 
   margin: 0px;
+  margin-right: 3px;
   font-size: 80%;
   width: 1em;
   height: .75em; }
index 99930c3bcfb3483bf9dce16aeb37e68fcddd5fd0..7fd00f8bf419134568349cdb9de26c9c27e745b7 100644 (file)
@@ -1041,7 +1041,7 @@ function onSearchFormSubmit() {
 
 function onCalendarSelectEvent() {
   var list = $("eventsList");
-  list.tBodies[0].deselectAll();
+  $(list.tBodies[0]).deselectAll();
 
   if (selectedCalendarCell)
      for (var i = 0; i < selectedCalendarCell.length; i++)
@@ -1377,7 +1377,7 @@ function onMenuModify(event) {
   if (UserLogin == selected.getAttribute("owner")) {
     var node = selected.childNodes[4];
     var currentName = node.nodeValue.trim();
-    var newName = window.prompt(labels["Address Book Name"],
+    var newName = window.prompt(labels["Name of the Calendar"],
                                currentName);
     if (newName && newName.length > 0
        && newName != currentName) {
@@ -1436,30 +1436,24 @@ function appendCalendar(folderName, folderPath) {
     var li = document.createElement("li");
     
     // Add the calendar to the proper place
-    for (var i = 0; i < lis.length; i++) {
+    var previousOwner = null;
+    for (var i = 1; i < lis.length; i++) {
       var currentFolderName = lis[i].lastChild.nodeValue.strip();
-      if (lis[i].readAttribute('owner') != owner)
-       continue;
-      if (currentFolderName > folderName)
-       break;
-    }
-    if (i != lis.length) { // User is subscribed to other calendars of the same owner
-      calendarList.insertBefore(li, lis[i]);
-    }
-    else {
-      for (var i = 0; i < lis.length; i++) {
-       if (lis[i].readAttribute('owner') == UserLogin)
-         continue;
-       if (lis[i].readAttribute('owner') > owner) {
-         calendarList.insertBefore(li, lis[i]);
+      var currentOwner = lis[i].readAttribute('owner');
+      if (currentOwner == owner) {
+       previousOwner = currentOwner;
+       if (currentFolderName > folderName)
          break;
-       }
-      }
-      if (i == lis.length) {
-       calendarList.appendChild(li);
       }
+      else if (previousOwner || 
+              (currentOwner != UserLogin && currentOwner > owner))
+       break;
     }
-
+    if (i != lis.length) // User is subscribed to other calendars of the same owner
+      calendarList.insertBefore(li, lis[i]);
+    else 
+      calendarList.appendChild(li);
+    
     li.setAttribute("id", folderPath);
     li.setAttribute("owner", owner);
 
@@ -1471,13 +1465,11 @@ function appendCalendar(folderName, folderPath) {
 
     var colorBox = document.createElement("div");
     li.appendChild(colorBox);
-    li.appendChild(document.createTextNode(" " + folderName));
+    li.appendChild(document.createTextNode(folderName));
     colorBox.appendChild(document.createTextNode("OO"));
 
     $(colorBox).addClassName("colorBox");
-    if (color)
-      $(colorBox).setStyle({color: color,
-                           backgroundColor: color});
+    $(colorBox).addClassName('calendarFolder' + folderPath.substr(1));
 
     // Register events (doesn't work with Safari)
     Event.observe(li, "mousedown",  listRowMouseDownHandler);
@@ -1498,12 +1490,20 @@ function appendCalendar(folderName, folderPath) {
                           + ' background-color: '
                           + color
                           + ' !important; }', 0);
+      lastSheet.insertRule('div.colorBox.calendarFolder' + folderPath.substr(1) + ' {'
+                          + ' color: '
+                          + color
+                          + ' !important; }', 0);
     }
     else { // IE
       lastSheet.addRule('.calendarFolder' + folderPath.substr(1),
                        ' background-color: '
                        + color
                        + ' !important; }');
+      lastSheet.addRule('div.colorBox.calendarFolder' + folderPath.substr(1),
+                       ' color: '
+                       + color
+                       + ' !important; }');
     }
   }
 }
@@ -1534,19 +1534,18 @@ function onCalendarRemove(event) {
       if (folderIdElements.length > 1) {
        unsubscribeFromFolder(folderId, onFolderUnsubscribeCB, folderId);
       }
-      else {
-       var calId = folderIdElements[0].substr(1);
-       deletePersonalCalendar(calId);
-      }
+      else
+       deletePersonalCalendar(folderIdElements[0]);
     }
   }
   
   preventDefault(event);
 }
 
-function deletePersonalCalendar(folderId) {
+function deletePersonalCalendar(folderElement) {
+  var folderId = folderElement.substr(1);
   var label
-    = labels["Are you sure you want to delete the selected calendar?"];
+    = labels["Are you sure you want to delete the calendar \"%{0}\"?"].formatted($(folderElement).lastChild.nodeValue.strip());
   if (window.confirm(label)) {
     removeFolderRequestCount++;
     var url = ApplicationBaseURL + "/" + folderId + "/deleteFolder";