<% if(condition_type) { %>
onclick="doRefreshTemp();" onchange="doRefreshTemp()">
|
<% } %>
<%
String paramCNot = null;
try { paramCNot = Criteria2.isCr2Not() ? "1" : null; } catch (FieldNotInitializedException ex) { paramCNot = null; }
%>
>
|
onclick="doRefreshFreeValue();" onchange="doRefreshFreeValue()">
|
|
<%
if (objetBean != null){
Vector vectFields = dico.getTableFields("sql", paramObject, true, false);
// let's get the object field
Vector Champs = new Vector();
for (int i = 0; i < vectFields.size(); i++) {
FieldBean fldBean = (FieldBean) vectFields.elementAt(i);
String fldID = null;
try {
fldID = fldBean.getID();
} catch (FieldNotInitializedException ex) {}
String fldSQL = null;
try {
fldSQL = fldBean.getFldSql();
} catch (FieldNotInitializedException ex) {}
boolean horsCible = false;
try {
horsCible = fldBean.isFldCriteria();
} catch (FieldNotInitializedException ex) {}
if (!horsCible) {
String fldDisplay = null;
try {
fldDisplay = fldBean.getFldDisplay();
} catch (FieldNotInitializedException ex) {
fldDisplay = "";
}
try {
fldDisplay = Utils.getMessage(session, fldBean
.getFldDisplayLabel(), false, true, fldDisplay);
} catch (FieldNotInitializedException fnie) {
}
if ("".equals(fldDisplay)){
fldDisplay = fldSQL;
}
//String[] Fields = {fldID,fldDisplay};
//Champs.addElement(Fields);
Champs.addElement(new DisplayField(fldID, fldDisplay));
}
}
// sort the fields
java.util.Collections.sort(Champs);
// and then add the eventual "question types"
//String[] FieldsStat = {"","------------------------"};
// liste des conditions types
Vector questionsToAdd=new Vector();
if(!condition_type) {
//Champs.addElement(FieldsStat);
//questionsToAdd.addElement(new DisplayField("", "------------------------"));
String[] fieldS = {"Se2ID", "Se2Name"};
String[][] queryS = {{"Se2Condition = 1", "Se2Model:SmdObjID = "+Utils.formatToSQL(context, paramObjectID)}};
logger.debug("Query: " + paramObjectID);
Vector list = Selection2Bean.listSummary(session, fieldS, queryS);
logger.debug("Query: " + list);
if (list != null && list.size() > 0) {
for (int i = 0; i < list.size(); i++) {
Hashtable row = (Hashtable) list.elementAt(i);
String conditionID = (String) row.get("Se2ID");
String conditionName = (String) row.get("Se2Name");
//String[] Fields= {"Condition|"+conditionID,conditionName};
//Champs.addElement(Fields);
questionsToAdd.addElement(new DisplayField("Condition|"+conditionID, conditionName));
}
}
if (!questionsToAdd.isEmpty()) {
// sort them
java.util.Collections.sort(questionsToAdd);
Champs.addElement(new DisplayField("", "------------------------"));
Champs.addAll(questionsToAdd);
}
}
%>
|
<%
}
%>
<%
if (paramCFldID != null && !"null".equals(paramCFldID)){
%>
|
<%
//on construit les inputs pour saisir les différentes valeurs.
} if(paramCOpe != null && !isValueNeeded) {
%> <% if(freeValue && isValueNeeded){
String cr2FldId = Criteria2.getCr2FldID();
String cr2FobId = Criteria2.getCr2FobID();
// If Actor fob field
if(cr2FobId != null && !"".equals(cr2FobId)){
ObjectsBean objectsBean = new ObjectsBean(cr2FobId, session);
if(objectsBean != null && "Actor".equals(objectsBean.getObjSql())){
if(Criteria2.getCr2Chx() != null){
Vector cr2ChxVector = Criteria2.getCr2Chx();
cr2ChxVector.clear();
Criteria2.getCr2Chx().add("$$ActID$$");
} else {
Vector cr2ChxVector = new Vector();
cr2ChxVector.clear();
cr2ChxVector.add("$$ActID$$");
Criteria2.setCr2Chx(cr2ChxVector);
}
}
} else if(cr2FldId != null){
FieldBean fldBean = new FieldBean(cr2FldId, session);
// If a date type field
if(fldBean != null && fldBean.isDate()){
if(Criteria2.getCr2Chx() != null){
Vector cr2ChxVector = Criteria2.getCr2Chx();
cr2ChxVector.clear();
Criteria2.getCr2Chx().add("$$CurrentDate$$");
} else {
Vector cr2ChxVector = new Vector();
cr2ChxVector.clear();
cr2ChxVector.add("$$CurrentDate$$");
Criteria2.setCr2Chx(cr2ChxVector);
}
}
}
%>
<% } else { %><%=Utils.formatToWeb((String)vectChx.firstElement(), true)%><%}%>" size="40" style="width: 100%">
<%} else { %>
|
<%} %>
<%
} else if(isOpeSelected && trou) {
%>
|
<%
} else if (isOpeSelected && ! trou){
%>
<% String htmlInput=null;
if (hasCustomUi) {
try {
htmlInput=tfim.getHtmlForCriteriaEdit(session,flRequest,criteriaFieldName,selection2Bean,Criteria2);
} catch (FrontlineException e) {
logger.error("Exception in criteria edit:"+e.getMessage());
}
}
if (htmlInput!=null) {
%>
<%= htmlInput %>
<% } else if(isControledByFob) {
ObjectsBean ctlFob = dico.getTable("id", fld.getFldFobID());
%>
<%
} else if(isControledByRef) {
if(freeValue){%>
<% } else { %><%=Utils.formatToWeb((String)vectChx.firstElement(), true)%><%}%>" size="40" style="width: 100%">
<% } else {
Vector vectRef = dico.getRefList(session, fld.getFldSql());
%>
<% }
} else if(isDate) {
if(freeValue){
try{
Vector cr2ChxVector = Criteria2.getCr2Chx();
cr2ChxVector.clear();
cr2ChxVector.add("$$CurrentDate$$");
} catch (FieldNotInitializedException e){
Vector cr2ChxVector = new Vector();
cr2ChxVector.clear();
cr2ChxVector.add("$$CurrentDate$$");
Criteria2.setCr2Chx(cr2ChxVector);
}
%>
<% } else { %><%=Utils.formatToWeb((String)vectChx.firstElement(), true)%><%}%>" size="40" style="width: 100%">
<% } else {
String strDate = "";
String strTime = "";
String vectChxValue = null;
if(!vectChx.isEmpty()){
vectChxValue = (String)vectChx.firstElement();
}
java.util.Date date = null;
if(vectChxValue != null && !"$$CurrentDate$$".equals(vectChxValue)){
date = Utils.formatDateFromWeb(session, vectChxValue);
}
strDate = Utils.formatToWebDate(session, date, true);
String time = Utils.formatToWebTime(session, date, true);
if(time != null && time.length()>5){
strTime = time.substring(0, 5);
}
%>
');">
';return true;" onMouseOut="window.status=' '; return true">
');">
<% }
} else if(isNumeric || isText) {
%> <% } else { %><%=Utils.formatToWeb((String)vectChx.firstElement(), true)%><%}%>" size="40" style="width: 100%"<% if(isNumeric && !isMultipleValues) { %> onBlur="ctrlNumField(this, '<%= isDecimal ? "float" : "integer" %>', '');"<% } %>>
<%
if(isMultipleValues) {
%>
<%
}
} else if(isBoolean) {
%>
<%
}
%>
|
<%
}
%>