X-Git-Url: http://git.plutz.net/?p=busy;a=blobdiff_plain;f=Tasks.page;h=f36a969e2a2b66daf80f6a060ef438b7c493ca5c;hp=6274be8a44cafdf7ae9d5f821589d2ccdcd17f36;hb=ab208fff56e536585bc0978898a7c3f610c73dce;hpb=85e4fd5e7bf8f7df622f1b31b5fdeb40ffdc521d diff --git a/Tasks.page b/Tasks.page index 6274be8..f36a969 100644 --- a/Tasks.page +++ b/Tasks.page @@ -1,11 +1,13 @@ #!/bin/zsh -info="$(egrep -o '(^|&)(i=)[0-9]{10}_[0-9]{3}(&|$)' <<<"${QUERY_STRING}" |tr -d '&i=')" -edit="$(egrep -o '(^|&)(e=)[0-9]{10}_[0-9]{3}(&|$)' <<<"${QUERY_STRING}" |tr -d '&e=')" -search="$(egrep -o '(^|&)(s=).+(&|$)' <<<"${QUERY_STRING}" |sed -r 's:^&?s=::;s:\+: :g;s:%:\\x:g')" -search="$(echo -e "${search}" |sed 's:\t: :g;s:\r::g;s:\\:\\\\:g' |head -n1)" -new="$(egrep -o '(^|&)(n=).+(&|$)' <<<"${QUERY_STRING}" |sed -r 's:^&?n=::;s:\+: :g;s:%:\\x:g')" -new="$(echo -e "${new}" |sed 's:\t: :g;s:\r::g;s:\\:\\\\:g' |head -n1)" +info="$(sed -r 's:(^|.*&)i=([0-9]{10}_[0-9]{3}).*|.*:\2:;s:&.*::' <<<"${QUERY_STRING}")" +edit="$(sed -r 's:(^|.*&)e=([0-9]{10}_[0-9]{3}).*|.*:\2:;s:&.*::' <<<"${QUERY_STRING}")" +search="$(sed -r 's:(^|.*&)s=(.*)|.*:\2:;s:&.*::;s:\+: :g;s:%:\\x:g' <<<"${QUERY_STRING}")" +search="$(echo -e "${search}" |sed -rn '1{s:\t: :g;s:\r::g;s:\\:\\\\:g;p}')" +new="$(sed -r 's:(^|.*&)n=(.*)|.*:\2:;s:&.*::;s:\+: :g;s:%:\\x:g' <<<"${QUERY_STRING}")" +new="$(echo -e "${new}" |sed -rn '1{s:\t: :g;s:\r::g;s:\\:\\\\:g;p}')" + +[ -z "$ACL_CREATETASK" ] && ACL_CREATETASK=false cat < @@ -16,11 +18,12 @@ cat <
TasksEND +#search results if [ -n "$search" ]; then echo "

Tasks search results for: $search

" - for each in $(grep -ile "$search" Tasks/<0000000000-9999999999>_<000-999>.task); do + for each in $(grep -ile "$search" Tasks/<0000000000-9999999999>_<000-999>); do id=$(sed -r 's:^.*/::;s:.task$::' <<<$each) - echo "
' -[ -n "$new" ] && cat < +#Display single task +if [ -n "$info" -a -r "Tasks/$info" -a -r "Tasks/$info.meta" ]; then + datafile="Tasks/$info" + metafile="Tasks/$info.meta" + headline="$(sed -rn '/^headline=/{s:^[a-z]+=(.+)$:\1:p;q}' "$metafile")" + taskstatus="$(sed -rn '/^status=/{s:^[a-z]+=(.+)$:\1:p;q}' "$metafile")" + section="$(sed -rn '/^section=/{s:^[a-z]+=(.+)$:\1:p;q}' "$metafile")" + attendant="$(sed -rn '/^attendant=/{s:^[a-z]+=(.+)$:\1:p;q}' "$metafile")" + [ -z "$section" ] && section='(none)' + [ -z "$attendant" ] && attendant='(none)' + cat < +
+

$headline

+ $(_wiki "$datafile") +
+ + + + +
Status
+ $taskstatus
Section
+ $section
Attendant
+ $attendant
+
+TasksEND +fi + +#create task main dialog +[ -z "$info" -a -n "$new" ] && cat <

$new

@@ -39,34 +71,41 @@ echo '
'
Section:

other section:
- + + +
TaskEnd -[ -z "$new" ] && stat -c '' Tasks/<0000000000-9999999999>_<000-999>.meta && for each in Tasks/<0000000000-9999999999>_<000-999>.meta(.om); do - headline="$(egrep -x 'headline=.+' "$each" |sed 's:headline=::')" - status="$(egrep -x 'status=.+' "$each" |sed 's:status=::')" - section="$(egrep -x 'section=.+' "$each" |sed 's:section=::')" - attendant="$(egrep -x 'attendant=.+' "$each" |sed 's:attendant=::')" +#Plain list of tasks (default) +[ -z "$info" -a -z "$new" ] && stat -c '' Tasks/<0000000000-9999999999>_<000-999>.meta && for each in Tasks/<0000000000-9999999999>_<000-999>.meta(.om); do + info="$(basename "$each" |sed 's:.meta$::')" + headline="$(sed -rn '/^headline=/{s:^[a-z]+=(.+)$:\1:p;q}' "$each")" + taskstatus="$(sed -rn '/^status=/{s:^[a-z]+=(.+)$:\1:p;q}' "$each")" + section="$(sed -rn '/^section=/{s:^[a-z]+=(.+)$:\1:p;q}' "$each")" + attendant="$(sed -rn '/^attendant=/{s:^[a-z]+=(.+)$:\1:p;q}' "$each")" + [ -z "$section" ] && section='(none)' + [ -z "$attendant" ] && attendant='(none)' cat < - $headline
- Status: $status - Section: $Section + $headline
+ Status: $taskstatus + Section: $section Attendant: $attendant TasksEND done +#dropdown dialog for adding a task echo '