]> git.plutz.net Git - confetti/blobdiff - actions/update_card.sh
provide info about health insurance in card view
[confetti] / actions / update_card.sh
index 1be16765cd20e8f0bf9340679e1da274606e5edf..a810476a5ca3e6d66d71915d246852cd3f8e0977 100755 (executable)
@@ -34,8 +34,10 @@ _POST[1N]="${_POST[1N]//;/,}"
 _POST[2N]="${_POST[2N]//;/,}"
 _POST[3N]="${_POST[3N]//;/,}"
 _POST[4N]="${_POST[4N]//;/,}"
-[ -n "${_POST[hi_number]}" -o -n "${_POST[hi_company]}" ] \
-&& _POST[X-HEALTH-INSURANCE]="${_POST[hi_number]//;/,};${_POST[hi_company]//;/,}"
+
+[ "$_POST[hi_select]" = "list" ] && hi_company="${_POST[hi_company]}" || hi_company="${_POST[hi_other]}"
+[ -n "${_POST[hi_company]}${_POST[hi_number]}${_POST[hi_status]}" ] \
+&& _POST[X-HEALTH-INSURANCE]="${hi_company//;/,};${_POST[hi_number]//;/,};${_POST[hi_status]//;/,}"
 
 sed -r 's;$;\r;' >"$tempfile" <<EOF
 BEGIN:VCARD