3 . "${_EXEC}"/pdiread.sh
8 local coursefile="$_DATA/ical/$1"
11 . $_EXEC/session_lock.sh
13 if ! tempfile="$(CHECK_SLOCK "$coursefile")"; then
14 printf '[div .message %s]' "$(l10n "This course is not set up for editing within this session.")"
16 course="$(pdi_load "$tempfile")"
18 [form .course #${coursefile##*/} action="/courses/update_course.sh" method="POST"
19 [input type="hidden" name="course" value="${coursefile##*/}"]
20 [input type="hidden" name="tid" value="$(transid ${tempfile})"]
21 [div .section .basic . $(
22 edit_item "$course" SUMMARY COMMENT
24 [div .section .dtstart . $(
25 edit_item "$course" DTSTART
27 [div .section .recur . $(
28 edit_item "$course" RRULE
30 [div .section .attendance . $(
31 edit_item "$course" attendance
34 [!-- select .item name=newfield
35 [option disabled="disabled" selected . $(l10n edit_addfieldtext)]
36 $(for f in $SUP_FIELDS; do printf '[option value="%s" . %s]\n' "$f" "$(l10n "$f")"; done)
38 [button .item type="submit" name="action" value="addfield" . $(l10n edit_addfield) --]
39 [button .item type="submit" name="action" value="update" . $(l10n edit_update)]
40 [button .item type="submit" name="action" value="cancel" . $(l10n edit_cancel)]
41 [div .item .delete label="$(l10n edit_delete)"
42 [input type="checkbox" #delete]
43 [label for="delete" $(l10n edit_delete)]
44 [button type="submit" name="action" value="delete" $(l10n edit_delete)]
54 local course="$(pdi_load "$coursefile")"
56 [div .course #${coursefile##*/}
57 [div .section .basic . $(
58 cal_item "$course" SUMMARY DTSTART RRULE
60 [div .section .COMMENT . $(cal_item "$course" COMMENT)]
61 [div .section .attendance [h3 $(l10n course_attendance) ] [ul .
62 $(grep -F "${coursefile##*/} " "$_DATA/mappings/attendance" |while read discard each; do
63 printf '[li [a .item .attendance href="/cards/#%s" . %s]]\n' \
65 "$(pdi_value "$(pdi_load "$_DATA/vcard/$each")" FN |unescape |HTML)"
69 [a .item href="/courses/edit_course.sh?course=${coursefile##*/}" $(l10n edit)]
70 [a .item href="/courses/export_pdf.sh?course=${coursefile##*/}" target="blank" $(l10n courselist)]
71 [a .item href="/courses/export_ical.sh?course=${coursefile##*/}" $(l10n ics_export)]
72 [a .item href="mailto:zack@vuesch.org?bcc=$(course_mail "${coursefile##*/}" |HTML)" $(l10n course_mail)]
80 grep -F "${course} " "$_DATA/mappings/attendance" |while read junk card; do
81 cat "${_DATA}/vcard/${card}"
84 | sed -nE 's;^EMAIL(\;[^:]*)*:(.+)\r?$;\2,;p' \
90 local calfile cachefile date size name ldate=0 lsize lname
92 while read calfile; do
93 cachefile="${_DATA}/cache/${calfile##*/}.cache"
94 if [ -s "$cachefile" -a "$cachefile" -nt "$calfile" ]; then
97 print_course "$calfile" |tee "$cachefile"
105 while read calfile; do
106 icstime="$(pdi_value "$(pdi_load "$calfile")" DTSTART |cal_date)"
108 DOW) printf '%s %s\n' "$(date -d "$icstime" "+%u %H:%M:%S")" "$calfile";;
109 TOD) printf '%s %s\n' "$(date -d "$icstime" "+%H:%M:%S")" "$calfile";;
113 | sed -E 's;^.*\t;;g'
117 printf '%s\n' ${_DATA}/ical/*.ics \