-# 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')"
-
SUP_FIELDS=(N NICKNAME GENDER BDAY X-ZACK-JOINDATE X-ZACK-LEAVEDATE EMAIL TEL IMPP ADR URL NOTE)
[ -z "$values[UID]" ] && values[UID]="$(uuidgenerator)"
<input type="hidden" name="card" value="${id}"/>
<div class="section basic">
<h3>$(l10n N)</h3>
- <input class="item N" name="3N" placeholder="$(l10n n_pre)" value="$n_pre" />
- <input class="item N" name="1N" placeholder="$(l10n n_first)" value="$n_first" />
- <input class="item N" name="2N" placeholder="$(l10n n_middle)" value="$n_middle" />
- <input class="item N" name="0N" placeholder="$(l10n n_last)" value="$n_last" />
- <input class="item N" name="4N" placeholder="$(l10n n_post)" value="$n_post" />
+ <input class="item N" name="3N" placeholder="$(l10n n_pre)" value="$values[N+3]" />
+ <input class="item N" name="1N" placeholder="$(l10n n_first)" value="$values[N+1]" />
+ <input class="item N" name="2N" placeholder="$(l10n n_middle)" value="$values[N+2]" />
+ <input class="item N" name="0N" placeholder="$(l10n n_last)" value="$values[N+0]" />
+ <input class="item N" name="4N" placeholder="$(l10n n_post)" value="$values[N+4]" />
<select class="item GENDER" name="GENDER">
<option value="" disabled="disabled">$(l10n GENDER)</option>
</select>
$(for n in NICKNAME NICKNAME{0..10}; do
- echo "${values[$n]:+<input class="item NICKNAME" name="NICKNAME" placeholder="$(l10n NICKNAME)" value="$values[$n]" />}"
+ echo "${values[$n]+<input class="item NICKNAME" name="NICKNAME" placeholder="$(l10n NICKNAME)" value="$values[$n]" />}"
done)
<h3>$(l10n BDAY)</h3>
echo ' <source type="audio/ogg" src="data:audio/ogg;base64,'$values[SOUND]'" />'
echo ' </audio>'
fi)
- ${values[PHOTO]:+<img class="item PHOTO" src="data:image/$values[PHOTO_TYPE];base64,$values[PHOTO]" />}
- ${values[LOGO]:+<img class="item LOGO" src="data:image/$values[LOGO_TYPE];base64,$values[LOGO]" />}
+ ${values[PHOTO]+<img class="item PHOTO" src="data:image/$values[PHOTO_TYPE];base64,$values[PHOTO]" />}
+ ${values[LOGO]+<img class="item LOGO" src="data:image/$values[LOGO_TYPE];base64,$values[LOGO]" />}
</div>
<div class="section phone">
<h3>$(l10n TEL)</h3>
<input class="item TEL" name="TEL" value="$values[TEL]" />
$(for n in TEL{0..10}; do
- echo "${values[$n]:+<input class="item TEL" name="TEL" value="'$values[$n]'" />}"
+ echo "${values[$n]+<input class="item TEL" name="TEL" value="'$values[$n]'" />}"
done)
</div>
<h3>$(l10n EMAIL)</h3>
<input class="item EMAIL" name="EMAIL" value="$values[EMAIL]" />
$(for n in EMAIL{0..10}; do
- echo "${values[$n]:+<input class="item EMAIL" name="EMAIL" value="$values[$n]" />}"
+ echo "${values[$n]+<input class="item EMAIL" name="EMAIL" value="$values[$n]" />}"
done)
- ${values[IMPP]:+<h3>$(l10n IMPP)</h3>}
+ ${values[IMPP]+<h3>$(l10n IMPP)</h3>}
$(for n in IMPP IMPP{0..10}; do
- echo "${values[$n]:+<input class="item IMPP" name="IMPP" value="$values[$n]" />}"
+ echo "${values[$n]+<input class="item IMPP" name="IMPP" value="$values[$n]" />}"
done)
</div>
<h3>$(l10n ADR)</h3>
<textarea class="item ADR" name="ADR">$values[ADR]</textarea>
$(for n in ADR{0..10}; do
- echo "${values[$n]:+<textarea class="item ADR" name="ADR">$values[$n]</textarea>}"
+ echo "${values[$n]+<textarea class="item ADR" name="ADR">$values[$n]</textarea>}"
done)
- ${values[URL]:+<h3>$(l10n URL)</h3>}
+ ${values[URL]+<h3>$(l10n URL)</h3>}
$(for n in URL URL{0..10}; do
- echo "${values[$n]:+<input class="item URL" name="URL" value="$values[$n]" />}"
+ echo "${values[$n]+<input class="item URL" name="URL" value="$values[$n]" />}"
done)
</div>
<h3>$(l10n NOTE)</h3>
<textarea class="item NOTE" name="NOTE">$values[NOTE]</textarea>
$(for n in NOTE{0..10}; do
- echo "${values[$n]:+<textarea class="item NOTE" name="NOTE">$values[$n]</textarea>}"
+ echo "${values[$n]+<textarea class="item NOTE" name="NOTE">$values[$n]</textarea>}"
done)
</div>