X-Git-Url: https://git.plutz.net/?a=blobdiff_plain;f=templates%2Fedit_client.sh;h=2b0c004bf07e0daeb5728f9c032c02b86a9c0320;hb=bea66ef5029455845cd3fc66252b8b0aad4cd053;hp=586fa697b074d2d1502f79807ae175ae2438a64b;hpb=891dee2c19bd2836e6818bffce1174f30c5d1ae5;p=lobster
diff --git a/templates/edit_client.sh b/templates/edit_client.sh
index 586fa69..2b0c004 100755
--- a/templates/edit_client.sh
+++ b/templates/edit_client.sh
@@ -15,11 +15,29 @@
# You should have received a copy of the GNU Affero General Public License
# along with Confetti. If not, see .
+setchecked() {
+ printf 'checked="checked"'
+}
+setselected() {
+ printf 'selected="selected"'
+}
check_gen() {
- [ "$values[GENDER]" = "$1" ] && echo 'selected="selected"'
+ [ "$values[GENDER]" = "$1" ] && setselected
}
check_a() {
- egrep -q "^${1}.${id}$" "$_DATA/mappings/attendance" && echo 'checked="checked"'
+ egrep -q "^${1}.${id}$" "$_DATA/mappings/attendance" && setchecked
+}
+teltype() {
+ cat <<-EOF
+
+ EOF
}
n_last="$(printf %s "$values[N]" |sed -rn 's:^([^;]*;){0} *([^;]*).*$:\2:p')"
@@ -85,13 +103,13 @@ cat <
$(l10n TEL)
-
+ $(teltype "${tags[TEL_TYPE]}")
$(for n in TEL{0..10}; do
- echo "${values[$n]:+}"
+ printf "${values[$n]:+$(teltype "${tags[$n_TYPE]}")}"
done)
${values[EMAIL]:+$(l10n EMAIL)
}
$(for n in EMAIL EMAIL{0..10}; do
- echo "${values[$n]:+}"
+ printf "${values[$n]:+}"
done)
${values[IMPP]:+$(l10n IMPP)
}
$(for n in IMPP IMPP{0..10}; do