X-Git-Url: https://git.plutz.net/?a=blobdiff_plain;f=templates%2Fedit_client.sh;h=2b0c004bf07e0daeb5728f9c032c02b86a9c0320;hb=015242823eb4a79cf615bef6951b0af6bd0a5b01;hp=ddb33c3d352492d886b3e8fd4d191d6ad2ca0ef6;hpb=3df0e6c3d9ff72b4ace395bb78582765ef4bc6fb;p=lobster
diff --git a/templates/edit_client.sh b/templates/edit_client.sh
index ddb33c3..2b0c004 100755
--- a/templates/edit_client.sh
+++ b/templates/edit_client.sh
@@ -1,4 +1,4 @@
-# Copyright 2014, 2015 Paul Hänsch
+# Copyright 2014 - 2016 Paul Hänsch
#
# This file is part of Confetti.
#
@@ -15,18 +15,40 @@
# 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')"
+n_first="$(printf %s "$values[N]" |sed -rn 's:^([^;]*;){1} *([^;]*).*$:\2:p')"
+n_middle="$(printf %s "$values[N]" |sed -rn 's:^([^;]*;){2} *([^;]*).*$:\2:p')"
+n_pre="$(printf %s "$values[N]" |sed -rn 's:^([^;]*;){3} *([^;]*).*$:\2:p')"
+n_post="$(printf %s "$values[N]" |sed -rn 's:^([^;]*;){4} *([^;]*)*$:\2:p')"
-n_last="$(echo "$values[N]" |sed -rn 's:^([^;]*;){0} *([^;]*).*$:\2:p')"
-n_first="$(echo "$values[N]" |sed -rn 's:^([^;]*;){1} *([^;]*).*$:\2:p')"
-n_middle="$(echo "$values[N]" |sed -rn 's:^([^;]*;){2} *([^;]*).*$:\2:p')"
-n_pre="$(echo "$values[N]" |sed -rn 's:^([^;]*;){3} *([^;]*).*$:\2:p')"
-n_post="$(echo "$values[N]" |sed -rn 's:^([^;]*;){4} *([^;]*)*$:\2:p')"
+hi_company="$(printf %s "${values[X-HEALTH-INSURANCE]}" |cut -d\; -f1)"
+hi_number="$(printf %s "${values[X-HEALTH-INSURANCE]}" |cut -d\; -f2)"
+hi_status="$(printf %s "${values[X-HEALTH-INSURANCE]}" |cut -d\; -f3)"
SUP_FIELDS=(N NICKNAME GENDER BDAY ADR TEL EMAIL X-HEALTH-INSURANCE X-HEALTH-INSURANCE-NOCONTRIB IMPP URL NOTE X-CLIENT-REFERRAL)
@@ -56,7 +78,7 @@ cat <$(l10n BDAY)
-
+
$(if [ -n "$values[SOUND]" ]; then
echo '