From 44425239943e93df047a829b4af770bf9acf848e Mon Sep 17 00:00:00 2001 From: deva Date: Wed, 5 Aug 2009 11:42:01 +0000 Subject: Made JournalWriter use the new TemplateList class. --- server/src/server.cc | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'server/src/server.cc') 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 ¯olist) + JournalWriter &journalwriter, MacroList ¯olist, + 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 += "\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())); -- cgit v1.2.3