summaryrefslogtreecommitdiff
path: root/server/src/server.cc
diff options
context:
space:
mode:
authordeva <deva>2009-08-05 11:42:01 +0000
committerdeva <deva>2009-08-05 11:42:01 +0000
commit44425239943e93df047a829b4af770bf9acf848e (patch)
tree9b202408694e14767ecd0839ff30e0726d688bc0 /server/src/server.cc
parent1b222bbd5779a371b7c857b5a90becf7ad20db74 (diff)
Made JournalWriter use the new TemplateList class.
Diffstat (limited to 'server/src/server.cc')
-rw-r--r--server/src/server.cc12
1 files changed, 9 insertions, 3 deletions
diff --git a/server/src/server.cc b/server/src/server.cc
index 0eeec43..d0e9524 100644
--- a/server/src/server.cc
+++ b/server/src/server.cc
@@ -82,7 +82,8 @@ public:
static std::string handleCommits(Transaction *transaction, Database &db,
- JournalWriter &journalwriter, MacroList &macrolist)
+ JournalWriter &journalwriter, MacroList &macrolist,
+ TemplateList &templatelist)
{
std::string answer;
@@ -99,7 +100,12 @@ static std::string handleCommits(Transaction *transaction, Database &db,
db.commitTransaction(transaction->user, transaction->cpr, *macro, commit.fields);
if(resume != "") {
- journalwriter.addEntry(*transaction, commit, resume, commit.templ);
+
+ TemplateParser tp(templatelist.getLatestVersion(commit.templ));
+ tp.parse();
+ Template *templ = tp.getTemplate();
+
+ journalwriter.addEntry(*transaction, commit, resume, templ);
}
i++;
@@ -264,7 +270,7 @@ static std::string handleTransaction(Transaction *transaction,
answer += "<pracro version=\"1.0\">\n";
try {
- answer += handleCommits(transaction, db, journalwriter, macrolist);
+ answer += handleCommits(transaction, db, journalwriter, macrolist, templatelist);
} catch( std::exception &e ) {
PRACRO_ERR(server, "Commit error: %s\n", e.what());
return error_box(xml_encode(e.what()));