]> git.plutz.net Git - confetti/blobdiff - cards/update_card.sh
basic support for telephone type
[confetti] / cards / update_card.sh
index ee9ac3eb295cb7e524714dc1550dab82f16b524d..b16ea0549c8548fd727d23b78de7ed6e54928ac5 100755 (executable)
@@ -59,7 +59,11 @@ for field in $(POST_KEYS |grep -xE '[A-Z][A-Z0-9-]*'); do
       # (TEL)
       #   printf '%s;TYPE=%s:%s\r\n' "${field}" "${_POST[phonetype${key#TEL}]}" "$(vcf_escape "$(POST "$field" "$cnt")")"
       #   ;;
       # (TEL)
       #   printf '%s;TYPE=%s:%s\r\n' "${field}" "${_POST[phonetype${key#TEL}]}" "$(vcf_escape "$(POST "$field" "$cnt")")"
       #   ;;
-      (*)
+      TEL)
+         vcf="$(pdi_update_attrib "$vcf" TEL $cnt TYPE="$(POST teltype $cnt |grep -Exm1 'HOME|WORK|CELL|FAX')")"
+         vcf="$(pdi_update_value "$vcf" "$field" "$cnt" "$(POST "$field" "$cnt")")"
+         ;;
+      *)
          vcf="$(pdi_update_value "$vcf" "$field" "$cnt" "$(POST "$field" "$cnt")")"
         ;;
     esac
          vcf="$(pdi_update_value "$vcf" "$field" "$cnt" "$(POST "$field" "$cnt")")"
         ;;
     esac