-# Copyright 2014 - 2019 Paul Hänsch
+# Copyright 2014 - 2019, 2021 Paul Hänsch
#
# This file is part of Confetti.
#
w_filter_item "${fil%%:*}" "${fil#*:}" $n
n=$((n + 1))
done
- w_filter_item any '' $n
+ [ "$n" -eq 0 -o "$(GET newfilter)" ] && w_filter_item any '' $n
)
-
+ [button type="submit" name="choice" value="new_filter" $(l10n filter_more)]
[fieldset class="order"
[legend $(l10n filter_order):]
- [label [radio "order" "firstname" $( [ "$order" = firstname ] && printf checked )] $(l10n filter_firstname)]
[label [radio "order" "lastname" $( [ "$order" = lastname ] && printf checked )] $(l10n filter_lastname)]
+ [label [radio "order" "firstname" $( [ "$order" = firstname ] && printf checked )] $(l10n filter_firstname)]
[label [radio "order" "bdate" $( [ "$order" = bdate ] && printf checked )] $(l10n filter_bdate)]
]
- [button type="submit" name="choice" value="new_filter" $(l10n filter_apply)]
+ [button type="submit" name="choice" value="filter" $(l10n filter_apply)]
[button type="submit" name="choice" value="del_filter" $(l10n filter_cancel)]
+ [button type="submit" name="choice" value="export_csv" $(l10n export_csv)]
]
EOF
}
cnt="$(pdi_count "$card" "$item")"
case $item in
- FN) printf '[h2 .item .FN . %s]' "$(pdi_value "$card" FN |pdi_unescape |HTML)"
+ FN) printf '[h2 .item .FN . %s]' "$(pdi_value "$card" FN |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 |pdi_unescape |HTML)"
+ printf '[span .item .NICKNAME . aka. "%s"]' \
+ "$(pdi_value "$card" NICKNAME $c |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 |pdi_unescape |HTML)" \
- "$(pdi_value "$card" EMAIL $c |pdi_unescape |HTML)"
+ "$(pdi_value "$card" EMAIL $c |unescape |HTML)" \
+ "$(pdi_value "$card" EMAIL $c |unescape |HTML)"
done
;;
TEL)
[ "$teltype" ] \
&& printf '[span .item .TEL [span .type . %s:] %s]' \
"$(l10n "TYPE=$teltype" |HTML)" \
- "$(pdi_value "$card" TEL $c |pdi_unescape |HTML)" \
+ "$(pdi_value "$card" TEL $c |unescape |HTML)" \
|| printf '[span .item .TEL . %s]' \
- "$(pdi_value "$card" TEL $c |pdi_unescape |HTML)"
+ "$(pdi_value "$card" TEL $c |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]
- ' "$(pdi_unescape "$hi_name" |HTML)" \
- "$(l10n hi_number)" "$(pdi_unescape "$hi_number" |HTML)" \
- "$(l10n hi_status)" "$(pdi_unescape "$hi_status" |HTML)"
+ ' "$(unescape "$hi_name" |HTML)" \
+ "$(l10n hi_number)" "$(unescape "$hi_number" |HTML)" \
+ "$(l10n hi_status)" "$(unescape "$hi_status" |HTML)"
done
;;
therapies)
printf '[h3 %s]' "$(l10n therapies)"
(cd "$_DATA/therapies/"; printf '%s\n' "${client}".*.tpy) \
| while read tpyfile; do
- [ "$tpyfile" = "${client}.*.tpy" ] && break
+ [ "$tpyfile" = "${client}.*.tpy" ] \
+ && printf '[a .item .therapy href="/therapies/%s/new" . +]' "${client}" \
+ && break
tpy="${tpyfile%.tpy}";
tpydates="$(sed -En 's;^session[0-9]+_date:;;p;' "$_DATA/therapies/$tpyfile" \
| sort \
printf '[a .item .therapy href="/therapies/%s" . %s] ' \
"${tpy%.*}/${tpy#*.}" "$(HTML "${tpydates:--}")"
done |sort -n
- printf '[a .item .therapy href="/therapies/%s/new" . +]' "${client}"
;;
*)[ $cnt -gt 0 ] && printf '[h3 %s]' "$(l10n "$item")"
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" |pdi_unescape |HTML)"
+ "$(pdi_value "$card" "$item" $c |sed -r "s;(straße|weg|damm|allee|ufer);${shy}\1;g" |unescape |HTML)"
done
;;
esac
$N
EOF
else
- N="$(pdi_value "$card" FN |pdi_unescape)"
- n1="${N%%[a-z]*}" n1="${N#$n1}"
- [ "$n1" ] || n1="${N##* }"
+ N="$(pdi_value "$card" FN |unescape)"
+ n1="${N##* }"
n2="${N%$n1}"
fi
printf '
[input .item .N name="5N" placeholder="%s" value="%s"]
' "$(l10n "$item")" \
"$(l10n n_pre)" "$(HTML "$n4")" \
- "$(l10n n_first)" "$(HTML "${n2}${n3:+ }${n3}")" \
+ "$(l10n n_first)" "$(HTML "${n2}$([ "$n2" -a "$n3" ] && printf ' ')${n3}")" \
"$(l10n n_last)" "$(HTML "$n1")" \
"$(l10n n_post)" "$(HTML "$n5")"
;;