--- /dev/null
+#!/bin/sh
+
+. $_EXEC/pdiread.sh
+. $_EXEC/cards/l10n.sh
+. $_EXEC/cards/list.sh
+
+upcase=' y;abcdefghijklmnopqrstuvwxyzäöüé;ABCDEFGHIJKLMNOPQRSTUVWXYZÄÖÜÉ;; '
+
+filter="$(GET f)"
+order="$(GET o)"
+
+[ "$order" ] || order=firstname
+
+list_attendance() {
+ grep -F " ${cardfile##*/}" "$_DATA/mappings/attendance" |while read each discard; do
+ { pdi_value "$(pdi_load "$_DATA/ical/$each")" SUMMARY || l10n "(unnamed course)"; } |unescape
+ done \
+ | sed -E 's;";\\";g;'
+}
+
+list_item() {
+ local item="$1"
+ local cnt="$(pdi_count "$card" "$item")"
+ local ret=''
+
+ seq 1 $cnt |while read n; do case $item in
+ TEL)
+ tel="$(pdi_value "$card" "$item" "$n" |unescape)"
+ [ "$tel" ] && printf '%s: %s\n' "$(l10n "TYPE=$(pdi_attrib "$card" "$item" "$n" TYPE)")" "$tel"
+ ;;
+ GENDER)
+ gen="$(pdi_value "$card" "$item" "$n" |unescape)"
+ [ "$gen" ] && l10n "gender_$gen"
+ ;;
+ *) pdi_value "$card" "$item" "$n" |unescape
+ ;;
+ esac; done \
+ | sed -E 's;";\\";g;'
+}
+
+printf '%s\r\n' \
+ 'Content-Type: text/csv; charset=utf-8' \
+ 'Content-Disposition: inline; filename="confetti_export_'$(date +%F_%T)'.csv"' \
+ ''
+
+printf '"%s";"%s";"%s";"%s";"%s";"%s";"%s";"%s";"%s"\n' \
+ "$(l10n FN)" "$(l10n GENDER)" "$(l10n BDAY)" \
+ "$(l10n TEL)" "$(l10n EMAIL)" "$(l10n ADR)" \
+ "$(l10n NOTE)" "$(l10n courses)" "$(l10n CATEGORIES)" \
+| sed -E 's;­\;;;g;'
+
+
+filter_cards \
+| order_cards \
+| while read cardfile; do
+ card="$(pdi_load "$cardfile")"
+ printf '"%s";"%s";"%s";"%s";"%s";"%s";"%s";"%s";"%s"\n' \
+ "$(list_item FN)" "$(list_item GENDER)" "$(list_item BDAY)" \
+ "$(list_item TEL)" "$(list_item EMAIL)" "$(list_item ADR)" \
+ "$(list_item NOTE)" "$(list_attendance)" "$(list_item CATEGORIES)"
+done
filter_more) printf %s "+ mehr Filter";;
filter_apply) printf %s "Filtern";;
filter_cancel) printf %s "Filter löschen";;
+ export_csv) printf %s "Liste als CSV-Datei";;
# UI Labels Special
course_attendance) printf %s "Kurs­teil­nahme";;
margin-top: .5em; margin-bottom: .5em;
}
+form.filter button[value=export_csv] { margin-left: 1em; }
+
body.courses form .order { display: inline-block; margin-right: 2em;}
body.cards form.newcard { display: flex; }