From 0bb22396a89ab7a8d79f765a63d1714054c54052 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Paul=20H=C3=A4nsch?= Date: Sun, 17 Jan 2021 10:25:00 +0100 Subject: [PATCH] touch course file (invalidate cache) when updating attendance in vcard --- cards/list.sh | 2 +- cards/update_card.sh | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/cards/list.sh b/cards/list.sh index 4e40072..1c60291 100755 --- a/cards/list.sh +++ b/cards/list.sh @@ -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" \ diff --git a/cards/update_card.sh b/cards/update_card.sh index 7896beb..97dedf3 100755 --- a/cards/update_card.sh +++ b/cards/update_card.sh @@ -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 -- 2.39.2