#include "HTMLReportElement.h"
-#include <config.h>
#include <assert.h>
#include "TjMessageHandler.h"
#include "tjlib-internal.h"
#include "Project.h"
-#include "Task.h"
#include "Resource.h"
#include "Account.h"
-#include "Report.h"
-#include "Booking.h"
#include "BookingList.h"
#include "Utility.h"
#include "MacroTable.h"
-#include "TableColumnFormat.h"
#include "TableLineInfo.h"
-#include "TableColumnInfo.h"
#include "TableCellInfo.h"
#include "ReferenceAttribute.h"
#include "TextAttribute.h"
// Header line 1
s() << "<table align=\"center\" cellpadding=\"2\" "
<< "style=\"background-color:#000000\"";
- if (((HTMLReport*) report)->hasStyleSheet())
+ if (static_cast<HTMLReport*>(report)->hasStyleSheet())
s() << " class=\"tj_table\"";
s() << ">" << endl;
s() << " <thead>" << endl
<< " <tr valign=\"middle\""
<< " style=\"background-color:" << colors.getColorName("header") << "; "
<< "font-size:110%; font-weight:bold; text-align:center\"";
- if (((HTMLReport*) report)->hasStyleSheet())
+ if (static_cast<HTMLReport*>(report)->hasStyleSheet())
s() << " class=\"tj_header_row\"";
s() << ">" << endl;
for (QPtrListIterator<TableColumnInfo> it(columns); it; ++it )
s() << " </tr>" << endl;
// Header line 2
- bool first = TRUE;
+ bool first = true;
for (QPtrListIterator<TableColumnInfo> it(columns); it; ++it )
{
if (columnFormat[(*it)->getName()])
if (first)
{
s() << " <tr";
- if (((HTMLReport*) report)->hasStyleSheet())
+ if (static_cast<HTMLReport*>(report)->hasStyleSheet())
s() << " class=\"tj_header_row\"";
s() << ">" << endl;
- first = FALSE;
+ first = false;
}
TableCellInfo tci(columnFormat[(*it)->getName()], 0, *it);
}
puts("\"");
}
- if (((HTMLReport*) report)->hasStyleSheet())
+ if (static_cast<HTMLReport*>(report)->hasStyleSheet())
puts(" class=\"tj_row\"");
puts(">\n");
cellText = filter ? htmlFilter(text) : text;
if (tci->tli->ca1 && !tci->tci->getCellText().isEmpty())
{
- QStringList* sl = new QStringList();
- sl->append(text);
- cellText = mt.expandReportVariable(tci->tci->getCellText(), sl);
- delete sl;
+ QStringList sl(text);
+ cellText = mt.expandReportVariable(tci->tci->getCellText(), &sl);
}
}
if (!tci->tci->getCellURL().isEmpty() && (tci->tli->ca1 == 0 ||
!isHidden(tci->tli->ca1, tci->tci->getHideCellURL())))
{
- QStringList* sl = new QStringList();
- sl->append(text);
- QString cellURL = mt.expandReportVariable(tci->tci->getCellURL(), sl);
- delete sl;
+ QStringList sl(text);
+ QString cellURL = mt.expandReportVariable(tci->tci->getCellURL(), &sl);
if (!cellURL.isEmpty())
{
cellText = QString("<a href=\"") + cellURL
}
if (cellText.isEmpty())
cellText = " ";
- if (((HTMLReport*) report)->hasStyleSheet())
+ if (static_cast<HTMLReport*>(report)->hasStyleSheet())
puts(" class=\"tj_cell\"");
puts(">");
if (!tci->getToolTipText().isEmpty())
{
tci->setStatusText("");
}
- genCell(text, tci, FALSE);
+ genCell(text, tci, false);
}
void
{
tci->setStatusText("");
}
- genCell(text, tci, FALSE);
+ genCell(text, tci, false);
}
void
tci->setStatusText(time2user(iv_start, "%Y-%m-%d / [") +
tci->tli->account->getId() + "] " +
htmlFilter(tci->tli->account->getName()));
- genCell(tci->tcf->realFormat.format(value, tci), tci, FALSE);
+ genCell(tci->tcf->realFormat.format(value, tci), tci, false);
}
void
HTMLReportElement::generateTitle(TableCellInfo* tci, const QString& str)
{
- QStringList* sl = new QStringList();
- sl->append(str);
+ QStringList sl(str);
QString cellText;
if (!tci->tci->getTitle().isEmpty())
- cellText = mt.expandReportVariable(tci->tci->getTitle(), sl);
+ cellText = mt.expandReportVariable(tci->tci->getTitle(), &sl);
else
cellText = str;
cellText = htmlFilter(cellText);
- QString cellURL = mt.expandReportVariable(tci->tci->getTitleURL(), sl);
- delete sl;
+ QString cellURL = mt.expandReportVariable(tci->tci->getTitleURL(), &sl);
if (!cellURL.isEmpty())
cellText = QString("<a href=\"") + cellURL
+ "\">" + cellText + "</a>";
void
HTMLReportElement::generateSubTitle(TableCellInfo* tci, const QString& str)
{
- QStringList* sl = new QStringList();
- sl->append(str);
+ QStringList sl(str);
QString cellText;
if (!tci->tci->getSubTitle().isEmpty())
- cellText = mt.expandReportVariable(tci->tci->getSubTitle(), sl);
+ cellText = mt.expandReportVariable(tci->tci->getSubTitle(), &sl);
else
cellText = str;
cellText = htmlFilter(cellText);
- QString cellURL = mt.expandReportVariable(tci->tci->getSubTitleURL(), sl);
- delete sl;
+ QString cellURL = mt.expandReportVariable(tci->tci->getSubTitleURL(), &sl);
if (!cellURL.isEmpty())
cellText = QString("<a href=\"") + cellURL
+ "\">" + cellText + "</a>";
tci->setRightPadding(2 + topIndent +
(maxDepth - 1 - tci->tli->ca1->treeLevel()) *
subIndent);
- genCell(str, tci, FALSE);
+ genCell(str, tci, false);
}
void
HTMLReportElement::genHeadDefault(TableCellInfo* tci)
{
puts(" <td rowspan=\"2\"");
- if (((HTMLReport*) report)->hasStyleSheet())
+ if (static_cast<HTMLReport*>(report)->hasStyleSheet())
puts(" class=\"tj_header_cell\"");
puts(">");
generateTitle(tci, tci->tcf->getTitle());
HTMLReportElement::genHeadCurrency(TableCellInfo* tci)
{
puts(" <td rowspan=\"2\"");
- if (((HTMLReport*) report)->hasStyleSheet())
+ if (static_cast<HTMLReport*>(report)->hasStyleSheet())
puts(" class=\"tj_header_cell\"");
puts(">");
generateTitle(tci, tci->tcf->getTitle() +
left = daysBetween(day, end);
s() << " <td colspan=\""
<< QString().sprintf("%d", left) << "\"";
- if (((HTMLReport*) report)->hasStyleSheet())
+ if (static_cast<HTMLReport*>(report)->hasStyleSheet())
s() << " class=\"tj_header_cell\"";
s() << ">";
mt.setMacro(new Macro(KW("day"), "01",
bgCol = colors.getColor("today");
s() << "background-color:" << bgCol.name() << "; "
<< "font-size:80%; text-align:center\"";
- if (((HTMLReport*) report)->hasStyleSheet())
+ if (static_cast<HTMLReport*>(report)->hasStyleSheet())
s() << " class=\"tj_header_cell\"";
s() << ">";
mt.setMacro(new Macro(KW("day"), QString().sprintf("%02d", dom),
s() << " <td colspan=\""
<< QString().sprintf("%d", left) << "\"";
- if (((HTMLReport*) report)->hasStyleSheet())
+ if (static_cast<HTMLReport*>(report)->hasStyleSheet())
s() << " class=\"tj_header_cell\"";
s() << ">";
mt.setMacro(new Macro(KW("day"), QString().sprintf
bgCol = colors.getColor("header");
s() << "background-color:" << bgCol.name() << "; "
<< "font-size:80%; text-align:center\"";
- if (((HTMLReport*) report)->hasStyleSheet())
+ if (static_cast<HTMLReport*>(report)->hasStyleSheet())
s() << " class=\"tj_header_cell\"";
s() << ">";
if (woy < 10)
left = monthsBetween(year, end);
s() << " <td colspan=\""
<< QString().sprintf("%d", left) << "\"";
- if (((HTMLReport*) report)->hasStyleSheet())
+ if (static_cast<HTMLReport*>(report)->hasStyleSheet())
s() << " class=\"tj_header_cell\"";
s() << ">";
mt.setMacro(new Macro(KW("day"), "01",
bgCol = colors.getColor("header");
s() << "background-color:" << bgCol.name() << "; "
<< "font-size:80%; text-align:center\"";
- if (((HTMLReport*) report)->hasStyleSheet())
+ if (static_cast<HTMLReport*>(report)->hasStyleSheet())
s() << " class=\"tj_header_cell\"";
s() << ">";
if (month < 10)
left = quartersBetween(year, end);
s() << " <td colspan=\""
<< QString().sprintf("%d", left) << "\"";
- if (((HTMLReport*) report)->hasStyleSheet())
+ if (static_cast<HTMLReport*>(report)->hasStyleSheet())
s() << " class=\"tj_header_cell\"";
s() << ">";
mt.setMacro(new Macro(KW("day"), "01",
bgCol = colors.getColor("header");
s() << "background-color:" << bgCol.name() << "; "
<< "font-size:80%; text-align:center\"";
- if (((HTMLReport*) report)->hasStyleSheet())
+ if (static_cast<HTMLReport*>(report)->hasStyleSheet())
s() << " class=\"tj_header_cell\"";
s() << ">";
mt.setMacro(new Macro(KW("day"), QString().sprintf("%02d",
year = sameTimeNextYear(year))
{
s() << " <td rowspan=\"2\"";
- if (((HTMLReport*) report)->hasStyleSheet())
+ if (static_cast<HTMLReport*>(report)->hasStyleSheet())
s() << " class=\"tj_header_cell\"";
s() << ">";
mt.setMacro(new Macro(KW("day"), QString().sprintf("%02d",
void
HTMLReportElement::genCellEmpty(TableCellInfo* tci)
{
- genCell("", tci, TRUE);
+ genCell("", tci, true);
}
void
{
genCell(tci->tli->ca2 == 0 ?
QString().sprintf("%d.", tci->tli->ca1->getSequenceNo()) :
- QString::null, tci, TRUE);
+ QString::null, tci, true);
}
void
HTMLReportElement::genCellNo(TableCellInfo* tci)
{
genCell(tci->tli->ca2 == 0 ? QString().sprintf("%d.", tci->tli->idxNo) :
- QString::null, tci, TRUE);
+ QString::null, tci, true);
}
void
HTMLReportElement::genCellHierarchNo(TableCellInfo* tci)
{
genCell(tci->tli->ca2 == 0 ?
- tci->tli->ca1->getHierarchNo() : QString::null, tci, TRUE);
+ tci->tli->ca1->getHierarchNo() : QString::null, tci, true);
}
void
{
genCell(tci->tli->ca2 == 0 ?
QString().sprintf("%d.", tci->tli->ca1->getIndex()) :
- QString::null, tci, TRUE);
+ QString::null, tci, true);
}
void
HTMLReportElement::genCellHierarchIndex(TableCellInfo* tci)
{
genCell(tci->tli->ca2 == 0 ?
- tci->tli->ca1->getHierarchIndex() : QString::null, tci, TRUE);
+ tci->tli->ca1->getHierarchIndex() : QString::null, tci, true);
}
void
HTMLReportElement::genCellId(TableCellInfo* tci)
{
- genCell(tci->tli->ca1->getId(), tci, TRUE);
+ genCell(tci->tli->ca1->getId(), tci, true);
}
void
}
else
text = tci->tli->specialName;
- genCell(text, tci, TRUE);
+ genCell(text, tci, true);
}
void
if (!tci->tli->task->isStartOk(tci->tli->sc))
tci->setBgColor(colors.getColor("error"));
genCell(time2user(tci->tli->task->getStart(tci->tli->sc), timeFormat),
- tci, FALSE);
+ tci, false);
}
void
if (!tci->tli->task->isEndOk(tci->tli->sc))
tci->setBgColor(colors.getColor("error"));
genCell(time2user(tci->tli->task->getEnd(tci->tli->sc) + 1, timeFormat),
- tci, FALSE);
+ tci, false);
}
#define GCMMSE(a, b) \
{ \
genCell(tci->tli->task->get##a(tci->tli->sc) == 0 ? QString() : \
time2user(tci->tli->task->get##a(tci->tli->sc) + b, timeFormat), \
- tci, FALSE); \
+ tci, false); \
}
GCMMSE(MinStart, 0)
{ \
genCell(QString().sprintf \
("%3.0f", tci->tli->task->get##a##Buffer(tci->tli->sc)), \
- tci, FALSE); \
+ tci, false); \
}
GCSEBUFFER(Start)
HTMLReportElement::genCellStartBufferEnd(TableCellInfo* tci)
{
genCell(time2user(tci->tli->task->getStartBufferEnd
- (tci->tli->sc), timeFormat), tci, FALSE);
+ (tci->tli->sc), timeFormat), tci, false);
}
void
HTMLReportElement::genCellEndBufferStart(TableCellInfo* tci)
{
genCell(time2user(tci->tli->task->getStartBufferEnd
- (tci->tli->sc) + 1, timeFormat), tci, FALSE);
+ (tci->tli->sc) + 1, timeFormat), tci, false);
}
void
{
genCell(scaledDuration(tci->tli->task->getCalcDuration(tci->tli->sc),
tci->tcf->realFormat),
- tci, FALSE);
+ tci, false);
}
void
}
else if (tci->tli->ca1->getType() == CA_Resource)
{
- val = tci->tli->resource->getLoad(tci->tli->sc, Interval(start, end),
- AllAccounts, tci->tli->task);
+ val = tci->tli->resource->getEffectiveLoad
+ (tci->tli->sc, Interval(start, end), AllAccounts, tci->tli->task);
}
generateRightIndented(tci, scaledLoad(val, tci->tcf->realFormat));
double val = 0.0;
if (tci->tli->ca1->getType() == CA_Resource)
{
- val = tci->tli->resource->getAvailableWorkLoad
+ val = tci->tli->resource->getEffectiveFreeLoad
(tci->tli->sc, Interval(start, end));
}
double val = 0.0;
if (tci->tli->ca1->getType() == CA_Resource)
{
- double load =
- tci->tli->resource->getLoad(tci->tli->sc, Interval(start, end));
+ double load = tci->tli->resource->getEffectiveLoad
+ (tci->tli->sc, Interval(start, end));
if (load > 0.0)
{
double availableLoad =
- tci->tli->resource->getAvailableWorkLoad
+ tci->tli->resource->getEffectiveFreeLoad
(tci->tli->sc, Interval(start, end));
val = 100.0 / (1.0 + availableLoad / load);
genCell(tci->tli->task->getProjectId() + " (" +
report->getProject()->getIdIndex(tci->tli->task->
getProjectId()) + ")", tci,
- TRUE);
+ true);
}
void
HTMLReportElement::genCellProjectIDs(TableCellInfo* tci)
{
genCell(tci->tli->resource->getProjectIDs(tci->tli->sc,
- Interval(start, end)), tci, TRUE);
+ Interval(start, end)), tci, true);
}
void
text += (*rli)->getName();
}
- genCell(text, tci, FALSE);
+ genCell(text, tci, false);
}
void
{
if (tci->tli->task->getResponsible())
genCell(tci->tli->task->getResponsible()->getName(),
- tci, TRUE);
+ tci, true);
else
- genCell("", tci, TRUE);
+ genCell("", tci, true);
}
void
if (tci->tcf->getId() == "note")
{
if (tci->tli->task->getNote().isEmpty())
- genCell("", tci, TRUE);
+ genCell("", tci, true);
else
- genCell(tci->tli->task->getNote(), tci, TRUE);
+ genCell(tci->tli->task->getNote(), tci, true);
return;
}
- const TextAttribute* ta = (const TextAttribute*)
- tci->tli->ca1->getCustomAttribute(tci->tcf->getId());
+ const TextAttribute* ta = static_cast<const TextAttribute*>
+ (tci->tli->ca1->getCustomAttribute(tci->tcf->getId()));
if (!ta || ta->getText().isEmpty())
- genCell("", tci, TRUE);
+ genCell("", tci, true);
else
- genCell(ta->getText(), tci, TRUE);
+ genCell(ta->getText(), tci, true);
}
void
HTMLReportElement::genCellStatusNote(TableCellInfo* tci)
{
if (tci->tli->task->getStatusNote(tci->tli->sc).isEmpty())
- genCell("", tci, TRUE);
+ genCell("", tci, true);
else
genCell(tci->tli->task->getStatusNote(tci->tli->sc),
- tci, TRUE);
+ tci, true);
}
void
HTMLReportElement::genCellPriority(TableCellInfo* tci)
{
genCell(QString().sprintf("%d", tci->tli->task->getPriority()),
- tci, TRUE);
+ tci, true);
}
void
flagStr += ", ";
flagStr += *it;
}
- genCell(flagStr, tci, TRUE);
+ genCell(flagStr, tci, true);
}
void
{
if (calcedCompletionDegree == providedCompletionDegree)
{
- genCell(QString(i18n("in progress")), tci, FALSE);
+ genCell(QString(i18n("in progress")), tci, false);
}
else
{
genCell(QString(i18n("%1% (in progress)"))
.arg((int) providedCompletionDegree),
- tci, FALSE);
+ tci, false);
}
}
else
if (calcedCompletionDegree == providedCompletionDegree)
{
genCell(QString("%1%").arg((int) providedCompletionDegree),
- tci, FALSE);
+ tci, false);
}
else
{
genCell(QString("%1% (%2%)")
.arg((int) providedCompletionDegree)
.arg((int) calcedCompletionDegree),
- tci, FALSE);
+ tci, false);
}
}
}
void
+HTMLReportElement::genCellCompletedEffort(TableCellInfo* tci)
+{
+ double val = 0.0;
+
+ if (!tci->tli->resource && tci->tli->task->isLeaf())
+ {
+ // Task line, no resource.
+ val = tci->tli->task->getCompletedLoad(tci->tli->sc);
+ }
+ else if (tci->tli->ca2->getType() == CA_Resource &&
+ tci->tli->task && tci->tli->task->isLeaf())
+ {
+ // Task line, nested into a resource
+ const Project* project = report->getProject();
+ time_t now = project->getNow();
+ if (now < project->getStart())
+ now = project->getStart();
+ if (now > project->getEnd())
+ now = project->getEnd();
+ Interval iv = Interval(project->getStart(), now);
+ val = tci->tli->task->getLoad(tci->tli->sc, iv, tci->tli->resource);
+ }
+ else
+ {
+ genCell("", tci, false);
+ return;
+ }
+ generateRightIndented(tci, scaledLoad(val, tci->tcf->realFormat));
+}
+
+void
+HTMLReportElement::genCellRemainingEffort(TableCellInfo* tci)
+{
+ double val = 0.0;
+
+ if (!tci->tli->resource && tci->tli->task->isLeaf())
+ {
+ // Task line, no resource.
+ val = tci->tli->task->getRemainingLoad(tci->tli->sc);
+ }
+ else if (tci->tli->ca2->getType() == CA_Resource &&
+ tci->tli->task && tci->tli->task->isLeaf())
+ {
+ // Task line, nested into a resource
+ const Project* project = report->getProject();
+ time_t now = project->getNow();
+ if (now < project->getStart())
+ now = project->getStart();
+ if (now > project->getEnd())
+ now = project->getEnd();
+ Interval iv = Interval(now, project->getEnd());
+ val = tci->tli->task->getLoad(tci->tli->sc, iv, tci->tli->resource);
+ }
+ else
+ {
+ genCell("", tci, false);
+ return;
+ }
+
+ generateRightIndented(tci, scaledLoad(val, tci->tcf->realFormat));
+}
+
+void
HTMLReportElement::genCellStatus(TableCellInfo* tci)
{
- genCell(tci->tli->task->getStatusText(tci->tli->sc), tci, FALSE);
+ genCell(tci->tli->task->getStatusText(tci->tli->sc), tci, false);
}
void
if (tci->tcf->getId() == "reference")
{
if (tci->tli->task->getReference().isEmpty())
- genCell("", tci, TRUE);
+ genCell("", tci, true);
else
{
QString text ="<a href=\"" + tci->tli->task->getReference() + "\">";
else
text += htmlFilter(tci->tli->task->getReferenceLabel());
text += "</a>";
- genCell(text, tci, TRUE, FALSE);
+ genCell(text, tci, true, false);
}
return;
}
- const ReferenceAttribute* ra = (const ReferenceAttribute*)
- tci->tli->ca1->getCustomAttribute(tci->tcf->getId());
+ const ReferenceAttribute* ra = static_cast<const ReferenceAttribute*>
+ (tci->tli->ca1->getCustomAttribute(tci->tcf->getId()));
if (!ra || ra->getURL().isEmpty())
- genCell("", tci, TRUE);
+ genCell("", tci, true);
else
{
QString text ="<a href=\"" + ra->getURL() + "\">";
else
text += htmlFilter(ra->getLabel());
text += "</a>";
- genCell(text, tci, TRUE, FALSE);
+ genCell(text, tci, true, false);
}
}
void
HTMLReportElement::genCellScenario(TableCellInfo* tci)
{
- genCell(report->getProject()->getScenarioName(tci->tli->sc), tci, FALSE);
+ genCell(report->getProject()->getScenarioName(tci->tli->sc), tci, false);
}
#define GCDEPFOL(a, b) \
text += ", "; \
text += (*it)->getId(); \
} \
- genCell(text, tci, TRUE); \
+ genCell(text, tci, true); \
}
GCDEPFOL(Depends, Previous)
{
bgCol = colors.getColor("today");
}
- else if (tci->tli->resource->getLoad(tci->tli->sc, period) == 0.0 &&
- tci->tli->resource->getAvailableWorkLoad(tci->tli->sc, period) ==
+ else if (tci->tli->resource->getEffectiveLoad
+ (tci->tli->sc, period) == 0.0 &&
+ tci->tli->resource->getEffectiveFreeLoad(tci->tli->sc, period) ==
0.0)
{
bgCol = colors.getColor("vacation");
for (time_t t = beginOfT(start); t < end; t = sameTimeNextT(t))
{
Interval period = Interval(t, sameTimeNextT(t) - 1);
- double load = tci->tli->resource->getLoad(tci->tli->sc, period,
- AllAccounts, tci->tli->task);
+ double load = tci->tli->resource->getEffectiveLoad
+ (tci->tli->sc, period, AllAccounts, tci->tli->task);
QColor bgCol = selectResourceBgColor(tci, load, period, daily);
int runLength = 1;
endT = sameTimeNextT(endT))
{
Interval periodProbe = Interval(endT, sameTimeNextT(endT) - 1);
- double loadProbe =
- tci->tli->resource->getLoad(tci->tli->sc, periodProbe,
- AllAccounts, tci->tli->task);
+ double loadProbe = tci->tli->resource->getEffectiveLoad
+ (tci->tli->sc, periodProbe, AllAccounts, tci->tli->task);
QColor bgColProbe = selectResourceBgColor(tci, loadProbe,
periodProbe, daily);
void
HTMLReportElement::genCellDailyTask(TableCellInfo* tci)
{
- genCellTaskFunc(tci, TRUE, midnight, sameTimeNextDay);
+ genCellTaskFunc(tci, true, midnight, sameTimeNextDay);
}
void
HTMLReportElement::genCellDailyResource(TableCellInfo* tci)
{
- genCellResourceFunc(tci, TRUE, midnight, sameTimeNextDay);
+ genCellResourceFunc(tci, true, midnight, sameTimeNextDay);
}
void
Interval period = Interval(week, sameTimeNextWeek(week) - 1);
double load = tci->tli->task->getLoad(tci->tli->sc, period,
tci->tli->resource);
- QColor bgCol = selectTaskBgColor(tci, load, period, FALSE);
+ QColor bgCol = selectTaskBgColor(tci, load, period, false);
int runLength = 1;
if (!tci->tli->task->isActive(tci->tli->sc, period))
periodProbe,
tci->tli->resource);
QColor bgColProbe = selectTaskBgColor(tci, loadProbe,
- periodProbe, FALSE);
+ periodProbe, false);
if (load != loadProbe || bgCol != bgColProbe)
break;
lastEndWeek = endWeek;
week = sameTimeNextWeek(week))
{
Interval period = Interval(week, sameTimeNextWeek(week) - 1);
- double load = tci->tli->resource->getLoad(tci->tli->sc, period,
- AllAccounts, tci->tli->task);
- QColor bgCol = selectResourceBgColor(tci, load, period, FALSE);
+ double load = tci->tli->resource->getEffectiveLoad
+ (tci->tli->sc, period, AllAccounts, tci->tli->task);
+ QColor bgCol = selectResourceBgColor(tci, load, period, false);
int runLength = 1;
if (load == 0.0)
{
Interval periodProbe = Interval(endWeek)
.firstWeek(weekStartsMonday);
- double loadProbe =
- tci->tli->resource->getLoad(tci->tli->sc, periodProbe,
- AllAccounts, tci->tli->task);
+ double loadProbe = tci->tli->resource->getEffectiveLoad
+ (tci->tli->sc, periodProbe, AllAccounts, tci->tli->task);
QColor bgColProbe = selectResourceBgColor(tci, loadProbe,
- periodProbe, FALSE);
+ periodProbe, false);
if (load != loadProbe || bgCol != bgColProbe)
break;
lastEndWeek = endWeek;
void
HTMLReportElement::genCellMonthlyTask(TableCellInfo* tci)
{
- genCellTaskFunc(tci, FALSE, beginOfMonth, sameTimeNextMonth);
+ genCellTaskFunc(tci, false, beginOfMonth, sameTimeNextMonth);
}
void
HTMLReportElement::genCellMonthlyResource(TableCellInfo* tci)
{
- genCellResourceFunc(tci, FALSE, beginOfMonth, sameTimeNextMonth);
+ genCellResourceFunc(tci, false, beginOfMonth, sameTimeNextMonth);
}
void
void
HTMLReportElement::genCellQuarterlyTask(TableCellInfo* tci)
{
- genCellTaskFunc(tci, FALSE, beginOfQuarter, sameTimeNextQuarter);
+ genCellTaskFunc(tci, false, beginOfQuarter, sameTimeNextQuarter);
}
void
HTMLReportElement::genCellQuarterlyResource(TableCellInfo* tci)
{
- genCellResourceFunc(tci, FALSE, beginOfQuarter, sameTimeNextQuarter);
+ genCellResourceFunc(tci, false, beginOfQuarter, sameTimeNextQuarter);
}
void
void
HTMLReportElement::genCellYearlyTask(TableCellInfo* tci)
{
- genCellTaskFunc(tci, FALSE, beginOfYear, sameTimeNextYear);
+ genCellTaskFunc(tci, false, beginOfYear, sameTimeNextYear);
}
void
HTMLReportElement::genCellYearlyResource(TableCellInfo* tci)
{
- genCellResourceFunc(tci, FALSE, beginOfYear, sameTimeNextYear);
+ genCellResourceFunc(tci, false, beginOfYear, sameTimeNextYear);
}
void
text += (*it)->getId();
}
}
- genCell(text, tci, TRUE);
+ genCell(text, tci, true);
+}
+
+void
+HTMLReportElement::genCellScheduling(TableCellInfo* tci)
+{
+ genCell(tci->tli->task->getSchedulingText(), tci, true);
}
void
if (tci->tli->resource)
{
BookingList jobs = tci->tli->resource->getJobs(tci->tli->sc);
- jobs.setAutoDelete(TRUE);
+ jobs.setAutoDelete(true);
time_t prevTime = 0;
Interval reportPeriod(start, end);
s() << " <table style=\"width:150px; font-size:100%; "
HTMLReportElement::genCell##a##Effort(TableCellInfo* tci) \
{ \
genCell(tci->tcf->realFormat.format \
- (tci->tli->resource->get##a##Effort(), FALSE), \
- tci, TRUE); \
+ (tci->tli->resource->get##a##Effort(), false), \
+ tci, true); \
}
GCEFFORT(Min)
{
genCell(tci->tcf->realFormat.format
(tci->tli->resource->getLimits() ?
- tci->tli->resource->getLimits()->getDailyMax() : 0, FALSE),
- tci, TRUE);
+ tci->tli->resource->getLimits()->getDailyMax() : 0, false),
+ tci, true);
}
void
HTMLReportElement::genCellEfficiency(TableCellInfo* tci)
{
genCell(tci->tcf->realFormat.format(tci->tli->resource->getEfficiency(),
- tci), tci, TRUE);
+ tci), tci, true);
}
void
HTMLReportElement::genCellRate(TableCellInfo* tci)
{
genCell(tci->tcf->realFormat.format(tci->tli->resource->getRate(), tci),
- tci, TRUE);
-}
-
-void
-HTMLReportElement::genCellKotrusId(TableCellInfo* tci)
-{
- genCell(tci->tli->resource->getKotrusId(), tci, TRUE);
+ tci, true);
}
void
Interval(start, end));
if (tci->tli->account->isLeaf())
tci->tci->addToSum(tci->tli->sc, "total", value);
- genCell(tci->tcf->realFormat.format(value, tci), tci, FALSE);
+ genCell(tci->tcf->realFormat.format(value, tci), tci, false);
}
void
val += *it;
else
val = *it;
- genCell(tci->tcf->realFormat.format(val, tci), tci, FALSE);
+ genCell(tci->tcf->realFormat.format(val, tci), tci, false);
}
}
else
// column cases.
if (tci->tci->getSubColumns() > 0)
for (uint col = 0; col < tci->tci->getSubColumns(); ++col)
- genCell(tci->tcf->realFormat.format(0.0, tci), tci, FALSE);
+ genCell(tci->tcf->realFormat.format(0.0, tci), tci, false);
else
- genCell(tci->tcf->realFormat.format(0.0, tci), tci, FALSE);
+ genCell(tci->tcf->realFormat.format(0.0, tci), tci, false);
}
}