X-Git-Url: https://git.plutz.net/?p=confetti;a=blobdiff_plain;f=templates%2Fedit_attendee.sh;h=934023228bf7902532938abc74196a93747d746c;hp=d79553f284cc7576bd3adb4317375b419a149326;hb=33a8e0e8967077bb2aa63b4bea706dc61d3e42d8;hpb=9da739230659371a860e93dcaf3765b977e30de7 diff --git a/templates/edit_attendee.sh b/templates/edit_attendee.sh index d79553f..9340232 100755 --- a/templates/edit_attendee.sh +++ b/templates/edit_attendee.sh @@ -1,42 +1,137 @@ -edit_card_item() { - case "$key" in - BEGIN|VERSION|END);; - PHOTO) - echo "" - ;; - *) - echo -n "$(l10n "$key")" - [ -n "$tag[TYPE]" ] && echo -n "($tag[TYPE])" - echo ":" - ;| - *) - echo "" - echo "" - ;; - esac -} +# Copyright 2014, 2015 Paul Hänsch +# +# This file is part of Confetti. +# +# Confetti is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# Confetti is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with Confetti. If not, see . -edit_attendee() { - cardfile="vcard/$1" - tempfile="temp/$1" - [ -f "$tempfile" ] && cardfile="$tempfile" - debug Using card: $cardfile - unset key - vcf_parse "$cardfile" |debug |while read -r line; do - declare -A tag - case "$line" in - value*) eval "$line";; - tag*) eval "$line";; - key*) - if [ -z "$key" ]; then - eval "$line" - else - edit_card_item - eval "$line" - unset value - unset tag - fi - ;; - esac - done +check_gen() { + [ "$values[GENDER]" = "$1" ] && echo 'selected="selected"' +} +check_a() { + egrep -q "^${1}.${id}$" "$_DATA/mappings/attendance" && echo 'checked="checked"' } + +n_last="$(echo "$values[N]" |sed -rn 's:^([^;]*;){0} *([^;]*).*$:\2:p')" +n_first="$(echo "$values[N]" |sed -rn 's:^([^;]*;){1} *([^;]*).*$:\2:p')" +n_middle="$(echo "$values[N]" |sed -rn 's:^([^;]*;){2} *([^;]*).*$:\2:p')" +n_pre="$(echo "$values[N]" |sed -rn 's:^([^;]*;){3} *([^;]*).*$:\2:p')" +n_post="$(echo "$values[N]" |sed -rn 's:^([^;]*;){4} *([^;]*)*$:\2:p')" + +SUP_FIELDS=(N NICKNAME GENDER BDAY X-ZACK-JOINDATE X-ZACK-LEAVEDATE EMAIL TEL IMPP ADR URL NOTE) + +[ -z "$values[UID]" ] && values[UID]="$(uuidgenerator)" + +cat < + +
+

$(l10n N)

+ + + + + + + + + $(for n in NICKNAME NICKNAME{0..10}; do + echo "${values[$n]:+}" + done) + +

$(l10n BDAY)

+ + +

$(l10n X-ZACK-JOINDATE)

+ + $(if [ -n "$values[X-ZACK-LEAVEDATE]" ]; then + echo '

'$(l10n X-ZACK-LEAVEDATE)'

' + echo ' ' + fi) + + $(if [ -n "$values[SOUND]" ]; then + echo ' ' + fi) + ${values[PHOTO]:+} + ${values[LOGO]:+} +
+ +
+

$(l10n TEL)

+ + $(for n in TEL{0..10}; do + echo "${values[$n]:+}" + done) +
+ +
+

$(l10n EMAIL)

+ + $(for n in EMAIL{0..10}; do + echo "${values[$n]:+}" + done) + ${values[IMPP]:+

$(l10n IMPP)

} + $(for n in IMPP IMPP{0..10}; do + echo "${values[$n]:+}" + done) +
+ +
+

$(l10n ADR)

+ + $(for n in ADR{0..10}; do + echo "${values[$n]:+}" + done) + ${values[URL]:+

$(l10n URL)

} + $(for n in URL URL{0..10}; do + echo "${values[$n]:+}" + done) +
+ +
+

$(l10n NOTE)

+ + $(for n in NOTE{0..10}; do + echo "${values[$n]:+}" + done) +
+ +
+

$(l10n course_attendance)

+ $(listcourses |while read each; do + cname="$(sed -rn 's:^SUMMARY\:(.*)$:\1:p' "$_DATA/ical/$each")" + echo '' + done) +
+ +
+ + + + +
+ + +END_HTML