edit_card_item() {
case "$key" in
- BEGIN|VERSION|END);;
+ BEGIN|VERSION|END|FN);;
PHOTO)
echo "<img class=\"PHOTO\" src=\"data:image/$tag[TYPE];base64,$value\"/>"
;;
[ -n "$tag[TYPE]" ] && echo -n "($tag[TYPE])"
echo ":</span>"
;|
+ N)
+ n_last="$(echo "$value" |sed -r 's:^([^;]*;){0} *([^;]*);.*$:\2:')"
+ n_first="$(echo "$value" |sed -r 's:^([^;]*;){1} *([^;]*);.*$:\2:')"
+ n_middle="$(echo "$value" |sed -r 's:^([^;]*;){2} *([^;]*);.*$:\2:')"
+ n_pre="$(echo "$value" |sed -r 's:^([^;]*;){3} *([^;]*);.*$:\2:')"
+ n_post="$(echo "$value" |sed -r 's:^([^;]*;){4} *([^;]*);*$:\2:')"
+ echo "<input class=\"VALUE\" name=\"3$key\" value=\"$n_pre\" placeholder=\"$(l10n n_pre)\" />"
+ echo "<input class=\"VALUE\" name=\"1$key\" value=\"$n_first\" placeholder=\"$(l10n n_first)\" />"
+ echo "<input class=\"VALUE\" name=\"2$key\" value=\"$n_middle\" placeholder=\"$(l10n n_middle)\" />"
+ echo "<input class=\"VALUE\" name=\"0$key\" value=\"$n_last\" placeholder=\"$(l10n n_last)\" />"
+ echo "<input class=\"VALUE\" name=\"4$key\" value=\"$n_post\" placeholder=\"$(l10n n_post)\" /></span>"
+ echo "<button name=\"deletefield\" value=\"$key $value\">$(l10n edit_deletefield)</button>"
+ ;;
*)
- echo "<input class=\"VALUE\" name=\"$key\" value=\"$value\" /></item>"
+ echo "<input class=\"VALUE\" name=\"$key\" value=\"$value\" /></span>"
+ echo "<button name=\"deletefield\" value=\"$key $value\">$(l10n edit_deletefield)</button>"
;;
esac
}
edit_attendee() {
- cardfile="$1"
+ cardfile="vcard/$1"
+ tempfile="temp/$1"
+ [ -f "$tempfile" ] && cardfile="$tempfile"
unset key
vcf_parse "$cardfile" |while read -r line; do
declare -A tag