X-Git-Url: https://git.plutz.net/?p=confetti;a=blobdiff_plain;f=courses%2Fexport_ical.sh;fp=actions%2Fedit_course.sh;h=3649ed5e0e21e7229f2c747e246e24216c4b285f;hp=1841e056b00ffc5038b9c4751bf041dfb4edc1d5;hb=76c1e7bff1a8604ef2ef7da5d274d0db0e639139;hpb=90288ab07bb1ec83a91581fadc674a87a250a853 diff --git a/actions/edit_course.sh b/courses/export_ical.sh similarity index 68% rename from actions/edit_course.sh rename to courses/export_ical.sh index 1841e05..3649ed5 100755 --- a/actions/edit_course.sh +++ b/courses/export_ical.sh @@ -1,6 +1,6 @@ #!/bin/zsh -# Copyright 2014 Paul Hänsch +# Copyright 2014,2015,2021 Paul Hänsch # # This file is part of Confetti. # @@ -17,6 +17,12 @@ # You should have received a copy of the GNU Affero General Public License # along with Confetti. If not, see . -course="${_GET[course]}" +course="$(GET course |PATH)" +coursefile="$_DATA/ical/${course##*/}" -echo -n "Location: ?p=courses&edit=$course\n\n" +. $_EXEC/pdiread.sh +. $_EXEC/cgilite/file.sh + +printf 'Content-Disposition: inline; filename="%s.ics"\r\n' "$(pdi_value "$(pdi_load "$coursefile")" SUMMARY)" + +FILE "$coursefile" "text/calendar; charset=utf-8"