]> git.plutz.net Git - lobster/blobdiff - cards/update_card.sh
suppress error for non-numerig comparisons
[lobster] / cards / update_card.sh
index f44eb28b8d534b5f69bb277d4ba693925ca8dd4e..9d56c50e5de4793c1eec16c1d88630534a9cc996 100755 (executable)
@@ -27,8 +27,8 @@ unset vcf field cnt delete_key
 filter="$(REF f)"
 order="$(REF o)"
 
-card="$(POST card)"
-cardfile="$_DATA/vcard/$card"
+card="$(POST card |PATH)"
+cardfile="$_DATA/vcard/${card##*/}"
 attfile="$_DATA/mappings/attendance"
 
 action="$(POST action)"
@@ -71,6 +71,20 @@ 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")")"
       #   ;;
+      X-HEALTH-INSURANCE)
+        hi_select="$(POST "$field" "$cnt")"
+        if [ "$hi_select" = list ]; then
+          vcf="$(pdi_update_value "$vcf" "$field" "$cnt" "$(vcf_escape "$(POST "hi_company" "$cnt")" \
+                                                                       "$(POST "hi_number" "$cnt")" \
+                                                                       "$(POST "hi_status" "$cnt")" \
+                                                          )")"
+        elif [ "$hi_select" = other ]; then
+          vcf="$(pdi_update_value "$vcf" "$field" "$cnt" "$(vcf_escape "$(POST "hi_other" "$cnt")" \
+                                                                       "$(POST "hi_number" "$cnt")" \
+                                                                       "$(POST "hi_status" "$cnt")" \
+                                                          )")"
+        fi
+        ;;
       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" "$(vcf_escape "$(POST "$field" "$cnt")")")"