From: paul Date: Sat, 12 Nov 2016 02:47:09 +0000 (+0000) Subject: make use of improved parser X-Git-Url: https://git.plutz.net/?a=commitdiff_plain;h=70c5786a6b3dd9c6561e2f19f2827ce92191c13f;p=lobster make use of improved parser svn path=/trunk/; revision=144 --- diff --git a/templates/edit_attendee.sh b/templates/edit_attendee.sh index 047879a..e27592c 100755 --- a/templates/edit_attendee.sh +++ b/templates/edit_attendee.sh @@ -1,4 +1,4 @@ -# Copyright 2014, 2015 Paul Hänsch +# Copyright 2014 - 2016 Paul Hänsch # # This file is part of Confetti. # @@ -22,12 +22,6 @@ 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 X-ZACK-JOINDATE X-ZACK-LEAVEDATE EMAIL TEL IMPP ADR URL NOTE) [ -z "$values[UID]" ] && values[UID]="$(uuidgenerator)" @@ -37,11 +31,11 @@ cat <

$(l10n N)

- - - - - + + + + + }" + echo "${values[$n]+}" done)

$(l10n BDAY)

@@ -70,15 +64,15 @@ cat <' echo ' ' fi) - ${values[PHOTO]:+} - ${values[LOGO]:+} + ${values[PHOTO]+} + ${values[LOGO]+}

$(l10n TEL)

$(for n in TEL{0..10}; do - echo "${values[$n]:+}" + echo "${values[$n]+}" done)
@@ -86,11 +80,11 @@ cat <$(l10n EMAIL) $(for n in EMAIL{0..10}; do - echo "${values[$n]:+}" + echo "${values[$n]+}" done) - ${values[IMPP]:+

$(l10n IMPP)

} + ${values[IMPP]+

$(l10n IMPP)

} $(for n in IMPP IMPP{0..10}; do - echo "${values[$n]:+}" + echo "${values[$n]+}" done) @@ -98,11 +92,11 @@ cat <$(l10n ADR) $(for n in ADR{0..10}; do - echo "${values[$n]:+}" + echo "${values[$n]+}" done) - ${values[URL]:+

$(l10n URL)

} + ${values[URL]+

$(l10n URL)

} $(for n in URL URL{0..10}; do - echo "${values[$n]:+}" + echo "${values[$n]+}" done) @@ -110,7 +104,7 @@ cat <$(l10n NOTE) $(for n in NOTE{0..10}; do - echo "${values[$n]:+}" + echo "${values[$n]+}" done) diff --git a/templates/view_attendee.sh b/templates/view_attendee.sh index 1394ced..5966729 100755 --- a/templates/view_attendee.sh +++ b/templates/view_attendee.sh @@ -15,9 +15,8 @@ # You should have received a copy of the GNU Affero General Public License # along with Confetti. If not, see . -n=$(printf %s "$values[N]" \ - | sed -rn 's:^([^;]*)(\;[^;]*)(\;[^;]*)?(\;[^;]*)?(\;[^;]*)?$:\4 \2 \3 \1 \5:gp' \ - | sed -r 's:,: :;s:\;: :g;s: +: :g;s:^ $::;' +n=$(printf %s "$values[N+3] $values[N+1] $values[N+2] $values[N+0] $values[N+4]" \ + | sed -r ':X;$!{N;bX}; s;^[\n ]+;;; s;[\n ]+$;;; s;[\r\t\n ]+; ;g;' ) fullname="${n:-${values[FN]:-${values[NICKNAME]}}}"