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
+ { pdi_value "$(pdi_load "$_DATA/ical/$each")" SUMMARY || l10n "(unnamed course)"; } |pdi_unescape
done \
| sed -E 's;";\\";g;'
}
seq 1 $cnt |while read n; do case $item in
TEL)
- tel="$(pdi_value "$card" "$item" "$n" |unescape)"
+ tel="$(pdi_value "$card" "$item" "$n" |pdi_unescape)"
ttype="$(pdi_attrib "$card" "$item" "$n" TYPE)"
if [ "$tel" -a "$ttype" ]; then
printf '%s: %s\n' "$(l10n "TYPE=$ttype")" "$tel"
fi
;;
GENDER)
- gen="$(pdi_value "$card" "$item" "$n" |unescape)"
+ gen="$(pdi_value "$card" "$item" "$n" |pdi_unescape)"
[ "$gen" ] && l10n "gender_$gen"
;;
- *) pdi_value "$card" "$item" "$n" |unescape
+ *) pdi_value "$card" "$item" "$n" |pdi_unescape
;;
esac; done \
| sed -E 's;";\\";g;'
uid="$(timeid)$(randomid)" # 32 Octets UID, starting with timestamp
card="${uid}.vcf"
-vcf_escape(){
- for each in "$@"; do
- printf %s\\n "$each" \
- | sed -E ':X;$!{N;bX}; s;\r\n;\n;g; s;([;,\\]);\\\1;g; s;\n;\\n;g;'
- done \
- | sed -E ':X;$!{N;bX}; s;\n;\;;g'
-}
-
IFS='|' read -r date fn ln bmonth byear tel tcell junk1 email junk2 note <<-EOF
$(POST seed |tr \\t \|)
EOF
cat >"$lockfile" <<-EOF
BEGIN:VCARD
VERSION:4.0
- N:$(vcf_escape "$ln" "$fn" "$mn" "" "")
- FN:$(vcf_escape "${fn}${mn:+ }${mn} ${ln}")
+ N:$(pdi_escape "$ln" "$fn" "$mn" "" "")
+ FN:$(pdi_escape "${fn}${mn:+ }${mn} ${ln}")
BDAY:$(parse_date "${byear}-${bmonth}-01")
- TEL:$(vcf_escape "$tel")
- TEL;TYPE=CELL:$(vcf_escape "$tcell")
- EMAIL:$(vcf_escape "$email")
+ TEL:$(pdi_escape "$tel")
+ TEL;TYPE=CELL:$(pdi_escape "$tcell")
+ EMAIL:$(pdi_escape "$email")
X-ZACK-JOINDATE:$(parse_date "$date")
ADR:
- NOTE:$(vcf_escape "$note")
+ NOTE:$(pdi_escape "$note")
UID:${uid}
END:VCARD
EOF
[legend $(l10n filter_item):]
$(for field in any name street zip TEL BDAY; do
- printf '[input id="%s%i" type="radio" name="filter_type%i" value="%s" %s]
+ printf '[input id="%s%i" type="radio" .tab name="filter_type%i" value="%s" %s]
[label for="%s%i" %s ]' \
"$field" "$n" "$n" "$field" "$([ "$1" = "$field" ] && printf checked )" \
"$field" "$n" "$(l10n filter_$field)"
done)
- [input type="text" name="filter_text$n" value="$([ "$1" = CATEGORIES ] || HTML "$2")" placeholder="$(l10n filter_placeholder)"]
+ [input type="text" .tab name="filter_text$n" value="$([ "$1" = CATEGORIES ] || HTML "$2")" placeholder="$(l10n filter_placeholder)"]
]
EOF
}
cnt="$(pdi_count "$card" "$item")"
case $item in
- FN) printf '[h2 .item .FN . %s]' "$(pdi_value "$card" FN |unescape |HTML)"
+ FN) printf '[h2 .item .FN . %s]' "$(pdi_value "$card" FN |pdi_unescape |HTML)"
;;
GENDER) printf '[span .item .GENDER . %s]' "$(pdi_value "$card" GENDER |l10n)"
;;
NICKNAME) seq 1 $cnt |while read c; do
printf '[span .item .NICKNAME . aka. "%s"]' \
- "$(pdi_value "$card" NICKNAME $c |unescape |HTML)"
+ "$(pdi_value "$card" NICKNAME $c |pdi_unescape |HTML)"
done
;;
X-ZACK-JOINDATE|X-ZACK-LEAVEDATE) if [ $cnt -gt 0 ]; then
[ $cnt -gt 0 ] && printf '[h3 %s]' "$(l10n EMAIL)"
seq 1 $cnt |while read c; do
printf '[a .item .EMAIL href="mailto:%s" . %s]' \
- "$(pdi_value "$card" EMAIL $c |unescape |HTML)" \
- "$(pdi_value "$card" EMAIL $c |unescape |HTML)"
+ "$(pdi_value "$card" EMAIL $c |pdi_unescape |HTML)" \
+ "$(pdi_value "$card" EMAIL $c |pdi_unescape |HTML)"
done
;;
TEL)
[ "$teltype" ] \
&& printf '[span .item .TEL [span .type . %s:] %s]' \
"$(l10n "TYPE=$teltype" |HTML)" \
- "$(pdi_value "$card" TEL $c |unescape |HTML)" \
+ "$(pdi_value "$card" TEL $c |pdi_unescape |HTML)" \
|| printf '[span .item .TEL . %s]' \
- "$(pdi_value "$card" TEL $c |unescape |HTML)"
+ "$(pdi_value "$card" TEL $c |pdi_unescape |HTML)"
done
;;
X-HEALTH-INSURANCE)
printf '[span .item .hi_company . %s]
[span .item .hi_number [label %s:] %s]
[span .item .hi_status [label %s:] %s]
- ' "$(unescape "$hi_name" |HTML)" \
- "$(l10n hi_number)" "$(unescape "$hi_number" |HTML)" \
- "$(l10n hi_status)" "$(unescape "$hi_status" |HTML)"
+ ' "$(pdi_unescape "$hi_name" |HTML)" \
+ "$(l10n hi_number)" "$(pdi_unescape "$hi_number" |HTML)" \
+ "$(l10n hi_status)" "$(pdi_unescape "$hi_status" |HTML)"
done
;;
therapies)
(cd "$_DATA/therapies/"; printf '%s\n' "${client}".*.tpy) \
| while read tpyfile; do
[ "$tpyfile" = "${client}.*.tpy" ] \
- && printf '[a .item .therapy href="/therapies/%s/new" . +]' "${client}" \
+ && printf '[a .button .therapy href="/therapies/%s/new" . +]' "${client}" \
&& break
tpy="${tpyfile%.tpy}";
tpydates="$(sed -En 's;^session[0-9]+_date:;;p;' "$_DATA/therapies/$tpyfile" \
shy="$(printf '\302\255')"
seq 1 $cnt |while read c; do
printf '[span .item .%s . %s]' "$item" \
- "$(pdi_value "$card" "$item" $c |sed -r "s;(straße|weg|damm|allee|ufer);${shy}\1;g" |unescape |HTML)"
+ "$(pdi_value "$card" "$item" $c |sed -r "s;(straße|weg|damm|allee|ufer);${shy}\1;g" |pdi_unescape |HTML)"
done
;;
esac
$N
EOF
else
- N="$(pdi_value "$card" FN |unescape)"
+ N="$(pdi_value "$card" FN |pdi_unescape)"
n1="${N##* }"
n2="${N%$n1}"
fi
$(pdi_value "$card" X-HEALTH-INSURANCE $c)
EOF
cat <<-EOF
- [input type="radio" name="$item" value="list" #hi_select_list checked]<!--
- -->[label for="hi_select_list" $(l10n hi_from_list)]<!--
- -->[input type="radio" name="$item" value="other" #hi_other checked]<!--
- -->[label for="hi_other" $(l10n hi_other)]<!--
- -->[select class="item" name="hi_company"
+ [radio "$item" "list" .tab #hi_select_list checked][label for="hi_select_list" $(l10n hi_from_list)]
+ [radio "$item" "other" .tab #hi_other][label for="hi_other" $(l10n hi_other)]
+ [select .tab .item name="hi_company"
[option value="" disabled="disabled" $(selected "${hi_name}" "") . $(l10n hi_company)]
$(list_hi_companies |while read f; do
printf '[option value="%s" %s . %s]' "$(pdi_unescape "$f" |HTML)" \
"$(pdi_unescape "$f" |HTML)"
done)
]
- [input type="text" name="hi_other" value="$hi_name" placeholder="$(l10n hi_company)"]
- [input name="hi_number" value="$(pdi_unescape "$hi_number" |HTML)" placeholder="$(l10n hi_number)"]
- [input name="hi_status" value="$(pdi_unescape "$hi_status" |HTML)" placeholder="$(l10n hi_status)"]
+ [input type="text" .tab name="hi_other" value="$hi_name" placeholder="$(l10n hi_company)"]
+ [input type="text" name="hi_number" value="$(pdi_unescape "$hi_number" |HTML)" placeholder="$(l10n hi_number)"]
+ [input type="text" name="hi_status" value="$(pdi_unescape "$hi_status" |HTML)" placeholder="$(l10n hi_status)"]
EOF
done
;;