X-Git-Url: https://git.plutz.net/?a=blobdiff_plain;f=cards%2Flist.sh;h=ce8c1ab50929901269d365c374b7c7799a317f31;hb=26149592a7023d89ac39cd88285d49f7fd28f71c;hp=2735c5426d7218dbc0892098bd5b30ad47d6babd;hpb=7c3de62f78eba0142bc054bdda1f3ab1cb1c20a4;p=lobster diff --git a/cards/list.sh b/cards/list.sh index 2735c54..ce8c1ab 100755 --- a/cards/list.sh +++ b/cards/list.sh @@ -20,9 +20,6 @@ edit_card(){ [ "$(pdi_count "$card" NICKNAME)" -gt 0 ] \ && edit_item "$card" NICKNAME edit_item "$card" BDAY - edit_item "$card" X-ZACK-JOINDATE - [ "$(pdi_count "$card" X-ZACK-LEAVEDATE)" -gt 0 ] \ - && edit_item "$card" X-ZACK-LEAVEDATE card_item "$card" SOUND PHOTO LOGO )] [div .section .phone $( @@ -66,6 +63,7 @@ print_card(){ [div .section .phone $(card_item "$card" TEL EMAL IMPP URL)] [div .section .insurance $(card_item "$card" X-HEALTH-INSURANCE)] [div .section .note $(card_item "$card" NOTE X-CLIENT-REFERRAL)] + [div .section .therapies $(card_item "$card" therapies)] [div .control [a .item href="/cards/edit_card.sh?card=${cardfile##*/}" $(l10n edit)] [a .item href="/cards/export_card.sh?card=${cardfile##*/}" $(l10n vcf_export)] @@ -99,16 +97,17 @@ filter_cards(){ while [ "$filter" ]; do f="${filter%%^*}" filter="${filter#*^}" + debug "Filter: $f" case $f in '') break ;; ANY:*) fex="/\n.*(\;[^:]*)?:.*(${f#*:}).*\r?\n/{${fex}}" ;; - NAME:*) fex="/\n(N|FN|NICKNAME)(\;[^:]*)?:.*(${f#*:}).*\r?\n/{${fex}}" + NAME:*) fex="/\n(N|FN|NICKNAME)(\;[^:]*)?:[^\n]*(${f#*:}).*\r?\n/{${fex}}" ;; - STREET:*|ZIP:*) fex="/\nADR(\;[^:]*)?:.*(${f#*:}).*\r?\n/{${fex}}" + STREET:*|ZIP:*) fex="/\nADR(\;[^:]*)?:[^\n]*(${f#*:}).*\r?\n/{${fex}}" ;; - *) fex="/\n${f%%:*}(\;[^:]*)?:.*(${f#*:}).*\r?\n/{${fex}}" + *) fex="/\n${f%%:*}(\;[^:]*)?:[^\n]*(${f#*:}).*\r?\n/{${fex}}" ;; esac done @@ -117,7 +116,7 @@ filter_cards(){ printf '%s\n' "$cardfile" cat "$cardfile" done \ - | sed -En ':X; /\nEND:VCARD\r?$/!{ N; bX; }; h; s;\n.*$;;; x; s;^[^\n]+\n;;; + | sed -En ':X; /\nEND;?:VCARD\r?$/!{ N; bX; }; h; s;\n.*$;;; x; s;^[^\n]+\n;;; '"$upcase""$fex" }