use of org.compiere.model.MAchievement in project adempiere by adempiere.
the class HtmlDashboard method goalsDetail.
private String goalsDetail(int AD_Table_ID) {
//TODO link to goals
String output = "";
if (m_goals == null)
return output;
for (int i = 0; i < m_goals.length; i++) {
MMeasureCalc mc = MMeasureCalc.get(Env.getCtx(), m_goals[i].getMeasure().getPA_MeasureCalc_ID());
if (AD_Table_ID == m_goals[i].getPA_Goal_ID()) {
// mc.getAD_Table_ID()) {
output += "<table class=\"dataGrid\"><tr>\n<th colspan=\"3\" class=\"label\"><b>" + m_goals[i].getName() + "</b></th></tr>\n";
output += "<tr><td class=\"label\">Target</td><td colspan=\"2\" class=\"tdcontent\">" + m_goals[i].getMeasureTarget() + "</td></tr>\n";
output += "<tr><td class=\"label\">Actual</td><td colspan=\"2\" class=\"tdcontent\">" + m_goals[i].getMeasureActual() + "</td></tr>\n";
//if (mc.getTableName()!=null) output += "table: " + mc.getAD_Table_ID() + "<br>\n";
Graph barPanel = new Graph(m_goals[i]);
GraphColumn[] bList = barPanel.getGraphColumnList();
MQuery query = null;
output += "<tr><td rowspan=\"" + bList.length + "\" class=\"label\" valign=\"top\">" + m_goals[i].getXAxisText() + "</td>\n";
for (int k = 0; k < bList.length; k++) {
GraphColumn bgc = bList[k];
if (k > 0)
output += "<tr>";
if (// Single Achievement
bgc.getAchievement() != null) {
MAchievement a = bgc.getAchievement();
query = MQuery.getEqualQuery("PA_Measure_ID", a.getPA_Measure_ID());
} else if (// Multiple Achievements
bgc.getGoal() != null) {
MGoal goal = bgc.getGoal();
query = MQuery.getEqualQuery("PA_Measure_ID", goal.getPA_Measure_ID());
} else if (// Document
bgc.getMeasureCalc() != null) {
mc = bgc.getMeasureCalc();
query = mc.getQuery(m_goals[i].getRestrictions(false), bgc.getMeasureDisplay(), bgc.getDate(), // logged in role
MRole.getDefault());
} else if (// Document
bgc.getProjectType() != null) {
MProjectType pt = bgc.getProjectType();
query = pt.getQuery(m_goals[i].getRestrictions(false), bgc.getMeasureDisplay(), bgc.getDate(), bgc.getID(), // logged in role
MRole.getDefault());
} else if (// Document
bgc.getRequestType() != null) {
MRequestType rt = bgc.getRequestType();
query = rt.getQuery(m_goals[i].getRestrictions(false), bgc.getMeasureDisplay(), bgc.getDate(), bgc.getID(), // logged in role
MRole.getDefault());
}
output += "<td class=\"tdcontent\">" + bgc.getLabel() + "</td><td class=\"tdcontent\">";
if (query != null) {
output += "<a class=\"hrefZoom\" href=\"http:///window/zoom#" + queryZoom.size() + "\">" + bgc.getValue() + "</a><br>\n";
queryZoom.add(query);
} else {
log.info("Nothing to zoom to - " + bgc);
output += bgc.getValue();
}
output += "</td></tr>";
}
output += "</tr>" + "<tr><td colspan=\"3\">" + m_goals[i].getDescription() + "<br>" + stripHtml(m_goals[i].getColorSchema().getDescription(), true) + "</td></tr>" + "</table>\n";
bList = null;
barPanel = null;
}
}
return output;
}
use of org.compiere.model.MAchievement in project adempiere by adempiere.
the class GraphColumn method getMQuery.
// setHeight
public MQuery getMQuery(MGoal mGoal) {
MQuery query = null;
if (// Single Achievement
getAchievement() != null) {
MAchievement a = getAchievement();
query = MQuery.getEqualQuery("PA_Measure_ID", a.getPA_Measure_ID());
} else if (// Multiple Achievements
getGoal() != null) {
MGoal goal = getGoal();
query = MQuery.getEqualQuery("PA_Measure_ID", goal.getPA_Measure_ID());
} else if (// Document
getMeasureCalc() != null) {
MMeasureCalc mc = getMeasureCalc();
query = mc.getQuery(mGoal.getRestrictions(false), getMeasureDisplay(), getDate(), // logged in role
MRole.getDefault());
} else if (// Document
getProjectType() != null) {
MProjectType pt = getProjectType();
query = pt.getQuery(mGoal.getRestrictions(false), getMeasureDisplay(), getDate(), getID(), // logged in role
MRole.getDefault());
} else if (// Document
getRequestType() != null) {
MRequestType rt = getRequestType();
query = rt.getQuery(mGoal.getRestrictions(false), getMeasureDisplay(), getDate(), getID(), // logged in role
MRole.getDefault());
}
return query;
}
Aggregations