summaryrefslogtreecommitdiff
path: root/server/src/journal_commit.cc
diff options
context:
space:
mode:
Diffstat (limited to 'server/src/journal_commit.cc')
-rw-r--r--server/src/journal_commit.cc34
1 files changed, 17 insertions, 17 deletions
diff --git a/server/src/journal_commit.cc b/server/src/journal_commit.cc
index 4992545..21d40c3 100644
--- a/server/src/journal_commit.cc
+++ b/server/src/journal_commit.cc
@@ -207,46 +207,46 @@ JournalWriter::JournalWriter(std::string host, unsigned short int port)
}
void JournalWriter::addEntry(Transaction &transaction, Commit &commit,
- std::string resume, std::string course)
+ std::string resume, std::string templname)
{
- TemplateParser tp(course);
+ TemplateParser tp(templname);
tp.parse();
Template *templ = tp.getTemplate();
size_t index = 0;
- std::vector< Macro >::iterator i = templ->course.macros.begin();
- while(i != templ->course.macros.end()) {
+ std::vector< Macro >::iterator i = templ->macros.begin();
+ while(i != templ->macros.end()) {
Macro &m = *i;
if(commit.macro == m.attributes["name"]) break;
index++;
i++;
}
- if(index >= templ->course.macros.size()) {
- PRACRO_ERR(journal, "Could not find macro %s in course %s\n",
- commit.macro.c_str(), course.c_str());
+ if(index >= templ->macros.size()) {
+ PRACRO_ERR(journal, "Could not find macro %s in template %s\n",
+ commit.macro.c_str(), templname.c_str());
// return;
} else {
- PRACRO_DEBUG(journal, "Found macro %s as index %u in course %s\n",
- commit.macro.c_str(), index, course.c_str());
+ PRACRO_DEBUG(journal, "Found macro %s as index %u in template %s\n",
+ commit.macro.c_str(), index, templname.c_str());
}
// First run - initialize username and cpr.
if(currentuser == "" && entrylist.size() == 0) currentuser = transaction.user;
if(currentcpr == "" && entrylist.size() == 0) currentcpr = transaction.cpr;
- PRACRO_DEBUG(journal, "addEntry: course(%s)\n", course.c_str());
+ PRACRO_DEBUG(journal, "addEntry: template(%s)\n", templname.c_str());
- // Add the course resume as the header (ie. first entry) of the journal entry.
- if(entrylist.size() == 0 && course != "") {
- std::string course_resume = templ->course.attributes["resume"];
+ // Add the template resume as the header (ie. first entry) of the journal entry.
+ if(entrylist.size() == 0 && templname != "") {
+ std::string template_resume = templ->attributes["resume"];
- PRACRO_DEBUG(journal, "CourseResume: %s\n", course_resume.c_str());
+ PRACRO_DEBUG(journal, "TemplateResume: %s\n", template_resume.c_str());
- if(course_resume != "") {
+ if(template_resume != "") {
ResumeEntry re;
- re.resume = course_resume;
- re.macro = "course_header";
+ re.resume = template_resume;
+ re.macro = "template_header";
entrylist[-1] = re; // Make sure it comes first.
}
}