X-Git-Url: https://git.plutz.net/?p=confetti;a=blobdiff_plain;f=pages%2Fcards.sh;h=50fee63b76c70040b1a776172e19d3385337b5f4;hp=d1170b0ada1f5cb767e4f04af476b2fcc6b6029d;hb=aedb6776919b351df7df7c310c238c41317ddc44;hpb=2d79e3831a65f8b3a54aa2514ef1e65c4b073cf2 diff --git a/pages/cards.sh b/pages/cards.sh index d1170b0..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")" @@ -115,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" \ @@ -154,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 @@ -192,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