-# Copyright 2014, 2015 Paul Hänsch
+# Copyright 2014 - 2016 Paul Hänsch
#
# This file is part of Confetti.
#
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')"
+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')"
+
+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)
done)
<h3>$(l10n BDAY)</h3>
- <input class="item BDAY" name="BDAY" value="$values[BDAY]" />
+ <input class="item BDAY" name="BDAY" value="$values[BDAY]" placeholder="YYYY-MM-DD" />
$(if [ -n "$values[SOUND]" ]; then
echo ' <audio controls="controls" class="item SOUND">'
<div class="section insurance">
<h3>$(l10n X-HEALTH-INSURANCE)</h3>
+ <input type="radio" name="hi_select" value="list" id="hi_select_list" checked /><label for="hi_select_list">$(l10n hi_from_list)</label><!--
+ --><input type="radio" name="hi_select" value="other" id="hi_other"><label for="hi_other">$(l10n hi_other)</label>
<select class="item" name="hi_company">
- <option value="" disabled="disabled" selected="selected">$(l10n hi_company)</option>
- $(list_hi_companies |while read f; do echo "<option value=\"$f\">$(l10n $f)</option>"; done)
+ <option value="" disabled="disabled" ${hi_company:-selected}>$(l10n hi_company)</option>
+ $(list_hi_companies |while read f; do
+ [ "$f" = "$hi_company" ] \
+ && printf '<option value="%s" selected>%s</option>' "$f" "$f" \
+ || printf '<option value="%s">%s</option>' "$f" "$f"
+ done)
</select>
- <input class="item hi_number" name="hi_number" value="$values[hi_number]" placeholder="$(l10n hi_number)" />
+ <input type="text" name="hi_other" value="$hi_company" placeholder="$(l10n hi_company)" />
+ <input name="hi_number" value="$hi_number" placeholder="$(l10n hi_number)" />
+ <input name="hi_status" value="$hi_status" placeholder="$(l10n hi_status)" />
</div>