Skip to content

Commit

Permalink
Export 'Recurring' in CSV & cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexanderWillner committed Dec 30, 2017
1 parent d0ede7e commit 69974fa
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions things.sh
Original file line number Diff line number Diff line change
Expand Up @@ -436,7 +436,7 @@ SQL
}

csv() {
echo 'Title;"Creation Date";"Modification Date";"Due Date";"Start Date";"Completion Date";Project;Area;Subtask;Notes'
echo 'Title;"Creation Date";"Modification Date";"Due Date";"Start Date";"Completion Date";"Recurring";Project;Area;Subtask;Notes'

sqlite3 "$THINGSDB" <<-SQL
.mode csv
Expand All @@ -448,13 +448,14 @@ SELECT
date(T1.dueDate,'unixepoch'),
date(T1.startDate,'unixepoch'),
date(T1.stopDate,'unixepoch'),
T2.title,
T3.title,
CASE WHEN T1.recurrenceRule IS NULL THEN 'False' ELSE 'True' END,
PROJECT.title,
AREA.title,
"",
REPLACE(REPLACE(T1.notes, CHAR(13), ', '), CHAR(10), ', ')
FROM $TASKTABLE T1
LEFT OUTER JOIN $TASKTABLE T2 ON T1.project = T2.uuid
LEFT OUTER JOIN $AREATABLE T3 ON T1.area = T3.uuid
LEFT OUTER JOIN $TASKTABLE PROJECT ON T1.project = PROJECT.uuid
LEFT OUTER JOIN $AREATABLE AREA ON T1.area = AREA.uuid
WHERE T1.$ISNOTTRASHED AND (T1.$ISOPEN OR T1.$ISCOMPLETED) AND T1.$ISTASK;
SQL

Expand All @@ -471,6 +472,7 @@ SELECT
"",
"",
"",
"",
T1.title
FROM TMChecklistItem T1
LEFT OUTER JOIN $TASKTABLE T2 ON T1.task = T2.uuid
Expand Down

0 comments on commit 69974fa

Please sign in to comment.