]> git.plutz.net Git - confetti/blobdiff - templates/view_attendee.sh
simplified vcf parser, enabled field for health insurance
[confetti] / templates / view_attendee.sh
index e1b6530b49406a224763e1460128dd1a8b23d1b2..bdfdc6a621ebe2fe5ebfb0335f072d353d5c3352 100755 (executable)
 # You should have received a copy of the GNU Affero General Public License
 # along with Confetti.  If not, see <http://www.gnu.org/licenses/>. 
 
+n=$(printf %s "$values[N]" \
+    | sed -rn 's:^([^;]*)(\;[^;]*)(\;[^;]*)?(\;[^;]*)?(\;[^;]*)?$:\4 \2 \3 \1 \5:gp' \
+    | sed -r 's:,: :;s:\;: :g;s: +: :g;s:^ $::;'
+   )
+fullname="${n:-${values[FN]:-${values[NICKNAME]}}}"
+
 cat <<END_HTML
   <div class="section basic">
-    <h2 class="item FN">$values[FN]</h2>
+    <h2 class="item FN">$fullname</h2>
     ${values[GENDER]:+<span class="item GENDER">$(l10n $values[GENDER])</span>}
 
     $(for n in NICKNAME NICKNAME{0..10}; do