# 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 . list_items(){ item="$1" [ -n "${values[$item]+x}" ] && \ printf '

%s

\n' "$(l10n $item)" for n in "$item" "$item"{0..100}; do if [ -z "${values[$n]+x}" ]; then break else case "$item" in EMAIL) printf '%s\n' \ "$(attribsafe "${values[$n]}")" "$(htmlsafe "${values[$n]}")" ;; *) printf '%s\n' \ "$item" "$(htmlsafe ${values[$n]})" ;; esac; fi done } list_section(){ printf '
' "$1" shift 1 for each in $@; do list_items "$each" done printf '
' } n=$(printf %s "$values[N+3] $values[N+1] $values[N+2] $values[N+0] $values[N+4]" \ | sed -r ':X;$!{N;bX}; s;^[\n ]+;;; s;[\n ]+$;;; s;[\r\t\n ]+; ;g;' ) fullname="${n:-${values[FN]:-${values[NICKNAME]}}}" hi_company="${values[X-HEALTH-INSURANCE+0]}" hi_number="${values[X-HEALTH-INSURANCE+1]}" hi_status="${values[X-HEALTH-INSURANCE+2]}" printf '

%s

' "$fullname" [ -n "$values[GENDER]" ] && printf ' %s ' "$(l10n "$values[GENDER]")" for n in NICKNAME NICKNAME{0..100}; do [ -z "${values[$n]+x}" ] && break \ || printf ' aka. %s ' "$(htmlsafe ${values[$n]})" done [ -n "$values[BDAY]" ] && printf ' *: %s ' "$(htmlsafe "$values[BDAY]")" [ -n "$values[X-ZACK-JOINDATE]" ] && printf ' %s: %s ' "$(l10n label_join)" "$(htmlsafe "$values[X-ZACK-JOINDATE]")" [ -n "$values[X-ZACK-LEAVEDATE]" ] && printf ' %s:%s ' "$(l10n label_leave)" "$(htmlsafe "$values[X-ZACK-LEAVEDATE]")" [ -n "$values[SOUND]" ] && printf ' ' "$values[SOUND]" [ -n "$values[PHOTO]" ] && printf ' ' "${values[PHOTO_TYPE]}" "${values[PHOTO]}" [ -n "$values[LOGO]" ] && printf ' ' "${values[LOGO_TYPE]}" "${values[LOGO]}" if [ "$PROFILE" = circus ]; then printf '
' list_section phone TEL list_section message EMAIL IMPP URL list_section address ADR list_section note NOTE printf '

%s

' list_items CATEGORIES printf '
' elif [ "$PROFILE" = medical ]; then list_items ADR list_items URL printf '' list_section phone TEL EMAIL IMPP printf '

%s

' "$(l10n X-HEALTH-INSURANCE)" [ -n "$hi_company" ] && printf '%s' \ "$(htmlsafe "$hi_company")" [ -n "$hi_number" ] && printf ' %s' \ "$(l10n hi_number)" "$(htmlsafe "$hi_number")" [ -n "$hi_status" ] && printf ' %s' \ "$(l10n hi_status)" "$(htmlsafe "$hi_status")" printf '
' list_section note NOTE X-CLIENT-REFERRAL printf '

%s

' fi