4 if [ -n "$search" ]; then
5 echo "<h1>Tasks search results for: $search</h1>"
6 for each in $(grep -ile "$search" Tasks/<0000000000-9999999999>_<000-999>); do
7 id=$(sed -r 's:^.*/::;s:.task$::' <<<$each)
8 echo "<div class='search'><a href='${SCRIPTNAME}?p=Tasks&i=$id'><h2>$(date -d @$(cut -d_ -f1 <<<"$id"))</h2></a>"
9 grep -C1 -ie "$search" "$each" |sed "s:$search:<b>&</b>:g;s:$:<br>:g"
17 datafile="Tasks/$info"
18 metafile="Tasks/$info.meta"
19 headline="$(sed -rn '/^headline=/{s:^[a-z]+=(.+)$:\1:p;q}' "$metafile")"
20 taskstatus="$(sed -rn '/^status=/{s:^[a-z]+=(.+)$:\1:p;q}' "$metafile")"
21 section="$(sed -rn '/^section=/{s:^[a-z]+=(.+)$:\1:p;q}' "$metafile")"
22 attendant="$(sed -rn '/^attendant=/{s:^[a-z]+=(.+)$:\1:p;q}' "$metafile")"
23 [ -z "$section" ] && section='(none)'
24 [ -z "$attendant" ] && attendant='(none)'
27 <div class="wikitext">
34 <td><b>Section</b><br>
36 <td><b>Attendant</b><br>
45 <form class="Task" style="height:20em;" method="post" action="?action=taskmeta" accept-charset="UTF-8">
47 <input type="hidden" name="headline" value="$new">
48 <input type="hidden" name="status" value="new">
49 <div style="width:60%;left:3.5em;">
50 <b>Description:</b><br>
51 <textarea name="description" rows="11"></textarea>
52 </div><div style="width:30%;right:.5em;">
54 <select name="section" size="6" style="width:80%">
55 $(for each in $(egrep -hx 'section=.+' Tasks/<0000000000-9999999999>_<000-999>.meta |sort -u); do
56 echo "<option>$(sed 's:section=::' <<<"$each")</option>"
59 <b>other section:</b><br>
60 <input type="text" name="section">
61 <input type="submit" name="submit" value="Robots click here" style="display:none;">
62 <input type="submit" name="submit" value="Create Task">
63 <input type="submit" name="submit" value="Robots click here" style="display:none;">
70 stat -c '' Tasks/<0000000000-9999999999>_<000-999>.meta \
71 && for each in Tasks/<0000000000-9999999999>_<000-999>.meta(.om); do
72 info="$(basename "$each" |sed 's:.meta$::')"
73 headline="$(sed -rn '/^headline=/{s:^[a-z]+=(.+)$:\1:p;q}' "$each")"
74 taskstatus="$(sed -rn '/^status=/{s:^[a-z]+=(.+)$:\1:p;q}' "$each")"
75 section="$(sed -rn '/^section=/{s:^[a-z]+=(.+)$:\1:p;q}' "$each")"
76 attendant="$(sed -rn '/^attendant=/{s:^[a-z]+=(.+)$:\1:p;q}' "$each")"
77 [ -z "$section" ] && section='(none)'
78 [ -z "$attendant" ] && attendant='(none)'
81 <a href="${SCRIPTNAME}?p=Tasks&i=${info}"><b>$headline</b></a><br>
82 <span><b>Status:</b> $taskstatus</span>
83 <span><b>Section:</b> $section</span>
84 <span><b>Attendant:</b> $attendant</span>
92 <a id='newTask_button' class='function' href='#' onclick='javascript:show_screen("newTask");hide_screen("newTask_button");'>New Task</a>
93 <div id="newTask" style="display: none;">
94 <form action="/${SCRIPTNAME}" method="get" accept-charset="UTF-8">
96 <input type="hidden" name="p" value="Tasks">
97 <textarea name="n" rows="2" style="width:99%;"></textarea><br>
98 <input type="submit" value="Submit">
99 <a class="function" href="#" onclick="javascript:hide_screen('newTask');show_screen('newTask_button');">Cancel</a>
107 <form method="GET" action="/${SCRIPTNAME}" accept-charset="utf-8">
108 <input type="hidden" name="p" value="Tasks">
109 <input type="text" name="s" placeholder="Search"><br>
110 <input type="submit" value="Search Tasks">
114 </div><div id="MAIN">
116 $([ -n "$info" -a -r "Tasks/$info" -a -r "Tasks/$info.meta" ] && show_task)
117 $([ -z "$info" -a -n "$new" ] && setup_task)
118 $([ -z "$info" -a -z "$new" ] && list_tasks)
119 </div> <div id="RIGHT">
120 $($ACL_CREATETASK && [ -z "$new" ] && new_task)