]> git.plutz.net Git - confetti/blobdiff - templates/edit_course.sh
Added AGPL License notice to every file
[confetti] / templates / edit_course.sh
index ff932a1d5150e6e7461edc9d5d8f6b25d6bcb79f..3fa544e8b76e75349613b5c6b9118418837ec9f4 100755 (executable)
@@ -1,3 +1,19 @@
+# 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)"
@@ -132,6 +148,21 @@ done
 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">'