From be5f12e43f464b3ca924b2131fe74d6cf24981a1 Mon Sep 17 00:00:00 2001 From: paul Date: Thu, 28 Nov 2013 22:42:39 +0000 Subject: [PATCH] multiple logical fixes in vcard updater svn path=/trunk/; revision=25 --- actions/update_attendee.sh | 1 + pages/attendees.sh | 4 ++-- templates/edit_attendee.sh | 5 ++++- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/actions/update_attendee.sh b/actions/update_attendee.sh index 6f46cb2..ba84be8 100644 --- a/actions/update_attendee.sh +++ b/actions/update_attendee.sh @@ -9,6 +9,7 @@ cardfile="vcard/$card" echo "BEGIN:VCARD\r" >"$tempfile" echo "VERSION:4.0\r" >>"$tempfile" echo "N:$_POST[\"0N\"];$_POST[\"1N\"];$_POST[\"2N\"];$_POST[\"3N\"];$_POST[\"4N\"]\r" >>"$tempfile" +echo "UID:$_POST[\"UID\"]\r" >>"$tempfile" for field in $VCF_FIELDS; do value="$_POST[\"$field\"]" n=0 diff --git a/pages/attendees.sh b/pages/attendees.sh index 00bbd43..4a352ca 100755 --- a/pages/attendees.sh +++ b/pages/attendees.sh @@ -35,8 +35,8 @@ vcf_parse() { s:^X-MS-CARDPICTURE:001 PHOTO:p; s:^LOGO:002 LOGO:p; s:^FN:003 FN:p; + s:^N[\:;]:004 &:p s:^NICKNAME:005 NICKNAME:p; - s:^N:004 N:p s:^SOUND:006 SOUND:p; s:^GENDER:007 GENDER:p; s:^X-GENDER:007 GENDER:p; @@ -102,7 +102,7 @@ vcf_parse() { s:^([A-Z].*)$:024 \1:p; ' \ - | sort |while read -r line; do + |sort |while read -r line; do case "$line" in 00[012]*) echo -E "$line" diff --git a/templates/edit_attendee.sh b/templates/edit_attendee.sh index 7282452..679a7bd 100755 --- a/templates/edit_attendee.sh +++ b/templates/edit_attendee.sh @@ -9,6 +9,8 @@ edit_card() { n_pre="$(echo "$values[N]" |sed -rn 's:^([^;]*;){3} *([^;]*).*$:\2:p')" n_post="$(echo "$values[N]" |sed -rn 's:^([^;]*;){4} *([^;]*)*$:\2:p')" + [ -z "$values[UID]" ] && values[UID]="$(dbus-uuidgen)" + echo '
' echo ' '$(l10n N)'' echo ' ' @@ -90,6 +92,7 @@ edit_card() { echo ' ' echo ' ' echo '
' + echo '' } edit_attendee() { #Parameter: Cardfile @@ -108,7 +111,7 @@ edit_attendee() { #Parameter: Cardfile if [ -z "$key" ]; then eval "$line" else - values[$key]="$value" + [ -n "$value" ] && values[$key]="$value" || values[$key]='\r' for t in ${(k)tag}; do tags[${key}_$t]="$tag[$t]" done -- 2.39.2