-# Copyright 2014 - 2019 Paul Hänsch
+# Copyright 2014 - 2019, 2021 Paul Hänsch
#
# This file is part of Confetti.
#
[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
}
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" "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
}
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"]' \
+ printf '[span .item .NICKNAME . aka. "%s"]' \
"$(pdi_value "$card" NICKNAME $c |pdi_unescape |HTML)"
done
;;
[ $cnt -gt 0 ] && printf '[h3 %s]' "$(l10n TEL)"
seq 1 $cnt |while read c; do
teltype="$(pdi_attrib "$card" TEL $c TYPE)"
+ ttl10="$(l10n "TYPE=$teltype")" # See below: HTML-Escape teltype if there is no translation (translations are always pre escaped)
[ "$teltype" ] \
&& printf '[span .item .TEL [span .type . %s:] %s]' \
- "$(l10n "TYPE=$teltype" |HTML)" \
+ "$([ "$ttl10" = "TYPE=$teltype" ] && { printf %s "$ttl10" |HTML; } || printf %s "$ttl10")" \
"$(pdi_value "$card" TEL $c |pdi_unescape |HTML)" \
|| printf '[span .item .TEL . %s]' \
"$(pdi_value "$card" TEL $c |pdi_unescape |HTML)"
(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" \
EOF
else
N="$(pdi_value "$card" FN |pdi_unescape)"
- n1="${N%%[a-z]*}" n1="${N#$n1}"
- [ "$n1" ] || n1="${N##* }"
+ 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")"
;;
$(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
;;