+# Copyright 2014 Paul Hänsch
+#
+# This file is part of Confetti.
+#
+# Confetti is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# Confetti is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with Confetti. If not, see <http://www.gnu.org/licenses/>.
SUP_FIELDS=(SUMMARY COMMENT)
[ -z "$values[UID]" ] && values[UID]="$(dbus-uuidgen)"
echo ' </select>'
echo ' </div>'
+echo ' <div class="section select_attendance">'
+echo ' <span class="sectitle">'$(l10n course_attendance)'</span>'
+echo ' <select class="item attendance" name="attendance" multiple="multiple">'
+listcards |while read card; do
+ cfile="$_DATA/vcard/$card"
+ aname=$(sed -rn 's:^N(;[^"\:]+|;"[^"]+")*\:([^;]*)(\;[^;]*)(\;[^;]*)?(\;[^;]*)?(\;[^;]*)?$:\5 \3 \4 \2 \6:p' "$cfile" \
+ |sed -r 's:,: :;s:\;: :g;s: +: :g' \
+ |tr -d '\r'
+ )
+ selected=$(sed -rn "s:^$id\t$card\$:selected=\"selected\":p" $_DATA/mappings/attendance)
+ echo ' <option value="'$card'" '$selected'>'$aname'</option>'
+done
+echo ' </select>'
+echo ' </div>'
+
echo ' <div class="section control">'
echo ' <button class="item control" type="submit" name="action" value="addfield">'$(l10n edit_addfield)'</button>'
echo ' <select class="item control" name="newfield">'