X-Git-Url: https://git.plutz.net/?p=confetti;a=blobdiff_plain;f=pages%2Fcards.sh;h=50fee63b76c70040b1a776172e19d3385337b5f4;hp=c045b5bfd09cc3a0fbd7c1bbc58d8efbb5e6c2d5;hb=b0ab910afe1f7fec143a23e96c72e4f9a66db2bf;hpb=2805ee334bead55e2ab08b7c4dbdbf07dcebf8e9 diff --git a/pages/cards.sh b/pages/cards.sh index c045b5b..50fee63 100755 --- a/pages/cards.sh +++ b/pages/cards.sh @@ -19,6 +19,9 @@ [ -z "${_GET[order]}" ] && _GET[order]="firstname" +BR=' +' + listcourses() { ls -1 ${_DATA}/ical/*ics |while read file; do icstime="$(sed -rn 's:^DTSTART\:(TZID=.*\:)?([0-9]{4})([0-9]{2})([0-9]{2})T([0-9]{2})([0-9]{2})([0-9]{2})Z?\r$:\2-\3-\4 \5\:\6\:\7:p' "$file")" @@ -26,6 +29,10 @@ listcourses() { done |sort |sed -r 's:^.*\t(.*/)([^/]+)$:\2:' } +list_hi_companies(){ + sed -rn 's;^X-HEALTH-INSURANCE:([^\;]+)\;.*$;\1;p' ${_DATA}/vcard/*vcf +} + listcards() { case "${_GET[filtertype]}" in any) @@ -111,7 +118,7 @@ vcf_parse() { case "$line" in key=*) printf %s\\n "$line" ;; - value=*) printf %s\\n "$line" + value=*) printf %s\\n "${line}" ;; tag=*) ot='' printf %s "$line" \ @@ -150,7 +157,7 @@ view_card() { #Parameter: Cardfile if [ -z "$key" ]; then eval "$line" else - values[$key]="$value" + values[$key]="${value//\\r\\n/$BR}" for t in ${(k)tag}; do tags[${key}_$t]="$tag[$t]" done @@ -188,7 +195,7 @@ edit_card() { #Parameter: Cardfile if [ -z "$key" ]; then eval "$line" else - [ -n "$value" ] && values[$key]="$value" || values[$key]='\r' + [ -n "$value" ] && values[$key]="${value//\\r\\n/$BR}" || values[$key]='\r' for t in ${(k)tag}; do tags[${key}_$t]="$tag[$t]" done