marking a task as 'not done' 'done' etc. will now clear the 'in progress' state

This commit is contained in:
Rob Pearce 2022-04-13 13:11:53 +10:00
parent dfe11f6d03
commit 90af44e959
1 changed files with 2 additions and 2 deletions

4
t.sh
View File

@ -875,7 +875,7 @@ function unfold() {
function clearstatus() { function clearstatus() {
local file local file
file="$1" file="$1"
[[ -e $file ]] && sed -i '/^COMPLETED:/d;/^STATUS:COMPLETED/d;/PERCENT-COMPLETE:/d;/^STATUS:IN-PROCESS:/d;/^STATUS:NEEDS-inform/d;/^$/d;/^REQUEST-STATUS:/d;' "$file" [[ -e $file ]] && sed -i '/^COMPLETED:/d;/^STATUS:COMPLETED/d;/PERCENT-COMPLETE:/d;/^STATUS:IN-PROCESS:/d;/^STATUS:NEEDS-inform/d;/^$/d;/^REQUEST-STATUS:/d;/^STATUS:IN-PROCESS/d' "$file"
} }
function markblocked() { # $1=uid $2=reason function markblocked() { # $1=uid $2=reason
@ -886,7 +886,7 @@ function markblocked() { # $1=uid $2=reason
id=$(getid $uid) id=$(getid $uid)
[[ $# -gt 1 ]] && ischild=1 || ischild=0 [[ $# -gt 1 ]] && ischild=1 || ischild=0
[[ $ischild -eq 1 ]] && noun=subtask || noun=task [[ $ischild -eq 1 ]] && noun=subtask || noun=task
# already in progress? # already blocked?
if [[ ${taskchecked[$id]} -eq 3 ]]; then if [[ ${taskchecked[$id]} -eq 3 ]]; then
if [[ ${taskblockreason[$id]} == "$reason" ]]; then if [[ ${taskblockreason[$id]} == "$reason" ]]; then
error "$noun #${id} is already blocked" error "$noun #${id} is already blocked"