touch course file (invalidate cache) when updating attendance in vcard
authorPaul Hänsch <paul@plutz.net>
Sun, 17 Jan 2021 09:25:00 +0000 (10:25 +0100)
committerPaul Hänsch <paul@plutz.net>
Sun, 17 Jan 2021 09:25:00 +0000 (10:25 +0100)
cards/list.sh
cards/update_card.sh

index 4e40072..1c60291 100755 (executable)
@@ -45,7 +45,7 @@ edit_card(){
            done)
            [h3 $(l10n CATEGORIES) ] $(
            grep -xE '[^ ]+' "$_DATA"/mappings/categories |while read -r cat; do
-             printf '[label [input type="checkbox" name="attendance" value="%s" %s] %s]' \
+             printf '[label [input type="checkbox" name="CATEGORIES" value="%s" %s] %s]' \
                     "$(HTML "$cat")" \
                     "$(seq 1 $(pdi_count "$card" CATEGORIES) |while read c; do
                       pdi_value "$card" CATEGORIES $c |grep -qxF "$cat" \
index 7896beb..97dedf3 100755 (executable)
@@ -104,14 +104,14 @@ case "$action" in
   update)
     if LOCK "$attfile"; then
       grep -F "        ${card}" "$attfile" |while read course junk; do
-        touch "$_DATA/courses/${course}"
+        touch "$_DATA/ical/${course}"
       done
-      sed -i -r "/^.+  ${card}\$/d" "$attfile"
+      sed -i -E "/^.+  ${card}\$/d" "$attfile"
       seq 1 $(POST_COUNT attendance) |while read n; do
         printf '%s     %s\n' "$(POST attendance $n)" "$card"
       done >>"$attfile"
       grep -F "        ${card}" "$attfile" |while read course junk; do
-        touch "$_DATA/courses/${course}"
+        touch "$_DATA/ical/${course}"
       done
       RELEASE "$attfile"
     else