check_a() {
egrep -q "^${1}.${id}$" "$_DATA/mappings/attendance" && setchecked
}
+check_c() {
+ for n in CATEGORIES CATEGORIES{0..100}; do
+ if [ -n "${values[$n]+x}" ]; then
+ [ "${values[$n]}" = "$1" ] && setchecked && break
+ else
+ break
+ fi
+ done
+}
+
teltype() {
cat <<-EOF
<select class="item phonetype" name="phonetype">
printf '<label><input type="checkbox" name="attendance" value="%s" %s/>%s</label>' \
"$(attribsafe "$each")" "$(check_a "$each")" "$(htmlsafe "$cname")"
done)
+ <h3>$(l10n CATEGORIES)</h3>
+ $(list_categories |while read each; do
+ printf '<label><input type="checkbox" name="CATEGORIES" value="%s" %s/>%s</label>' \
+ "$(attribsafe "$each")" "$(check_c "$each")" "$(htmlsafe "$each")"
+ done)
</div>
END_HTML
elif [ "$PROFILE" = medical ]; then
cname="$(sed -rn 's:^SUMMARY\:(.*)$:\1:p' "$_DATA/ical/$each")"
printf ' <li><a class="item attendance" href="?p=courses#%s">%s</a></li>' "$each" "$(htmlsafe $cname)"
done
- printf '</ul></div>'
+ printf '</ul>'
+ list_items CATEGORIES
+ printf '</div>'
+
elif [ "$PROFILE" = medical ]; then
list_items ADR
list_items URL