3 . "${_EXEC}"/pdiread.sh
6 MAILTO="${MAILTO:-confetti@confetti}"
9 local coursefile="$_DATA/ical/$1"
12 . $_EXEC/session_lock.sh
14 if ! tempfile="$(CHECK_SLOCK "$coursefile")"; then
15 printf '[div .message %s]' "$(l10n "This course is not set up for editing within this session.")"
17 course="$(pdi_load "$tempfile")"
19 [form .course #${coursefile##*/} action="${_BASE}/courses/update_course.sh" method="POST"
20 [input type="hidden" name="course" value="${coursefile##*/}"]
21 [input type="hidden" name="tid" value="$(transid ${tempfile})"]
22 [div .section .basic . $(
23 edit_item "$course" SUMMARY COMMENT
25 [div .section .dtstart . $(
26 edit_item "$course" DTSTART
28 [div .section .recur . $(
29 edit_item "$course" RRULE
31 [div .section .attendance . $(
32 edit_item "$course" attendance
35 [!-- select .item name=newfield
36 [option disabled="disabled" selected . $(l10n edit_addfieldtext)]
37 $(for f in $SUP_FIELDS; do printf '[option value="%s" . %s]\n' "$f" "$(l10n "$f")"; done)
39 [button .item type="submit" name="action" value="addfield" . $(l10n edit_addfield) --]
40 [button .item type="submit" name="action" value="update" . $(l10n edit_update)]
41 [button .item type="submit" name="action" value="cancel" . $(l10n edit_cancel)]
42 [div .item .delete label="$(l10n edit_delete)"
43 [input type="checkbox" #delete]
44 [label for="delete" $(l10n edit_delete)]
45 [button type="submit" name="action" value="delete" $(l10n edit_delete)]
55 local course="$(pdi_load "$coursefile")"
57 [div .course #${coursefile##*/}
58 [div .section .basic . $(
59 cal_item "$course" SUMMARY DTSTART RRULE
61 [div .section .COMMENT . $(cal_item "$course" COMMENT)]
62 [div .section .attendance [h3 $(l10n course_attendance) ] [ul .
63 $(grep -F "${coursefile##*/} " "$_DATA/mappings/attendance" |while read discard each; do
64 printf '[li [a .item .attendance href="%s/cards/#%s" . %s]]\n' \
66 "$(pdi_value "$(pdi_load "$_DATA/vcard/$each")" FN |unescape |HTML)"
70 [a .button .item href="${_BASE}/courses/edit_course.sh?course=${coursefile##*/}" $(l10n edit)]
71 [a .button .item href="${_BASE}/courses/export_pdf.sh?course=${coursefile##*/}" target="blank" $(l10n courselist)]
72 [a .button .item href="${_BASE}/courses/export_ical.sh?course=${coursefile##*/}" $(l10n ics_export)]
73 [a .button .item href="mailto:${MAILTO}?bcc=$(course_mail "${coursefile##*/}" |HTML)" $(l10n course_mail)]
81 grep -F "${course} " "$_DATA/mappings/attendance" |while read junk card; do
82 cat "${_DATA}/vcard/${card}"
85 | sed -nE 's;^EMAIL(\;[^:]*)*:(.+)\r?$;\2,;p' \
91 local calfile cachefile date size name ldate=0 lsize lname
93 while read calfile; do
94 cachefile="${_DATA}/cache/${calfile##*/}.cache"
95 if [ -s "$cachefile" -a "$cachefile" -nt "$calfile" ]; then
98 print_course "$calfile" |tee "$cachefile"
106 while read calfile; do
107 icstime="$(pdi_value "$(pdi_load "$calfile")" DTSTART |cal_date)"
109 DOW) printf '%s %s\n' "$(date -d "$icstime" "+%u %H:%M:%S")" "$calfile";;
110 TOD) printf '%s %s\n' "$(date -d "$icstime" "+%H:%M:%S")" "$calfile";;
114 | sed -E 's;^.*\t;;g'
118 printf '%s\n' ${_DATA}/ical/*.ics \