{
if (cf.getCustomFieldType().getKey().equals(Consts.CF_KEY_QUERY_LINKER_FIELD))
{
if (cf.isAllProjects())
{
QueryFieldStruct qfs = new QueryFieldStruct(
cf.getIdAsLong(),
cf.getName(),
cf.getDescription(),
Consts.PROJECT_ID_FOR_GLOBAL_CF,
Consts.PROJECT_NAME_FOR_GLOBAL_CF,
qfMgr.getQueryFieldData(cf.getIdAsLong(), Consts.PROJECT_ID_FOR_GLOBAL_CF),
qfMgr.getAddNull(cf.getIdAsLong(), Consts.PROJECT_ID_FOR_GLOBAL_CF),
qfMgr.isAutocompleteView(cf.getIdAsLong(), Consts.PROJECT_ID_FOR_GLOBAL_CF),
qfMgr.getLinkeFieldsOptions(cf.getIdAsLong(), Consts.PROJECT_ID_FOR_GLOBAL_CF));
cfData.addLinkerField(qfs);
}
else
{
List<GenericValue> projs = cf.getAssociatedProjects();
for (GenericValue proj : projs)
{
Long projId = (Long) proj.get("id");
String projName = (String) proj.get("name");
QueryFieldStruct qfs = new QueryFieldStruct(
cf.getIdAsLong(),
cf.getName(),
cf.getDescription(),
projId,
projName,
qfMgr.getQueryFieldData(cf.getIdAsLong(), projId),
qfMgr.getAddNull(cf.getIdAsLong(), projId),
qfMgr.isAutocompleteView(cf.getIdAsLong(), projId),
qfMgr.getLinkeFieldsOptions(cf.getIdAsLong(), projId));
cfData.addLinkerField(qfs);
}
}
}
else if (cf.getCustomFieldType().getKey().equals(Consts.CF_KEY_QUERY_LINKED_FIELD))
{
if (cf.isAllProjects())
{
QueryFieldStruct qfs = new QueryFieldStruct(
cf.getIdAsLong(),
cf.getName(),
cf.getDescription(),
Consts.PROJECT_ID_FOR_GLOBAL_CF,
Consts.PROJECT_NAME_FOR_GLOBAL_CF,
qfMgr.getQueryFieldData(cf.getIdAsLong(), Consts.PROJECT_ID_FOR_GLOBAL_CF),
qfMgr.getAddNull(cf.getIdAsLong(), Consts.PROJECT_ID_FOR_GLOBAL_CF),
qfMgr.isAutocompleteView(cf.getIdAsLong(), Consts.PROJECT_ID_FOR_GLOBAL_CF),
qfMgr.getLinkeFieldsOptions(cf.getIdAsLong(), Consts.PROJECT_ID_FOR_GLOBAL_CF));
cfData.addLinkedField(qfs);
}
else
{
List<GenericValue> projs = cf.getAssociatedProjects();
for (GenericValue proj : projs)
{
Long projId = (Long) proj.get("id");
String projName = (String) proj.get("name");
QueryFieldStruct qfs = new QueryFieldStruct(
cf.getIdAsLong(),
cf.getName(),
cf.getDescription(),
projId,
projName,
qfMgr.getQueryFieldData(cf.getIdAsLong(), projId),
qfMgr.getAddNull(cf.getIdAsLong(), projId),
qfMgr.isAutocompleteView(cf.getIdAsLong(), projId),
qfMgr.getLinkeFieldsOptions(cf.getIdAsLong(), projId));
cfData.addLinkedField(qfs);
}
}
}
else if (cf.getCustomFieldType().getKey().equals(Consts.CF_KEY_QUERY_LINKER_MULTI_FIELD))
{
if (cf.isAllProjects())
{
QueryFieldStruct qfs = new QueryFieldStruct(
cf.getIdAsLong(),
cf.getName(),
cf.getDescription(),
Consts.PROJECT_ID_FOR_GLOBAL_CF,
Consts.PROJECT_NAME_FOR_GLOBAL_CF,
qfMgr.getQueryFieldData(cf.getIdAsLong(), Consts.PROJECT_ID_FOR_GLOBAL_CF),
qfMgr.getAddNull(cf.getIdAsLong(), Consts.PROJECT_ID_FOR_GLOBAL_CF),
qfMgr.isAutocompleteView(cf.getIdAsLong(), Consts.PROJECT_ID_FOR_GLOBAL_CF),
qfMgr.getLinkeFieldsOptions(cf.getIdAsLong(), Consts.PROJECT_ID_FOR_GLOBAL_CF));
cfData.addMultiFields(qfs);
}
else
{
List<GenericValue> projs = cf.getAssociatedProjects();
for (GenericValue proj : projs)
{
Long projId = (Long) proj.get("id");
String projName = (String) proj.get("name");
QueryFieldStruct qfs = new QueryFieldStruct(
cf.getIdAsLong(),
cf.getName(),
cf.getDescription(),
projId,
projName,