X-Git-Url: https://git.plutz.net/?p=confetti;a=blobdiff_plain;f=cards%2Fnew_card.sh;h=69f89c662f87dfa6fb3a35cc5a3520d0ac446f10;hp=0273a2cb44ac481c2c6f7554e3e3782a855be3a0;hb=07454834f9d0291be5e652eef5f62c889331d695;hpb=76c1e7bff1a8604ef2ef7da5d274d0db0e639139 diff --git a/cards/new_card.sh b/cards/new_card.sh index 0273a2c..69f89c6 100755 --- a/cards/new_card.sh +++ b/cards/new_card.sh @@ -31,13 +31,14 @@ vcf_escape(){ | sed -E ':X;$!{N;bX}; s;\n;\;;g' } -IFS='|' read -r date fn ln bmonth byear tel tcell junk1 email junk2 note <<-EOF +IFS='|' read -r date fn ln bday bmonth byear tel tcell junk1 email junk2 note <<-EOF $(POST seed |tr \\t \|) EOF [ ${#byear} = 1 ] && byear="200$byear" [ ${#byear} = 2 ] && byear="20$byear" [ ${#bmonth} = 1 ] && bmonth="0$bmonth" +[ ${#bday} = 1 ] && bday="0$bday" mn="" case $fn in @@ -57,7 +58,7 @@ if mkdir "$lockdir"; then VERSION:4.0 N:$(vcf_escape "$ln" "$fn" "$mn" "" "") FN:$(vcf_escape "${fn}${mn:+ }${mn} ${ln}") - BDAY:$(parse_date "${byear}-${bmonth}-01") + BDAY:$(parse_date "${byear}-${bmonth}-${bday}") TEL:$(vcf_escape "$tel") TEL;TYPE=CELL:$(vcf_escape "$tcell") EMAIL:$(vcf_escape "$email") @@ -67,8 +68,8 @@ if mkdir "$lockdir"; then UID:${uid} END:VCARD EOF - REDIRECT "/cards/?o=${order}&f=${filter}&e=${card}" + REDIRECT "${_BASE}/cards/?o=${order}&f=${filter}&e=${card}" else SET_COOKIE session message="EDITLOCK" - REDIRECT "/cards/?o=${order}&f=${filter}" + REDIRECT "${_BASE}/cards/?o=${order}&f=${filter}" fi