See ChangeLog.
Monotone-Parent: 7f20a4d6e701b0221b1fddc51f74c48737a88125 Monotone-Revision: b2fe7ce1dad859d390bcaf92ab86bfce416a3e91 Monotone-Author: flachapelle@inverse.ca Monotone-Date: 2011-07-06T19:44:44 Monotone-Branch: ca.inverse.sogomaint-2.0.2
parent
3fc5bcd31e
commit
4a73f41d58
10
ChangeLog
10
ChangeLog
|
@ -1,5 +1,15 @@
|
|||
2011-07-07 Francis Lachapelle <flachapelle@inverse.ca>
|
||||
|
||||
* UI/WebServerResources/UIxListEditor.js (endEditable): when a
|
||||
string doesn't match an existing card, keep the entry but
|
||||
highlight it in red.
|
||||
(serializeReferences): when an entry is not associated to a card,
|
||||
extract the email and fullname from the string to create a new card.
|
||||
|
||||
* UI/Contacts/UIxListEditor.m (-setReferencesValue:): if a card
|
||||
reference doesn't match a known vCard UID, create a new vCard
|
||||
like Thunderbird does.
|
||||
|
||||
* UI/MainUI/SOGoUserHomePage.m (-_usersForResults:inDomain:):
|
||||
fixed bug when the domain was empty.
|
||||
(-usersSearchAction): idem.
|
||||
|
|
|
@ -1,8 +1,9 @@
|
|||
/* UIxListEditor.m - this file is part of SOGo
|
||||
*
|
||||
* Copyright (C) 2008-2009 Inverse inc.
|
||||
* Copyright (C) 2008-2011 Inverse inc.
|
||||
*
|
||||
* Author: Wolfgang Sourdeau <wsourdeau@inverse.ca>
|
||||
* Francis Lachapelle <flachapelle@inverse.ca>
|
||||
*
|
||||
* 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
|
||||
|
@ -31,6 +32,7 @@
|
|||
#import <NGCards/NGVCardReference.h>
|
||||
#import <NGCards/NGVList.h>
|
||||
|
||||
#import <Contacts/SOGoContactGCSEntry.h>
|
||||
#import <Contacts/SOGoContactGCSFolder.h>
|
||||
#import <Contacts/SOGoContactGCSList.h>
|
||||
|
||||
|
@ -159,6 +161,46 @@
|
|||
|
||||
[list addCardReference: cardReference];
|
||||
}
|
||||
else
|
||||
{
|
||||
// Not a valid UID; expect a string formatted as : "email|fullname"
|
||||
NSString *workMail, *fn, *newUID;
|
||||
NSArray *contactInfo;
|
||||
NGVCard *newCard;
|
||||
CardElement *newWorkMail;
|
||||
SOGoContactGCSEntry *newContact;
|
||||
|
||||
contactInfo = [currentReference componentsSeparatedByString: @"|"];
|
||||
if ([contactInfo count] > 1)
|
||||
{
|
||||
workMail = [contactInfo objectAtIndex: 0];
|
||||
fn = [contactInfo objectAtIndex: 1];
|
||||
|
||||
// Create a new vCard
|
||||
newUID = [NSString stringWithFormat: @"%@.vcf", [co globallyUniqueObjectId]];
|
||||
newCard = [NGVCard cardWithUid: newUID];
|
||||
newWorkMail = [CardElement new];
|
||||
[newWorkMail autorelease];
|
||||
[newWorkMail setTag: @"email"];
|
||||
[newWorkMail addType: @"work"];
|
||||
[newCard addChild: newWorkMail];
|
||||
[newWorkMail setValue: 0 to: workMail];
|
||||
[newCard setFn: fn];
|
||||
|
||||
// Add vCard to current folder
|
||||
newContact = [SOGoContactGCSEntry objectWithName: newUID
|
||||
inContainer: folder];
|
||||
[newContact saveContentString: [newCard versitString]];
|
||||
|
||||
// Create card reference for the list
|
||||
cardReference = [NGVCardReference elementWithTag: @"card"];
|
||||
[cardReference setFn: fn];
|
||||
[cardReference setEmail: workMail];
|
||||
[cardReference setReference: newUID];
|
||||
|
||||
[list addCardReference: cardReference];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -21,9 +21,6 @@ TD.referenceListCell
|
|||
background: #CCDDEC;
|
||||
text-align: left;}
|
||||
|
||||
TABLE#referenceList TD INPUT
|
||||
{ width: 97%; }
|
||||
|
||||
DIV#referenceListWrapper
|
||||
{ background: #CCDDEC;
|
||||
overflow: auto;
|
||||
|
@ -40,12 +37,24 @@ TR.referenceListRow
|
|||
{ background: #CCDDEC;
|
||||
line-height: 2em; }
|
||||
|
||||
TD.referenceListCell
|
||||
{ -moz-user-select: none; }
|
||||
TD.referenceListCell,
|
||||
TD.editing
|
||||
{ background-repeat: no-repeat;
|
||||
background-position: 4px 50%;
|
||||
background-image: url('abcard.png');
|
||||
text-align: left;
|
||||
-moz-user-select: none; }
|
||||
|
||||
TD.referenceListCell SPAN,
|
||||
TD.referenceListCell INPUT
|
||||
{ margin-left: 3px; }
|
||||
TD.editing INPUT
|
||||
{ margin-left: 24px; }
|
||||
|
||||
TD.editing INPUT,
|
||||
TABLE#referenceList TD INPUT
|
||||
{ width: 90%; }
|
||||
|
||||
TR.notfound TD.referenceListCell
|
||||
{ color: #f00 !important; }
|
||||
|
||||
DIV#windowButtons
|
||||
{ position: fixed;
|
||||
|
@ -71,10 +80,9 @@ DIV#buttons
|
|||
vertical-align: middle;
|
||||
text-align: right; }
|
||||
|
||||
td {color: #535D6D;}
|
||||
TD
|
||||
{ color: #535D6D; }
|
||||
|
||||
DIV#listEditor
|
||||
{ padding: 5px; }
|
||||
|
||||
TD.editing
|
||||
{ text-align: left; }
|
||||
|
|
|
@ -30,16 +30,16 @@ function endEditable(event, textField) {
|
|||
cell.addClassName("referenceListCell");
|
||||
textField.hide();
|
||||
|
||||
if (uid) {
|
||||
var tmp = textField.value;
|
||||
tmp = tmp.replace (/</, "<");
|
||||
tmp = tmp.replace (/>/, ">");
|
||||
var tmp = textField.value;
|
||||
tmp = tmp.replace (/</, "<");
|
||||
tmp = tmp.replace (/>/, ">");
|
||||
if (!uid)
|
||||
cell.up("TR").addClassName("notfound");
|
||||
if (tmp)
|
||||
textSpan.update(tmp);
|
||||
}
|
||||
else {
|
||||
else
|
||||
cell.up("TR").remove();
|
||||
}
|
||||
|
||||
|
||||
if (event)
|
||||
Event.stop(event);
|
||||
|
||||
|
@ -108,8 +108,20 @@ function serializeReferences(e) {
|
|||
var uid = $(r[i]).readAttribute("uid");
|
||||
if (uid)
|
||||
cards.push(uid);
|
||||
else {
|
||||
var addresses = r[i].value.split(/[,;]/);
|
||||
for (var j = 0; j < addresses.length; j++) {
|
||||
var mailto = addresses[j].strip();
|
||||
var email = extractEmailAddress(mailto);
|
||||
var c_name = extractEmailName(mailto);
|
||||
if (!email && !c_name)
|
||||
c_name = mailto;
|
||||
cards.push(email + '|' + c_name);
|
||||
}
|
||||
}
|
||||
}
|
||||
$("referencesValue").value = cards.join(",");
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue