-
Notifications
You must be signed in to change notification settings - Fork 60
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Import #426
Import #426
Conversation
Sorry, but no it doesn't. Look at the number of changed files. I guess you haven't changed 313 files? ;) I'll have a look at it tonight (CET) |
@tanghus , no, I haven't changed all those files, although most of the reported changes are ACL changes. I don't know why I did that, but I changed most of the access control from 0644 to 0755... |
Yes, but not github. I suggest you make a new clone of the repo, make a new branch, and take the files you've changed and manually copy them from the old clone to the new. But wait till tomorrow; I'll see if I can sort it out. |
@babelouest Looking at your commits I figured it was the one with the |
@babelouest I think I've resolved it. Please check in the Files changed tab and see if it looks correct. |
@tanghus , looks correct to me, thanks ! |
@babelouest Sorry I haven't been able to review this yet. I'm a bit tight on time in the beginning of the week though. Just to let you know I haven't forgotten :) |
</import_entry> | ||
|
||
<import_entry property="X-PRIMARY-PHONE" enabled="true"> | ||
<vcard_entry property="PHONE" type="HOME"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@babelouest Can you add more than one type here? PRIMARY
indicates it should also have type PREF
. Or am I wrong here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure I understand your question.
Here, X-PRIMARY-PHONE
stands for the property name that we're looking for, to be replace by the one below (PHONE type:HOME
).
If you want to convert other properties, just add an <import_entry>
tag with the <vcard_entry>
tag for the result.
What do you mean by PREF
? is it a VCard property ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PREF is a standard type for the preferred property if there are more than one. Used for e.g TEL, EMAIL, URL, ADR etc. Like in TEL;TYPE=HOME,PREF:+1-919-676-9564
or TEL;TYPE=HOME;TYPE=PREF:+1-919-676-9564
. Not sure if Yahoo has more than one PHONE type though?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
so if it's a type, you can use this:
<vcard_entry property="PHONE" type="HOME,PREF">
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah OK. Excellent!
Just a few coding style issues. Full test later :) |
no problem :) |
@babelouest First test with a Google CSV:
Not in "My contacts":
In "My contacts":
Something to start with ;) |
OK, that's a problem indeed :p |
Done |
BTW when the contact is in the |
OK, you tried to trick me with a UTF16 file where I expect a UTF8 file ! Damn you ! ;) About the |
I wasn't even aware of that. Just exported it from google contacts :)
It is kinda like the Starred group in google contacts: For CATEGORIES you have to - besides converting them to vCard CATEGORIES - index them using the $tagMgr = $this->server->getTagManager()->load('contact');
$tagMgr->addToFavorites($id); But you may wanna pass $this->server as an argument to the import class instead..? |
How do you do that? I'm not sure I have come across any; at least I haven't noticed :P |
No problem, to be sure, I translate the file into UTF8 all the time now
Yeah but I mean, does the csv value |
I would say it should be transformed into |
I will put this in the xml format and change the code as needed to make the changes: <import_entry name="Group Membership" enabled="true" separator=":::" remove="*">
<vcard_favourites value="Starred">
</vcard_favourites>
<vcard_entry property="CATEGORIES">
</vcard_entry>
</import_entry> Then the parsing will be modified like this: $csv_value = str_replace($remove, '', $csv_value);
$values = explode($separator, $csv_value);
foreach($values as $value) {
if ($value == $vcard_favourites) {
$tagMgr->addToFavorites($id);
} else {
// Parse normally
}
} |
Nice! |
Or even better: if ($value == $vcard_favourites) {
$property = \Sabre\VObject\Property::create("X-FAVOURITES", "yes");
$vcard->add($property);
} else {
// Parse normally
} Then, the |
There still are a lot of merge commits and 2 "WTF?" commits. ;) Would be cool to clean the history up a bit, otherwise no one from outside knows what happened to the code. |
@jancborchardt , I agree, but how can I clean the history ? Can I make a PR with just the last commit and not the previous ones for example ? (I have googled it and couldn't find an answer...) |
I guess easiest here would be to make a fresh branch off master and do the changes again manually. I know it's a pain, but in this case (looking at the diff) there's also just a lot of file additions so it's not that difficult. Is that ok? |
@tanghus , try with the last commit for your bugs: owncloud/contacts@3b516a1 @jancborchardt , using your technique or tabghus' technique, either way I suggest I'll fix that when the new import interface will pass your tests, so it will be done once ;) |
You mean dfba196 right? ;) I'll give it a go tomorrow. |
@tanghus , yup ;) |
Author: babelouest <[email protected]>
@babelouest @jancborchardt I made so many changes when cleaning up the code in master that this wasn't mergable anymore. A cleaned up version is now in #443 |
Pull request retry
I did a git rebase before sending the pull request, hope it looks better now.