X-Git-Url: https://git.plutz.net/?p=confetti;a=blobdiff_plain;f=templates%2Fedit_client.sh;fp=templates%2Fedit_client.sh;h=ddb33c3d352492d886b3e8fd4d191d6ad2ca0ef6;hp=0000000000000000000000000000000000000000;hb=3df0e6c3d9ff72b4ace395bb78582765ef4bc6fb;hpb=69e661b5c8ec195bd3c4998a623a60607b47059e
diff --git a/templates/edit_client.sh b/templates/edit_client.sh
new file mode 100755
index 0000000..ddb33c3
--- /dev/null
+++ b/templates/edit_client.sh
@@ -0,0 +1,133 @@
+# Copyright 2014, 2015 Paul Hänsch
+#
+# This file is part of Confetti.
+#
+# Confetti is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# Confetti is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with Confetti. If not, see .
+
+check_gen() {
+ [ "$values[GENDER]" = "$1" ] && echo 'selected="selected"'
+}
+check_a() {
+ egrep -q "^${1}.${id}$" "$_DATA/mappings/attendance" && echo 'checked="checked"'
+}
+
+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')"
+
+SUP_FIELDS=(N NICKNAME GENDER BDAY ADR TEL EMAIL X-HEALTH-INSURANCE X-HEALTH-INSURANCE-NOCONTRIB IMPP URL NOTE X-CLIENT-REFERRAL)
+
+[ -z "$values[UID]" ] && values[UID]="$(uuidgenerator)"
+
+cat <
+
+
+
$(l10n N)
+
+
+
+
+
+
+
+
+ $(for n in NICKNAME NICKNAME{0..10}; do
+ echo "${values[$n]:+}"
+ done)
+
+