X-Git-Url: https://git.plutz.net/?p=confetti;a=blobdiff_plain;f=templates%2Fedit_client.sh;h=2b0c004bf07e0daeb5728f9c032c02b86a9c0320;hp=586fa697b074d2d1502f79807ae175ae2438a64b;hb=aedb6776919b351df7df7c310c238c41317ddc44;hpb=2d79e3831a65f8b3a54aa2514ef1e65c4b073cf2 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