X-Git-Url: https://git.plutz.net/?p=confetti;a=blobdiff_plain;f=templates%2Fedit_card.sh;fp=templates%2Fedit_card.sh;h=0000000000000000000000000000000000000000;hp=bc71db2f91514ec684f2185feac2aeaf48a9e9fe;hb=43e7c60df0632fd383306a2d3c6dc8c4213d4b9d;hpb=d40eb749c3b9766eb85d843e712f1b86543232d2 diff --git a/templates/edit_card.sh b/templates/edit_card.sh deleted file mode 100755 index bc71db2..0000000 --- a/templates/edit_card.sh +++ /dev/null @@ -1,199 +0,0 @@ -# Copyright 2014 - 2017 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 . - -setchecked() { - printf 'checked="checked"' -} -setselected() { - printf 'selected="selected"' -} -check_gen() { - [ "$values[GENDER]" = "$1" ] && setselected -} -check_a() { - egrep -q "^${1}.${id}$" "$_DATA/mappings/attendance" && setchecked -} -check_c() { - for n in CATEGORIES CATEGORIES{0..100}; do - if [ -n "${values[$n]+x}" ]; then - [ "${values[$n]}" = "$1" ] && setchecked && break - else - break - fi - done -} - -teltype() { - cat <<-EOF - - EOF -} - -list_items(){ - item="$1" - placeholder="$2" - [ -n "${values[$item]+x}" ] && printf '

%s

\n' "$(l10n $item)" - for n in "$item" "$item"{0..100}; do - if [ -n "${values[$n]+x}" ]; then - case "$item" in - (ADR|NOTE) - printf '\n' \ - "$item" "$item" "$(htmlsafe ${values[$n]})" - ;; - (TEL) - teltype "${values[${n}_TYPE]}" - printf '\n' \ - "$item" "$item" "$(attribsafe ${values[$n]})" - ;; - (*) - printf '\n' \ - "$item" "$item" "$(attribsafe ${values[$n]})" "$placeholder" - ;; - esac - else - break - fi - done -} - -list_section(){ - printf '
' "$1" - shift 1 - for each in $@; do - list_items "$each" - done - printf '
' -} - -hi_company="${values[X-HEALTH-INSURANCE+0]}" - hi_number="${values[X-HEALTH-INSURANCE+1]}" - hi_status="${values[X-HEALTH-INSURANCE+2]}" - -[ -z "$values[UID]" ] && values[UID]="$(uuidgenerator)" - -cat < - -
-

$(l10n N)

- - - - - - - -END_HTML - - for n in NICKNAME NICKNAME{0..100}; do - [ -z "${values[$n]+x}" ] && break \ - || printf ' - - ' "$(attribsafe ${values[$n]})" "$(l10n NICKNAME)" - done - - list_items BDAY YYYY-MM-DD - list_items X-ZACK-JOINDATE YYYY-MM-DD - list_items X-ZACK-LEAVEDATE YYYY-MM-DD - - [ -n "$values[SOUND]" ] && printf ' - ' "$values[SOUND]" - - [ -n "$values[PHOTO]" ] && printf ' - - ' "${values[PHOTO_TYPE]}" "${values[PHOTO]}" - - [ -n "$values[LOGO]" ] && printf ' - - ' "${values[LOGO_TYPE]}" "${values[LOGO]}" - -printf '
' - -if [ "$PROFILE" = circus ]; then - list_section phone TEL - list_section message EMAIL IMPP URL - list_section address ADR - list_section note NOTE X-CLIENT-REFERRAL - cat <<-END_HTML -
-

$(l10n course_attendance)

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

$(l10n CATEGORIES)

- $(list_categories |while read each; do - printf '' \ - "$(attribsafe "$each")" "$(check_c "$each")" "$(htmlsafe "$each")" - done) -
- END_HTML -elif [ "$PROFILE" = medical ]; then - list_section address ADR - list_section phone TEL EMAIL IMPP URL - cat <<-END_HTML -
-

$(l10n X-HEALTH-INSURANCE)

- - - - - -
- END_HTML - list_section note NOTE X-CLIENT-REFERRAL -fi - - -cat < - - - - - - - - -END_HTML