X-Git-Url: https://git.plutz.net/?a=blobdiff_plain;f=templates%2Fedit_client.sh;h=ed51dde51fdec9ef839c9f41983b2097fba5e707;hb=79f9f41d6a868178da383ab1382f10f5e9cfff16;hp=586fa697b074d2d1502f79807ae175ae2438a64b;hpb=891dee2c19bd2836e6818bffce1174f30c5d1ae5;p=lobster
diff --git a/templates/edit_client.sh b/templates/edit_client.sh
index 586fa69..ed51dde 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,15 @@ 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]:+}"
+
+ $(l10n EMAIL)
+
+ $(for n in EMAIL{0..10}; do
+ printf "${values[$n]:+}"
done)
${values[IMPP]:+$(l10n IMPP)
}
$(for n in IMPP IMPP{0..10}; do
@@ -137,6 +157,7 @@ cat <
+