use of org.compiere.model.MRequestType in project adempiere by adempiere.
the class MRequestTypeTest method testQuery.
public void testQuery() throws Exception {
MRequestType req = MRequestType.getDefault(getCtx());
assertTrue("There should be default requesttype", req.getAD_Client_ID() == 11);
}
use of org.compiere.model.MRequestType in project adempiere by adempiere.
the class WebInfo method getRequestType.
// getRequestTypes
/**
* Get Request Type
* @return Request Type
*/
public MRequestType getRequestType() {
m_infoMessage = null;
MRequestType retValue = null;
String sql = "SELECT * FROM R_RequestType WHERE IsSelfService='Y' AND R_RequestType_ID=?";
PreparedStatement pstmt = null;
ResultSet rs = null;
try {
pstmt = DB.prepareStatement(sql, null);
pstmt.setInt(1, m_id);
rs = pstmt.executeQuery();
if (rs.next())
retValue = new MRequestType(m_ctx, rs, null);
} catch (Exception e) {
log.log(Level.SEVERE, sql, e);
} finally {
DB.close(rs, pstmt);
rs = null;
pstmt = null;
}
log.fine("R_RequestType_ID=" + m_id + " - " + retValue);
return retValue;
}
use of org.compiere.model.MRequestType in project adempiere by adempiere.
the class WebInfo method getRequestTypes.
// getRequest
/**
* Get Request Types
* @return Array of Request Types
*/
public ArrayList<MRequestType> getRequestTypes() {
m_infoMessage = null;
ArrayList<MRequestType> list = new ArrayList<MRequestType>();
String sql = "SELECT * FROM R_RequestType " + "WHERE IsSelfService='Y' AND AD_Client_ID=? ORDER BY Name";
PreparedStatement pstmt = null;
ResultSet rs = null;
try {
pstmt = DB.prepareStatement(sql, null);
pstmt.setInt(1, getAD_Client_ID());
rs = pstmt.executeQuery();
while (rs.next()) list.add(new MRequestType(m_ctx, rs, null));
rs.close();
pstmt.close();
pstmt = null;
} catch (Exception e) {
log.log(Level.SEVERE, sql, e);
} finally {
DB.close(rs, pstmt);
rs = null;
pstmt = null;
}
log.fine("#" + list.size());
return list;
}
use of org.compiere.model.MRequestType 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.MRequestType 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