From 809dd93745e557690152ed17d0b17f0582cf94dd Mon Sep 17 00:00:00 2001 From: =?utf8?q?Paul=20H=C3=A4nsch?= Date: Fri, 19 Apr 2024 02:01:08 +0200 Subject: [PATCH 1/1] enable IBAN field in card --- cards/l10n.sh | 1 + cards/list.sh | 9 ++++++--- cards/update_card.sh | 2 +- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/cards/l10n.sh b/cards/l10n.sh index 2d9dc06..fde98e0 100755 --- a/cards/l10n.sh +++ b/cards/l10n.sh @@ -37,6 +37,7 @@ l10n(){ X-ZACK-LEAVEDATE) printf %s "Abmelde­datum";; X-ZACK-JOINDATE_short) printf %s "Anm.";; X-ZACK-LEAVEDATE_short) printf %s "Abm.";; + X-IBAN) printf %s "IBAN";; *) l10n_global "$word";; esac diff --git a/cards/list.sh b/cards/list.sh index 519005c..9511fc1 100755 --- a/cards/list.sh +++ b/cards/list.sh @@ -31,7 +31,10 @@ edit_card(){ [ $(pdi_count "$card" IMPP) -gt 0 ] && edit_item "$card" IMPP [ $(pdi_count "$card" URL ) -gt 0 ] && edit_item "$card" URL )] - [div .section .address $(edit_item "$card" ADR)] + [div .section .address $( + edit_item "$card" ADR + [ $(pdi_count "$card" X-IBAN) -gt 0 ] && edit_item "$card" X-IBAN + )] [div .section .note $(edit_item "$card" NOTE)] [div .section .attendance [h3 $(l10n course_attendance) ] [div .attendance $( @@ -65,7 +68,7 @@ edit_card(){ [div .item .newfield [select name="newfield" [option value="" disabled="disabled" selected="selected" $(l10n edit_addfieldtext)] - $(for f in NICKNAME EMAIL TEL IMPP ADR URL NOTE X-ZACK-LEAVEDATE; do + $(for f in NICKNAME EMAIL TEL IMPP ADR URL NOTE X-ZACK-LEAVEDATE X-IBAN; do printf '[option value="%s" %s] ' "$f" "$(l10n "$f")" done) ][button type="submit" name="action" value="addfield" $(l10n edit_addfield)] @@ -90,7 +93,7 @@ print_card(){ )] [div .section .phone . $(card_item "$card" TEL)] [div .section .message . $(card_item "$card" EMAIL IMPP URL)] - [div .section .address . $(card_item "$card" ADR)] + [div .section .address . $(card_item "$card" ADR X-IBAN)] [div .section .note . $(card_item "$card" NOTE)] [div .section .attendance [h3 $(l10n course_attendance) ] [ul $(grep -F " ${cardfile##*/}" "$_DATA/mappings/attendance" |while read each discard; do diff --git a/cards/update_card.sh b/cards/update_card.sh index 2b87632..d57f503 100755 --- a/cards/update_card.sh +++ b/cards/update_card.sh @@ -35,7 +35,7 @@ attfile="$_DATA/mappings/attendance" action="$(POST action)" newfield="$(POST newfield |grep -m 1 -xE '[A-Z][A-Z0-9-]*')" -if printf '%s\n' "$action" |grep -qxE 'addfield [A-Z][A-Z0-9]*'; then +if printf '%s\n' "$action" |grep -qxE 'addfield [A-Z][A-Z0-9-]*'; then newfield="${action##* }" action=addfield fi -- 2.39.2