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:
Paul Beckingham
2010-05-31 16:05:51 -04:00
parent 3ef6aa9f8e
commit e368043fb8
15 changed files with 288 additions and 90 deletions

View File

@@ -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)
{