Enhancement - #363 export.ical
- Added feature #363 supporting iCalendar export via the 'export.ical' command. - Updated documentation. - Removed unnecessary localization of canonical command names.
This commit is contained in:
@@ -1306,59 +1306,6 @@ int handleDone (std::string &outs)
|
||||
return rc;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
int handleExport (std::string &outs)
|
||||
{
|
||||
int rc = 0;
|
||||
|
||||
if (context.hooks.trigger ("pre-export-command"))
|
||||
{
|
||||
std::stringstream out;
|
||||
|
||||
// Deliberately no 'id'.
|
||||
out << "'uuid',"
|
||||
<< "'status',"
|
||||
<< "'tags',"
|
||||
<< "'entry',"
|
||||
<< "'start',"
|
||||
<< "'due',"
|
||||
<< "'recur',"
|
||||
<< "'end',"
|
||||
<< "'project',"
|
||||
<< "'priority',"
|
||||
<< "'fg',"
|
||||
<< "'bg',"
|
||||
<< "'description'"
|
||||
<< "\n";
|
||||
|
||||
int count = 0;
|
||||
|
||||
// Get all the tasks.
|
||||
std::vector <Task> tasks;
|
||||
context.tdb.lock (context.config.getBoolean ("locking"));
|
||||
handleRecurrence ();
|
||||
context.tdb.load (tasks, context.filter);
|
||||
context.tdb.commit ();
|
||||
context.tdb.unlock ();
|
||||
|
||||
foreach (task, tasks)
|
||||
{
|
||||
context.hooks.trigger ("pre-display", *task);
|
||||
|
||||
if (task->getStatus () != Task::recurring)
|
||||
{
|
||||
out << task->composeCSV ().c_str ();
|
||||
++count;
|
||||
}
|
||||
}
|
||||
|
||||
outs = out.str ();
|
||||
context.hooks.trigger ("post-export-command");
|
||||
}
|
||||
|
||||
return rc;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
int handleModify (std::string &outs)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user