X-Git-Url: https://git.plutz.net/?p=confetti;a=blobdiff_plain;f=pages%2Fcards.sh;h=08b88b94e11b75e8eeeab786df667adb1912af3c;hp=056f4d2efc2ae96ec7c7b8a6e93027e291983768;hb=9d6e65a0055304b62e0b2c9502da3443fb82ad33;hpb=bdf05fd0cb8f4c79152adbba9070213bc3087193 diff --git a/pages/cards.sh b/pages/cards.sh index 056f4d2..08b88b9 100755 --- a/pages/cards.sh +++ b/pages/cards.sh @@ -25,19 +25,20 @@ medical) view_card="$_EXEC/templates/view_client.sh" edit_card="$_EXEC/templates/edit_client.sh" _GET[order]="${_GET[order]:-lastname}" + _GET[filtertype]="${_GET[filtertype]:-name}" profile_medical=x ;; circus) view_card="$_EXEC/templates/view_attendee.sh" edit_card="$_EXEC/templates/edit_attendee.sh" _GET[order]="${_GET[order]:-firstname}" + _GET[filtertype]="${_GET[filtertype]:-any}" profile_circus=x ;; esac edit="${_GET[edit]}" [ \! -f "vcard/$edit" -a \! -f "temp/$edit" ] && edit='' -_GET[filtertype]="${_GET[filtertype]:-any}" listcourses() { ls -1 ${_DATA}/ical/*ics |while read file; do @@ -47,7 +48,8 @@ listcourses() { } list_hi_companies(){ - sed -rn 's;^X-HEALTH-INSURANCE:([^\;]+)\;.*$;\1;p' ${_DATA}/vcard/*vcf + sed -rn 's;^X-HEALTH-INSURANCE:([^\;]+)\;.*$;\1;p' ${_DATA}/vcard/*vcf \ + | sort -u } listcards() { @@ -140,7 +142,7 @@ vcf_parse() { tag=*) ot='' printf %s "$line" \ | sed -r 's:^tag=::;s:\;([A-Z+_-]+="[^"]+"|[A-Z+_-]+=[^\;]+):\n\1:g;' \ - | sed -r 's:([A-Z+_-]+)="?(.*)"?:tag\[\1\]="\2":g' \ + | sed -rn 's:([A-Z+_-]+)="?(.+)"?:tag\[\1\]="\2":gp' \ | sed -r '/^ *$/d' \ | sort |while read -r tag; do nt="$(printf %s "$tag" |sed -r 's:^tag\[([A-Z+_-]+)\]="(.*)"$:\1:')"