diff options
author | deva <deva> | 2009-08-05 11:42:01 +0000 |
---|---|---|
committer | deva <deva> | 2009-08-05 11:42:01 +0000 |
commit | 44425239943e93df047a829b4af770bf9acf848e (patch) | |
tree | 9b202408694e14767ecd0839ff30e0726d688bc0 /server/src/server.cc | |
parent | 1b222bbd5779a371b7c857b5a90becf7ad20db74 (diff) |
Made JournalWriter use the new TemplateList class.
Diffstat (limited to 'server/src/server.cc')
-rw-r--r-- | server/src/server.cc | 12 |
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 ¯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 += "<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())); |