Refactoring of [ 1757088 ] Grid Collapse and Tab Group
This commit is contained in:
parent
52b0db967b
commit
d10f57c561
|
@ -1024,6 +1024,14 @@ public class GridField
|
||||||
{
|
{
|
||||||
return m_vo.FieldGroup;
|
return m_vo.FieldGroup;
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
* Get Field Group Type
|
||||||
|
* @return field group type
|
||||||
|
*/
|
||||||
|
public String getFieldGroupType()
|
||||||
|
{
|
||||||
|
return m_vo.FieldGroupType;
|
||||||
|
}
|
||||||
/**
|
/**
|
||||||
* Key
|
* Key
|
||||||
* @return key
|
* @return key
|
||||||
|
|
|
@ -127,6 +127,8 @@ public class GridFieldVO implements Serializable
|
||||||
vo.ValueMax = rs.getString (i);
|
vo.ValueMax = rs.getString (i);
|
||||||
else if (columnName.equalsIgnoreCase("FieldGroup"))
|
else if (columnName.equalsIgnoreCase("FieldGroup"))
|
||||||
vo.FieldGroup = rs.getString (i);
|
vo.FieldGroup = rs.getString (i);
|
||||||
|
else if (columnName.equalsIgnoreCase("FieldGroupType"))
|
||||||
|
vo.FieldGroupType = rs.getString (i);
|
||||||
else if (columnName.equalsIgnoreCase("IsKey"))
|
else if (columnName.equalsIgnoreCase("IsKey"))
|
||||||
vo.IsKey = "Y".equals(rs.getString (i));
|
vo.IsKey = "Y".equals(rs.getString (i));
|
||||||
else if (columnName.equalsIgnoreCase("IsParent"))
|
else if (columnName.equalsIgnoreCase("IsParent"))
|
||||||
|
@ -373,6 +375,8 @@ public class GridFieldVO implements Serializable
|
||||||
public String ValueMax = "";
|
public String ValueMax = "";
|
||||||
/** Field Group */
|
/** Field Group */
|
||||||
public String FieldGroup = "";
|
public String FieldGroup = "";
|
||||||
|
/** Field Group Type */
|
||||||
|
public String FieldGroupType = "";
|
||||||
/** PK */
|
/** PK */
|
||||||
public boolean IsKey = false;
|
public boolean IsKey = false;
|
||||||
/** FK */
|
/** FK */
|
||||||
|
@ -434,6 +438,8 @@ public class GridFieldVO implements Serializable
|
||||||
DefaultValue = "";
|
DefaultValue = "";
|
||||||
if (FieldGroup == null)
|
if (FieldGroup == null)
|
||||||
FieldGroup = "";
|
FieldGroup = "";
|
||||||
|
if (FieldGroupType == null)
|
||||||
|
FieldGroupType = "";
|
||||||
if (Description == null)
|
if (Description == null)
|
||||||
Description = "";
|
Description = "";
|
||||||
if (Help == null)
|
if (Help == null)
|
||||||
|
@ -508,6 +514,7 @@ public class GridFieldVO implements Serializable
|
||||||
clone.ValueMin = ValueMin;
|
clone.ValueMin = ValueMin;
|
||||||
clone.ValueMax = ValueMax;
|
clone.ValueMax = ValueMax;
|
||||||
clone.FieldGroup = FieldGroup;
|
clone.FieldGroup = FieldGroup;
|
||||||
|
clone.FieldGroupType = FieldGroupType;
|
||||||
clone.IsKey = IsKey;
|
clone.IsKey = IsKey;
|
||||||
clone.IsParent = IsParent;
|
clone.IsParent = IsParent;
|
||||||
clone.Callout = Callout;
|
clone.Callout = Callout;
|
||||||
|
|
|
@ -29,6 +29,9 @@ import org.compiere.grid.ed.*;
|
||||||
import org.compiere.model.*;
|
import org.compiere.model.*;
|
||||||
import org.compiere.swing.*;
|
import org.compiere.swing.*;
|
||||||
import org.compiere.util.*;
|
import org.compiere.util.*;
|
||||||
|
import org.jdesktop.swingx.JXTaskPane;
|
||||||
|
import org.jdesktop.swingx.JXTaskPaneContainer;
|
||||||
|
import org.jdesktop.swingx.border.DropShadowBorder;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Single Row Panel.
|
* Single Row Panel.
|
||||||
|
@ -120,8 +123,7 @@ public final class VPanel extends CTabbedPane
|
||||||
private java.util.Hashtable m_tablist = new java.util.Hashtable();
|
private java.util.Hashtable m_tablist = new java.util.Hashtable();
|
||||||
private java.util.Hashtable m_tabincludelist = new java.util.Hashtable();
|
private java.util.Hashtable m_tabincludelist = new java.util.Hashtable();
|
||||||
private CPanel m_main = new CPanel(org.compiere.plaf.CompiereColor.getDefaultBackground());
|
private CPanel m_main = new CPanel(org.compiere.plaf.CompiereColor.getDefaultBackground());
|
||||||
private int typeGroup = 3;
|
private DropShadowBorder marginBorder = new DropShadowBorder();
|
||||||
private org.jdesktop.swingx.border.DropShadowBorder marginBorder = new org.jdesktop.swingx.border.DropShadowBorder();
|
|
||||||
|
|
||||||
/** Logger */
|
/** Logger */
|
||||||
private static CLogger log = CLogger.getCLogger (VPanel.class);
|
private static CLogger log = CLogger.getCLogger (VPanel.class);
|
||||||
|
@ -168,8 +170,8 @@ public final class VPanel extends CTabbedPane
|
||||||
m_gbc.gridx = 0;
|
m_gbc.gridx = 0;
|
||||||
m_gbc.gridy = m_line++;
|
m_gbc.gridy = m_line++;
|
||||||
m_gbc.gridwidth = 4;
|
m_gbc.gridwidth = 4;
|
||||||
org.jdesktop.swingx.JXTaskPaneContainer GroupPaneContainer = createTaskPaneContainer();
|
JXTaskPaneContainer GroupPaneContainer = createTaskPaneContainer();
|
||||||
org.jdesktop.swingx.JXTaskPane m_tab = new org.jdesktop.swingx.JXTaskPane();
|
JXTaskPane m_tab = new JXTaskPane();
|
||||||
m_tab.getContentPane().setBackground(AdempierePLAF.getFormBackground());
|
m_tab.getContentPane().setBackground(AdempierePLAF.getFormBackground());
|
||||||
m_tab.setLayout(new BorderLayout());
|
m_tab.setLayout(new BorderLayout());
|
||||||
GroupPaneContainer.add(m_tab);
|
GroupPaneContainer.add(m_tab);
|
||||||
|
@ -193,12 +195,13 @@ public final class VPanel extends CTabbedPane
|
||||||
boolean sameLine = mField.isSameLine();
|
boolean sameLine = mField.isSameLine();
|
||||||
//[ 1757088 ] // sets top
|
//[ 1757088 ] // sets top
|
||||||
String fieldGroup = mField.getFieldGroup();
|
String fieldGroup = mField.getFieldGroup();
|
||||||
|
String fieldGroupType = mField.getFieldGroupType();
|
||||||
if (fieldGroup == "")
|
if (fieldGroup == "")
|
||||||
{
|
{
|
||||||
fieldGroup = m_oldFieldGroup;
|
fieldGroup = m_oldFieldGroup;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (addGroup(fieldGroup)) // sets top
|
if (addGroup(fieldGroup, fieldGroupType)) // sets top
|
||||||
sameLine = false;
|
sameLine = false;
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -229,18 +232,18 @@ public final class VPanel extends CTabbedPane
|
||||||
// Add Label
|
// Add Label
|
||||||
//[ 1757088 ]
|
//[ 1757088 ]
|
||||||
//this.add(label, m_gbc);
|
//this.add(label, m_gbc);
|
||||||
if (typeGroup == 1)
|
if (fieldGroupType.equals(X_AD_FieldGroup.FIELDGROUPTYPE_Tab))
|
||||||
{
|
{
|
||||||
CPanel m_tab = (CPanel)m_tablist.get(fieldGroup);
|
CPanel m_tab = (CPanel)m_tablist.get(fieldGroup);
|
||||||
m_tab.add(label, m_gbc);
|
m_tab.add(label, m_gbc);
|
||||||
|
|
||||||
}
|
}
|
||||||
else if (typeGroup == 2)
|
else if (fieldGroupType.equals(X_AD_FieldGroup.FIELDGROUPTYPE_Collapse))
|
||||||
{
|
{
|
||||||
org.jdesktop.swingx.JXTaskPane m_tab = (org.jdesktop.swingx.JXTaskPane)m_tablist.get(fieldGroup);
|
JXTaskPane m_tab = (JXTaskPane)m_tablist.get(fieldGroup);
|
||||||
m_tab.add(label, m_gbc);
|
m_tab.add(label, m_gbc);
|
||||||
}
|
}
|
||||||
else if (typeGroup == 3)
|
else // Label or null
|
||||||
{
|
{
|
||||||
m_main.add(label, m_gbc);
|
m_main.add(label, m_gbc);
|
||||||
}
|
}
|
||||||
|
@ -264,17 +267,17 @@ public final class VPanel extends CTabbedPane
|
||||||
m_gbc.weightx = 1;
|
m_gbc.weightx = 1;
|
||||||
// Add Field
|
// Add Field
|
||||||
//[ 1757088 ]
|
//[ 1757088 ]
|
||||||
if (typeGroup == 1)
|
if (fieldGroupType.equals(X_AD_FieldGroup.FIELDGROUPTYPE_Tab))
|
||||||
{
|
{
|
||||||
CPanel m_tab = (CPanel)m_tablist.get(fieldGroup);
|
CPanel m_tab = (CPanel)m_tablist.get(fieldGroup);
|
||||||
m_tab.add(field, m_gbc);
|
m_tab.add(field, m_gbc);
|
||||||
}
|
}
|
||||||
else if (typeGroup == 2)
|
else if (fieldGroupType.equals(X_AD_FieldGroup.FIELDGROUPTYPE_Collapse))
|
||||||
{
|
{
|
||||||
org.jdesktop.swingx.JXTaskPane m_tab = (org.jdesktop.swingx.JXTaskPane)m_tablist.get(fieldGroup);
|
JXTaskPane m_tab = (JXTaskPane)m_tablist.get(fieldGroup);
|
||||||
m_tab.add(field, m_gbc);
|
m_tab.add(field, m_gbc);
|
||||||
}
|
}
|
||||||
else if (typeGroup == 3)
|
else // Label or null
|
||||||
{
|
{
|
||||||
m_main.add(field, m_gbc);
|
m_main.add(field, m_gbc);
|
||||||
}
|
}
|
||||||
|
@ -289,9 +292,10 @@ public final class VPanel extends CTabbedPane
|
||||||
/**
|
/**
|
||||||
* Add Group
|
* Add Group
|
||||||
* @param fieldGroup field group
|
* @param fieldGroup field group
|
||||||
|
* @param fieldGroupType
|
||||||
* @return true if group added
|
* @return true if group added
|
||||||
*/
|
*/
|
||||||
private boolean addGroup(String fieldGroup)
|
private boolean addGroup(String fieldGroup, String fieldGroupType)
|
||||||
{
|
{
|
||||||
// First time - add top
|
// First time - add top
|
||||||
if (m_oldFieldGroup == null)
|
if (m_oldFieldGroup == null)
|
||||||
|
@ -310,23 +314,7 @@ public final class VPanel extends CTabbedPane
|
||||||
}
|
}
|
||||||
|
|
||||||
//[ 1757088 ]
|
//[ 1757088 ]
|
||||||
if (fieldGroup != null)
|
if (fieldGroupType.equals(X_AD_FieldGroup.FIELDGROUPTYPE_Tab))
|
||||||
{
|
|
||||||
if (Env.getContext(Env.getCtx(),"#AD_Language").equals("en_US"))
|
|
||||||
{
|
|
||||||
typeGroup = DB.getSQLValue(null,"SELECT CASE WHEN FieldGroupType = 'T' THEN 1 WHEN FieldGroupType = 'C' THEN 2 WHEN FieldGroupType = 'L' THEN 3 END AS Type FROM AD_FieldGroup fg WHERE fg.Name= ? ", fieldGroup);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
typeGroup = DB.getSQLValue(null,"SELECT CASE WHEN FieldGroupType = 'T' THEN 1 WHEN FieldGroupType = 'C' THEN 2 WHEN FieldGroupType = 'L' THEN 3 END AS Type FROM AD_FieldGroup fg INNER JOIN AD_FieldGroup_Trl fgtrl ON ( fg.AD_FieldGroup_ID = fgtrl.AD_FieldGroup_ID) WHERE fgtrl.Name= ? ", fieldGroup);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if(typeGroup < 1 )
|
|
||||||
{
|
|
||||||
typeGroup = 3;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (typeGroup == 1)
|
|
||||||
{
|
{
|
||||||
|
|
||||||
CPanel m_tab = new CPanel(org.compiere.plaf.CompiereColor.getDefaultBackground());
|
CPanel m_tab = new CPanel(org.compiere.plaf.CompiereColor.getDefaultBackground());
|
||||||
|
@ -347,10 +335,10 @@ public final class VPanel extends CTabbedPane
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
}
|
}
|
||||||
else if (typeGroup == 2)
|
else if (fieldGroupType.equals(X_AD_FieldGroup.FIELDGROUPTYPE_Collapse))
|
||||||
{
|
{
|
||||||
org.jdesktop.swingx.JXTaskPaneContainer GroupPaneContainer = createTaskPaneContainer();
|
JXTaskPaneContainer GroupPaneContainer = createTaskPaneContainer();
|
||||||
org.jdesktop.swingx.JXTaskPane m_tab = new org.jdesktop.swingx.JXTaskPane();
|
JXTaskPane m_tab = new JXTaskPane();
|
||||||
m_tab.getContentPane().setBackground(AdempierePLAF.getFormBackground());
|
m_tab.getContentPane().setBackground(AdempierePLAF.getFormBackground());
|
||||||
|
|
||||||
m_tab.setLayout(new GridBagLayout());
|
m_tab.setLayout(new GridBagLayout());
|
||||||
|
@ -373,7 +361,7 @@ public final class VPanel extends CTabbedPane
|
||||||
m_oldFieldGroup = fieldGroup;
|
m_oldFieldGroup = fieldGroup;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
else if (typeGroup == 3)
|
else // Label or null
|
||||||
{
|
{
|
||||||
CPanel group = new CPanel();
|
CPanel group = new CPanel();
|
||||||
group.setBorder(new VLine(fieldGroup));
|
group.setBorder(new VLine(fieldGroup));
|
||||||
|
@ -387,15 +375,14 @@ public final class VPanel extends CTabbedPane
|
||||||
m_oldFieldGroup = fieldGroup;
|
m_oldFieldGroup = fieldGroup;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
|
||||||
} // addGroup
|
} // addGroup
|
||||||
|
|
||||||
private org.jdesktop.swingx.JXTaskPaneContainer createTaskPaneContainer() {
|
private JXTaskPaneContainer createTaskPaneContainer() {
|
||||||
Color c = AdempierePLAF.getFormBackground();
|
Color c = AdempierePLAF.getFormBackground();
|
||||||
Color containerBg = new Color(Math.max((int)(c.getRed() * 0.97), 0),
|
Color containerBg = new Color(Math.max((int)(c.getRed() * 0.97), 0),
|
||||||
Math.max((int)(c.getGreen()*0.97), 0),
|
Math.max((int)(c.getGreen()*0.97), 0),
|
||||||
Math.max((int)(c.getBlue() *0.97), 0));
|
Math.max((int)(c.getBlue() *0.97), 0));
|
||||||
org.jdesktop.swingx.JXTaskPaneContainer GroupPaneContainer = new org.jdesktop.swingx.JXTaskPaneContainer();
|
JXTaskPaneContainer GroupPaneContainer = new JXTaskPaneContainer();
|
||||||
GroupPaneContainer.setBackground(containerBg);
|
GroupPaneContainer.setBackground(containerBg);
|
||||||
return GroupPaneContainer;
|
return GroupPaneContainer;
|
||||||
}
|
}
|
||||||
|
@ -630,10 +617,11 @@ public final class VPanel extends CTabbedPane
|
||||||
public void setBackground (int AD_Color_ID)
|
public void setBackground (int AD_Color_ID)
|
||||||
{
|
{
|
||||||
} // setBackground
|
} // setBackground
|
||||||
|
|
||||||
//[ 1757088 ]
|
//[ 1757088 ]
|
||||||
public org.jdesktop.swingx.JXTaskPane getTaskPane(int AD_Tab_ID)
|
public JXTaskPane getTaskPane(int AD_Tab_ID)
|
||||||
{
|
{
|
||||||
return (org.jdesktop.swingx.JXTaskPane)m_tabincludelist.get(AD_Tab_ID);
|
return (JXTaskPane)m_tabincludelist.get(AD_Tab_ID);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void findChildComponents(CPanel container, List list)
|
private void findChildComponents(CPanel container, List list)
|
||||||
|
@ -642,18 +630,18 @@ public final class VPanel extends CTabbedPane
|
||||||
for (int c = 0; c < comp.length; c++)
|
for (int c = 0; c < comp.length; c++)
|
||||||
{
|
{
|
||||||
list.add(comp[c]);
|
list.add(comp[c]);
|
||||||
if ( comp [c] instanceof org.jdesktop.swingx.JXTaskPaneContainer)
|
if ( comp [c] instanceof JXTaskPaneContainer)
|
||||||
{
|
{
|
||||||
org.jdesktop.swingx.JXTaskPaneContainer panetaskcontainer = (org.jdesktop.swingx.JXTaskPaneContainer)comp [c];
|
JXTaskPaneContainer panetaskcontainer = (JXTaskPaneContainer)comp [c];
|
||||||
|
|
||||||
Component[] comppanetask = panetaskcontainer.getComponents();
|
Component[] comppanetask = panetaskcontainer.getComponents();
|
||||||
|
|
||||||
for (int y = 0; y < comppanetask.length; y++)
|
for (int y = 0; y < comppanetask.length; y++)
|
||||||
{
|
{
|
||||||
|
|
||||||
if ( comppanetask [y] instanceof org.jdesktop.swingx.JXTaskPane)
|
if ( comppanetask [y] instanceof JXTaskPane)
|
||||||
{
|
{
|
||||||
org.jdesktop.swingx.JXTaskPane tabtask = (org.jdesktop.swingx.JXTaskPane)comppanetask[y];
|
JXTaskPane tabtask = (JXTaskPane)comppanetask[y];
|
||||||
Component[] comptabtask = tabtask.getContentPane().getComponents();
|
Component[] comptabtask = tabtask.getContentPane().getComponents();
|
||||||
|
|
||||||
for (int x = 0; x < comptabtask.length; x++)
|
for (int x = 0; x < comptabtask.length; x++)
|
||||||
|
@ -689,4 +677,5 @@ public final class VPanel extends CTabbedPane
|
||||||
list.toArray (result);
|
list.toArray (result);
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
} // VPanel
|
} // VPanel
|
|
@ -6,15 +6,16 @@ CREATE OR REPLACE VIEW AD_FIELD_V
|
||||||
COLUMNSQL, FIELDLENGTH, VFORMAT, DEFAULTVALUE, ISKEY,
|
COLUMNSQL, FIELDLENGTH, VFORMAT, DEFAULTVALUE, ISKEY,
|
||||||
ISPARENT, ISMANDATORY, ISIDENTIFIER, ISTRANSLATED, AD_REFERENCE_VALUE_ID,
|
ISPARENT, ISMANDATORY, ISIDENTIFIER, ISTRANSLATED, AD_REFERENCE_VALUE_ID,
|
||||||
CALLOUT, AD_REFERENCE_ID, AD_VAL_RULE_ID, AD_PROCESS_ID, ISALWAYSUPDATEABLE,
|
CALLOUT, AD_REFERENCE_ID, AD_VAL_RULE_ID, AD_PROCESS_ID, ISALWAYSUPDATEABLE,
|
||||||
READONLYLOGIC, MANDATORYLOGIC, ISUPDATEABLE, ISENCRYPTEDCOLUMN, ISSELECTIONCOLUMN, TABLENAME,
|
READONLYLOGIC, MANDATORYLOGIC, ISUPDATEABLE, ISENCRYPTEDCOLUMN, ISSELECTIONCOLUMN,
|
||||||
VALUEMIN, VALUEMAX, FIELDGROUP, VALIDATIONCODE, INCLUDED_TAB_ID)
|
TABLENAME, VALUEMIN, VALUEMAX, FIELDGROUP, VALIDATIONCODE,
|
||||||
|
INCLUDED_TAB_ID, FIELDGROUPTYPE)
|
||||||
AS
|
AS
|
||||||
SELECT t.AD_Window_ID, f.AD_Tab_ID, f.AD_Field_ID, tbl.AD_Table_ID, f.AD_Column_ID,
|
SELECT t.AD_Window_ID, f.AD_Tab_ID, f.AD_Field_ID, tbl.AD_Table_ID, f.AD_Column_ID,
|
||||||
f.Name, f.Description, f.Help, f.IsDisplayed, f.DisplayLogic, f.DisplayLength,
|
f.NAME, f.Description, f.Help, f.IsDisplayed, f.DisplayLogic, f.DisplayLength,
|
||||||
f.SeqNo, f.SortNo, f.IsSameLine, f.IsHeading, f.IsFieldOnly, f.IsReadOnly,
|
f.SeqNo, f.SortNo, f.IsSameLine, f.IsHeading, f.IsFieldOnly, f.IsReadOnly,
|
||||||
f.IsEncrypted AS IsEncryptedField, f.ObscureType,
|
f.IsEncrypted AS IsEncryptedField, f.ObscureType,
|
||||||
c.ColumnName, c.ColumnSQL, c.FieldLength, c.VFormat,
|
c.ColumnName, c.ColumnSQL, c.FieldLength, c.VFormat,
|
||||||
COALESCE(f.DefaultValue, c.DefaultValue) as DefaultValue,
|
COALESCE(f.DefaultValue, c.DefaultValue) AS DefaultValue,
|
||||||
c.IsKey, c.IsParent,
|
c.IsKey, c.IsParent,
|
||||||
COALESCE(f.IsMandatory, c.IsMandatory) AS IsMandatory,
|
COALESCE(f.IsMandatory, c.IsMandatory) AS IsMandatory,
|
||||||
c.IsIdentifier, c.IsTranslated, c.AD_Reference_Value_ID,
|
c.IsIdentifier, c.IsTranslated, c.AD_Reference_Value_ID,
|
||||||
|
@ -23,17 +24,14 @@ SELECT t.AD_Window_ID, f.AD_Tab_ID, f.AD_Field_ID, tbl.AD_Table_ID, f.AD_Column_
|
||||||
c.ReadOnlyLogic, c.MandatoryLogic, c.IsUpdateable, c.IsEncrypted AS IsEncryptedColumn,
|
c.ReadOnlyLogic, c.MandatoryLogic, c.IsUpdateable, c.IsEncrypted AS IsEncryptedColumn,
|
||||||
c.IsSelectionColumn,
|
c.IsSelectionColumn,
|
||||||
tbl.TableName, c.ValueMin, c.ValueMax,
|
tbl.TableName, c.ValueMin, c.ValueMax,
|
||||||
fg.Name AS FieldGroup, vr.Code AS ValidationCode,
|
fg.NAME AS FieldGroup, vr.Code AS ValidationCode,
|
||||||
f.Included_Tab_ID
|
f.Included_Tab_ID, fg.FieldGroupType
|
||||||
FROM AD_Field f
|
FROM AD_FIELD f
|
||||||
INNER JOIN AD_Tab t ON (f.AD_Tab_ID = t.AD_Tab_ID)
|
INNER JOIN AD_TAB t ON (f.AD_Tab_ID = t.AD_Tab_ID)
|
||||||
LEFT OUTER JOIN AD_FieldGroup fg ON (f.AD_FieldGroup_ID = fg.AD_FieldGroup_ID)
|
LEFT OUTER JOIN AD_FIELDGROUP fg ON (f.AD_FieldGroup_ID = fg.AD_FieldGroup_ID)
|
||||||
LEFT OUTER JOIN AD_Column c ON (f.AD_Column_ID = c.AD_Column_ID)
|
LEFT OUTER JOIN AD_COLUMN c ON (f.AD_Column_ID = c.AD_Column_ID)
|
||||||
INNER JOIN AD_Table tbl ON (c.AD_Table_ID = tbl.AD_Table_ID)
|
INNER JOIN AD_TABLE tbl ON (c.AD_Table_ID = tbl.AD_Table_ID)
|
||||||
INNER JOIN AD_Reference r ON (c.AD_Reference_ID = r.AD_Reference_ID)
|
INNER JOIN AD_REFERENCE r ON (c.AD_Reference_ID = r.AD_Reference_ID)
|
||||||
LEFT OUTER JOIN AD_Val_Rule vr ON (c.AD_Val_Rule_ID=vr.AD_Val_Rule_ID)
|
LEFT OUTER JOIN AD_VAL_RULE vr ON (c.AD_Val_Rule_ID=vr.AD_Val_Rule_ID)
|
||||||
WHERE f.IsActive = 'Y'
|
WHERE f.IsActive = 'Y'
|
||||||
AND c.IsActive = 'Y';
|
AND c.IsActive = 'Y'
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -6,15 +6,16 @@ CREATE OR REPLACE VIEW AD_FIELD_VT
|
||||||
COLUMNNAME, COLUMNSQL, FIELDLENGTH, VFORMAT, DEFAULTVALUE,
|
COLUMNNAME, COLUMNSQL, FIELDLENGTH, VFORMAT, DEFAULTVALUE,
|
||||||
ISKEY, ISPARENT, ISMANDATORY, ISIDENTIFIER, ISTRANSLATED,
|
ISKEY, ISPARENT, ISMANDATORY, ISIDENTIFIER, ISTRANSLATED,
|
||||||
AD_REFERENCE_VALUE_ID, CALLOUT, AD_REFERENCE_ID, AD_VAL_RULE_ID, AD_PROCESS_ID,
|
AD_REFERENCE_VALUE_ID, CALLOUT, AD_REFERENCE_ID, AD_VAL_RULE_ID, AD_PROCESS_ID,
|
||||||
ISALWAYSUPDATEABLE, READONLYLOGIC, MANDATORYLOGIC, ISUPDATEABLE, ISENCRYPTEDCOLUMN, ISSELECTIONCOLUMN,
|
ISALWAYSUPDATEABLE, READONLYLOGIC, MANDATORYLOGIC, ISUPDATEABLE, ISENCRYPTEDCOLUMN,
|
||||||
TABLENAME, VALUEMIN, VALUEMAX, FIELDGROUP, VALIDATIONCODE, INCLUDED_TAB_ID)
|
ISSELECTIONCOLUMN, TABLENAME, VALUEMIN, VALUEMAX, FIELDGROUP,
|
||||||
|
VALIDATIONCODE, INCLUDED_TAB_ID, FIELDGROUPTYPE)
|
||||||
AS
|
AS
|
||||||
SELECT trl.AD_Language, t.AD_Window_ID, f.AD_Tab_ID, f.AD_Field_ID, tbl.AD_Table_ID, f.AD_Column_ID,
|
SELECT trl.AD_LANGUAGE, t.AD_Window_ID, f.AD_Tab_ID, f.AD_Field_ID, tbl.AD_Table_ID, f.AD_Column_ID,
|
||||||
trl.Name, trl.Description, trl.Help, f.IsDisplayed, f.DisplayLogic, f.DisplayLength,
|
trl.NAME, trl.Description, trl.Help, f.IsDisplayed, f.DisplayLogic, f.DisplayLength,
|
||||||
f.SeqNo, f.SortNo, f.IsSameLine, f.IsHeading, f.IsFieldOnly, f.IsReadOnly,
|
f.SeqNo, f.SortNo, f.IsSameLine, f.IsHeading, f.IsFieldOnly, f.IsReadOnly,
|
||||||
f.IsEncrypted AS IsEncryptedField, f.ObscureType,
|
f.IsEncrypted AS IsEncryptedField, f.ObscureType,
|
||||||
c.ColumnName, c.ColumnSQL, c.FieldLength, c.VFormat,
|
c.ColumnName, c.ColumnSQL, c.FieldLength, c.VFormat,
|
||||||
COALESCE(f.DefaultValue, c.DefaultValue) as DefaultValue,
|
COALESCE(f.DefaultValue, c.DefaultValue) AS DefaultValue,
|
||||||
c.IsKey, c.IsParent,
|
c.IsKey, c.IsParent,
|
||||||
COALESCE(f.IsMandatory, c.IsMandatory) AS IsMandatory,
|
COALESCE(f.IsMandatory, c.IsMandatory) AS IsMandatory,
|
||||||
c.IsIdentifier, c.IsTranslated, c.AD_Reference_Value_ID,
|
c.IsIdentifier, c.IsTranslated, c.AD_Reference_Value_ID,
|
||||||
|
@ -22,19 +23,17 @@ SELECT trl.AD_Language, t.AD_Window_ID, f.AD_Tab_ID, f.AD_Field_ID, tbl.AD_Table
|
||||||
c.AD_Val_Rule_ID, c.AD_Process_ID, c.IsAlwaysUpdateable,
|
c.AD_Val_Rule_ID, c.AD_Process_ID, c.IsAlwaysUpdateable,
|
||||||
c.ReadOnlyLogic, c.MandatoryLogic, c.IsUpdateable, c.IsEncrypted AS IsEncryptedColumn, c.IsSelectionColumn,
|
c.ReadOnlyLogic, c.MandatoryLogic, c.IsUpdateable, c.IsEncrypted AS IsEncryptedColumn, c.IsSelectionColumn,
|
||||||
tbl.TableName, c.ValueMin, c.ValueMax,
|
tbl.TableName, c.ValueMin, c.ValueMax,
|
||||||
fgt.Name AS FieldGroup, vr.Code AS ValidationCode,
|
fgt.NAME AS FieldGroup, vr.Code AS ValidationCode,
|
||||||
f.Included_Tab_ID
|
f.Included_Tab_ID, fg.FieldGroupType
|
||||||
FROM AD_Field f
|
FROM AD_FIELD f
|
||||||
INNER JOIN AD_Field_Trl trl ON (f.AD_Field_ID = trl.AD_Field_ID)
|
INNER JOIN AD_FIELD_TRL trl ON (f.AD_Field_ID = trl.AD_Field_ID)
|
||||||
INNER JOIN AD_Tab t ON (f.AD_Tab_ID = t.AD_Tab_ID)
|
INNER JOIN AD_TAB t ON (f.AD_Tab_ID = t.AD_Tab_ID)
|
||||||
LEFT OUTER JOIN AD_FieldGroup_Trl fgt ON
|
LEFT OUTER JOIN AD_FIELDGROUP fg ON (f.AD_FieldGroup_ID = fg.AD_FieldGroup_ID)
|
||||||
(f.AD_FieldGroup_ID = fgt.AD_FieldGroup_ID AND trl.AD_Language=fgt.AD_Language)
|
LEFT OUTER JOIN AD_FIELDGROUP_TRL fgt ON
|
||||||
LEFT OUTER JOIN AD_Column c ON (f.AD_Column_ID = c.AD_Column_ID)
|
(f.AD_FieldGroup_ID = fgt.AD_FieldGroup_ID AND trl.AD_LANGUAGE=fgt.AD_LANGUAGE)
|
||||||
INNER JOIN AD_Table tbl ON (c.AD_Table_ID = tbl.AD_Table_ID)
|
LEFT OUTER JOIN AD_COLUMN c ON (f.AD_Column_ID = c.AD_Column_ID)
|
||||||
INNER JOIN AD_Reference r ON (c.AD_Reference_ID = r.AD_Reference_ID)
|
INNER JOIN AD_TABLE tbl ON (c.AD_Table_ID = tbl.AD_Table_ID)
|
||||||
LEFT OUTER JOIN AD_Val_Rule vr ON (c.AD_Val_Rule_ID=vr.AD_Val_Rule_ID)
|
INNER JOIN AD_REFERENCE r ON (c.AD_Reference_ID = r.AD_Reference_ID)
|
||||||
|
LEFT OUTER JOIN AD_VAL_RULE vr ON (c.AD_Val_Rule_ID=vr.AD_Val_Rule_ID)
|
||||||
WHERE f.IsActive = 'Y'
|
WHERE f.IsActive = 'Y'
|
||||||
AND c.IsActive = 'Y';
|
AND c.IsActive = 'Y'
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,39 +1,63 @@
|
||||||
CREATE OR REPLACE VIEW AD_FIELD_V
|
CREATE OR
|
||||||
(AD_WINDOW_ID, AD_TAB_ID, AD_FIELD_ID, AD_TABLE_ID, AD_COLUMN_ID,
|
REPLACE VIEW ad_field_v AS
|
||||||
NAME, DESCRIPTION, HELP, ISDISPLAYED, DISPLAYLOGIC,
|
SELECT t.ad_window_id,
|
||||||
DISPLAYLENGTH, SEQNO, SORTNO, ISSAMELINE, ISHEADING,
|
f.ad_tab_id,
|
||||||
ISFIELDONLY, ISREADONLY, ISENCRYPTEDFIELD, OBSCURETYPE, COLUMNNAME,
|
f.ad_field_id,
|
||||||
COLUMNSQL, FIELDLENGTH, VFORMAT, DEFAULTVALUE, ISKEY,
|
tbl.ad_table_id,
|
||||||
ISPARENT, ISMANDATORY, ISIDENTIFIER, ISTRANSLATED, AD_REFERENCE_VALUE_ID,
|
f.ad_column_id,
|
||||||
CALLOUT, AD_REFERENCE_ID, AD_VAL_RULE_ID, AD_PROCESS_ID, ISALWAYSUPDATEABLE,
|
f.NAME,
|
||||||
READONLYLOGIC, MANDATORYLOGIC, ISUPDATEABLE, ISENCRYPTEDCOLUMN, ISSELECTIONCOLUMN, TABLENAME,
|
f.description,
|
||||||
VALUEMIN, VALUEMAX, FIELDGROUP, VALIDATIONCODE, INCLUDED_TAB_ID)
|
f.help,
|
||||||
AS
|
f.isdisplayed,
|
||||||
SELECT t.AD_Window_ID, f.AD_Tab_ID, f.AD_Field_ID, tbl.AD_Table_ID, f.AD_Column_ID,
|
f.displaylogic,
|
||||||
f.Name, f.Description, f.Help, f.IsDisplayed, f.DisplayLogic, f.DisplayLength,
|
f.displaylength,
|
||||||
f.SeqNo, f.SortNo, f.IsSameLine, f.IsHeading, f.IsFieldOnly, f.IsReadOnly,
|
f.seqno,
|
||||||
f.IsEncrypted AS IsEncryptedField, f.ObscureType,
|
f.sortno,
|
||||||
c.ColumnName, c.ColumnSQL, c.FieldLength, c.VFormat,
|
f.issameline,
|
||||||
COALESCE(f.DefaultValue, c.DefaultValue) as DefaultValue,
|
f.isheading,
|
||||||
c.IsKey, c.IsParent,
|
f.isfieldonly,
|
||||||
COALESCE(f.IsMandatory, c.IsMandatory) AS IsMandatory,
|
f.isreadonly,
|
||||||
c.IsIdentifier, c.IsTranslated, c.AD_Reference_Value_ID,
|
f.isencrypted AS isencryptedfield,
|
||||||
c.Callout, COALESCE(f.AD_Reference_ID, c.AD_Reference_ID) AS AD_Reference_ID,
|
f.obscuretype,
|
||||||
c.AD_Val_Rule_ID, c.AD_Process_ID, c.IsAlwaysUpdateable,
|
C.columnname,
|
||||||
c.ReadOnlyLogic, c.MandatoryLogic, c.IsUpdateable, c.IsEncrypted AS IsEncryptedColumn,
|
C.columnsql,
|
||||||
c.IsSelectionColumn,
|
C.fieldlength,
|
||||||
tbl.TableName, c.ValueMin, c.ValueMax,
|
C.vformat,
|
||||||
fg.Name AS FieldGroup, vr.Code AS ValidationCode,
|
C.defaultvalue,
|
||||||
f.Included_Tab_ID
|
C.iskey,
|
||||||
FROM AD_Field f
|
C.isparent,
|
||||||
INNER JOIN AD_Tab t ON (f.AD_Tab_ID = t.AD_Tab_ID)
|
COALESCE(f.ismandatory, C.ismandatory) AS ismandatory,
|
||||||
LEFT OUTER JOIN AD_FieldGroup fg ON (f.AD_FieldGroup_ID = fg.AD_FieldGroup_ID)
|
C.isidentifier,
|
||||||
LEFT OUTER JOIN AD_Column c ON (f.AD_Column_ID = c.AD_Column_ID)
|
C.istranslated,
|
||||||
INNER JOIN AD_Table tbl ON (c.AD_Table_ID = tbl.AD_Table_ID)
|
C.ad_reference_value_id,
|
||||||
INNER JOIN AD_Reference r ON (c.AD_Reference_ID = r.AD_Reference_ID)
|
C.callout,
|
||||||
LEFT OUTER JOIN AD_Val_Rule vr ON (c.AD_Val_Rule_ID=vr.AD_Val_Rule_ID)
|
COALESCE(f.ad_reference_id, C.ad_reference_id) AS ad_reference_id,
|
||||||
WHERE f.IsActive = 'Y'
|
C.ad_val_rule_id,
|
||||||
AND c.IsActive = 'Y';
|
C.ad_process_id,
|
||||||
|
C.isalwaysupdateable,
|
||||||
|
C.readonlylogic,
|
||||||
|
C.isupdateable,
|
||||||
|
C.isencrypted AS isencryptedcolumn,
|
||||||
|
C.isselectioncolumn,
|
||||||
|
tbl.tablename,
|
||||||
|
C.valuemin,
|
||||||
|
C.valuemax,
|
||||||
|
fg.NAME AS fieldgroup,
|
||||||
|
vr.code AS validationcode,
|
||||||
|
f.Included_Tab_ID,
|
||||||
|
fg.FieldGroupType
|
||||||
|
FROM ((((((AD_FIELD f
|
||||||
|
JOIN AD_TAB t
|
||||||
|
ON ((f.ad_tab_id = t.ad_tab_id)))
|
||||||
|
LEFT JOIN AD_FIELDGROUP fg
|
||||||
|
ON ((f.ad_fieldgroup_id = fg.ad_fieldgroup_id)))
|
||||||
|
LEFT JOIN AD_COLUMN C
|
||||||
|
ON ((f.ad_column_id = C.ad_column_id)))
|
||||||
|
JOIN AD_TABLE tbl
|
||||||
|
ON ((C.ad_table_id = tbl.ad_table_id)))
|
||||||
|
JOIN AD_REFERENCE r
|
||||||
|
ON ((C.ad_reference_id = r.ad_reference_id)))
|
||||||
|
LEFT JOIN AD_VAL_RULE vr
|
||||||
|
ON ((C.ad_val_rule_id = vr.ad_val_rule_id)))
|
||||||
|
WHERE ((f.isactive = 'Y'::bpchar) AND
|
||||||
|
(C.isactive = 'Y'::bpchar))
|
|
@ -1,40 +1,69 @@
|
||||||
CREATE OR REPLACE VIEW AD_FIELD_VT
|
CREATE OR
|
||||||
(AD_LANGUAGE, AD_WINDOW_ID, AD_TAB_ID, AD_FIELD_ID, AD_TABLE_ID,
|
REPLACE VIEW ad_field_vt AS
|
||||||
AD_COLUMN_ID, NAME, DESCRIPTION, HELP, ISDISPLAYED,
|
SELECT trl.AD_LANGUAGE,
|
||||||
DISPLAYLOGIC, DISPLAYLENGTH, SEQNO, SORTNO, ISSAMELINE,
|
t.ad_window_id,
|
||||||
ISHEADING, ISFIELDONLY, ISREADONLY, ISENCRYPTEDFIELD, OBSCURETYPE,
|
f.ad_tab_id,
|
||||||
COLUMNNAME, COLUMNSQL, FIELDLENGTH, VFORMAT, DEFAULTVALUE,
|
f.ad_field_id,
|
||||||
ISKEY, ISPARENT, ISMANDATORY, ISIDENTIFIER, ISTRANSLATED,
|
tbl.ad_table_id,
|
||||||
AD_REFERENCE_VALUE_ID, CALLOUT, AD_REFERENCE_ID, AD_VAL_RULE_ID, AD_PROCESS_ID,
|
f.ad_column_id,
|
||||||
ISALWAYSUPDATEABLE, READONLYLOGIC, MANDATORYLOGIC, ISUPDATEABLE, ISENCRYPTEDCOLUMN, ISSELECTIONCOLUMN,
|
trl.NAME,
|
||||||
TABLENAME, VALUEMIN, VALUEMAX, FIELDGROUP, VALIDATIONCODE, INCLUDED_TAB_ID)
|
trl.description,
|
||||||
AS
|
trl.help,
|
||||||
SELECT trl.AD_Language, t.AD_Window_ID, f.AD_Tab_ID, f.AD_Field_ID, tbl.AD_Table_ID, f.AD_Column_ID,
|
f.isdisplayed,
|
||||||
trl.Name, trl.Description, trl.Help, f.IsDisplayed, f.DisplayLogic, f.DisplayLength,
|
f.displaylogic,
|
||||||
f.SeqNo, f.SortNo, f.IsSameLine, f.IsHeading, f.IsFieldOnly, f.IsReadOnly,
|
f.displaylength,
|
||||||
f.IsEncrypted AS IsEncryptedField, f.ObscureType,
|
f.seqno,
|
||||||
c.ColumnName, c.ColumnSQL, c.FieldLength, c.VFormat,
|
f.sortno,
|
||||||
COALESCE(f.DefaultValue, c.DefaultValue) as DefaultValue,
|
f.issameline,
|
||||||
c.IsKey, c.IsParent,
|
f.isheading,
|
||||||
COALESCE(f.IsMandatory, c.IsMandatory) AS IsMandatory,
|
f.isfieldonly,
|
||||||
c.IsIdentifier, c.IsTranslated, c.AD_Reference_Value_ID,
|
f.isreadonly,
|
||||||
c.Callout, COALESCE(f.AD_Reference_ID, c.AD_Reference_ID) AS AD_Reference_ID,
|
f.isencrypted AS isencryptedfield,
|
||||||
c.AD_Val_Rule_ID, c.AD_Process_ID, c.IsAlwaysUpdateable,
|
f.obscuretype,
|
||||||
c.ReadOnlyLogic, c.MandatoryLogic, c.IsUpdateable, c.IsEncrypted AS IsEncryptedColumn, c.IsSelectionColumn,
|
C.columnname,
|
||||||
tbl.TableName, c.ValueMin, c.ValueMax,
|
C.columnsql,
|
||||||
fgt.Name AS FieldGroup, vr.Code AS ValidationCode,
|
C.fieldlength,
|
||||||
f.Included_Tab_ID
|
C.vformat,
|
||||||
FROM AD_Field f
|
C.defaultvalue,
|
||||||
INNER JOIN AD_Field_Trl trl ON (f.AD_Field_ID = trl.AD_Field_ID)
|
C.iskey,
|
||||||
INNER JOIN AD_Tab t ON (f.AD_Tab_ID = t.AD_Tab_ID)
|
C.isparent,
|
||||||
LEFT OUTER JOIN AD_FieldGroup_Trl fgt ON
|
COALESCE(f.ismandatory, C.ismandatory) AS ismandatory,
|
||||||
(f.AD_FieldGroup_ID = fgt.AD_FieldGroup_ID AND trl.AD_Language=fgt.AD_Language)
|
C.isidentifier,
|
||||||
LEFT OUTER JOIN AD_Column c ON (f.AD_Column_ID = c.AD_Column_ID)
|
C.istranslated,
|
||||||
INNER JOIN AD_Table tbl ON (c.AD_Table_ID = tbl.AD_Table_ID)
|
C.ad_reference_value_id,
|
||||||
INNER JOIN AD_Reference r ON (c.AD_Reference_ID = r.AD_Reference_ID)
|
C.callout,
|
||||||
LEFT OUTER JOIN AD_Val_Rule vr ON (c.AD_Val_Rule_ID=vr.AD_Val_Rule_ID)
|
COALESCE(f.ad_reference_id, C.ad_reference_id) AS ad_reference_id,
|
||||||
WHERE f.IsActive = 'Y'
|
C.ad_val_rule_id,
|
||||||
AND c.IsActive = 'Y';
|
C.ad_process_id,
|
||||||
|
C.isalwaysupdateable,
|
||||||
|
C.readonlylogic,
|
||||||
|
C.isupdateable,
|
||||||
|
C.isencrypted AS isencryptedcolumn,
|
||||||
|
C.isselectioncolumn,
|
||||||
|
tbl.tablename,
|
||||||
|
C.valuemin,
|
||||||
|
C.valuemax,
|
||||||
|
fgt.NAME AS fieldgroup,
|
||||||
|
vr.code AS validationcode,
|
||||||
|
f.Included_Tab_ID,
|
||||||
|
fg.FieldGroupType
|
||||||
|
FROM (((((((AD_FIELD f
|
||||||
|
JOIN AD_FIELD_TRL trl
|
||||||
|
ON ((f.ad_field_id = trl.ad_field_id)))
|
||||||
|
JOIN AD_TAB t
|
||||||
|
ON ((f.ad_tab_id = t.ad_tab_id)))
|
||||||
|
LEFT JOIN AD_FIELDGROUP fg
|
||||||
|
ON (f.AD_FieldGroup_ID = fg.AD_FieldGroup_ID)
|
||||||
|
LEFT JOIN AD_FIELDGROUP_TRL fgt
|
||||||
|
ON (((f.ad_fieldgroup_id = fgt.ad_fieldgroup_id) AND
|
||||||
|
((trl.AD_LANGUAGE)::text = (fgt.AD_LANGUAGE)::text))))
|
||||||
|
LEFT JOIN AD_COLUMN C
|
||||||
|
ON ((f.ad_column_id = C.ad_column_id)))
|
||||||
|
JOIN AD_TABLE tbl
|
||||||
|
ON ((C.ad_table_id = tbl.ad_table_id)))
|
||||||
|
JOIN AD_REFERENCE r
|
||||||
|
ON ((C.ad_reference_id = r.ad_reference_id)))
|
||||||
|
LEFT JOIN AD_VAL_RULE vr
|
||||||
|
ON ((C.ad_val_rule_id = vr.ad_val_rule_id)))
|
||||||
|
WHERE ((f.isactive = 'Y'::bpchar) AND
|
||||||
|
(C.isactive = 'Y'::bpchar))
|
|
@ -0,0 +1,59 @@
|
||||||
|
CREATE OR REPLACE VIEW AD_FIELD_V
|
||||||
|
AS
|
||||||
|
SELECT t.AD_Window_ID, f.AD_Tab_ID, f.AD_Field_ID, tbl.AD_Table_ID, f.AD_Column_ID,
|
||||||
|
f.NAME, f.Description, f.Help, f.IsDisplayed, f.DisplayLogic, f.DisplayLength,
|
||||||
|
f.SeqNo, f.SortNo, f.IsSameLine, f.IsHeading, f.IsFieldOnly, f.IsReadOnly,
|
||||||
|
f.IsEncrypted AS IsEncryptedField, f.ObscureType,
|
||||||
|
c.ColumnName, c.ColumnSQL, c.FieldLength, c.VFormat,
|
||||||
|
COALESCE(f.DefaultValue, c.DefaultValue) AS DefaultValue,
|
||||||
|
c.IsKey, c.IsParent,
|
||||||
|
COALESCE(f.IsMandatory, c.IsMandatory) AS IsMandatory,
|
||||||
|
c.IsIdentifier, c.IsTranslated, c.AD_Reference_Value_ID,
|
||||||
|
c.Callout, COALESCE(f.AD_Reference_ID, c.AD_Reference_ID) AS AD_Reference_ID,
|
||||||
|
c.AD_Val_Rule_ID, c.AD_Process_ID, c.IsAlwaysUpdateable,
|
||||||
|
c.ReadOnlyLogic, c.MandatoryLogic, c.IsUpdateable, c.IsEncrypted AS IsEncryptedColumn,
|
||||||
|
c.IsSelectionColumn,
|
||||||
|
tbl.TableName, c.ValueMin, c.ValueMax,
|
||||||
|
fg.NAME AS FieldGroup, vr.Code AS ValidationCode,
|
||||||
|
f.Included_Tab_ID, fg.FieldGroupType
|
||||||
|
FROM AD_FIELD f
|
||||||
|
INNER JOIN AD_TAB t ON (f.AD_Tab_ID = t.AD_Tab_ID)
|
||||||
|
LEFT OUTER JOIN AD_FIELDGROUP fg ON (f.AD_FieldGroup_ID = fg.AD_FieldGroup_ID)
|
||||||
|
LEFT OUTER JOIN AD_COLUMN c ON (f.AD_Column_ID = c.AD_Column_ID)
|
||||||
|
INNER JOIN AD_TABLE tbl ON (c.AD_Table_ID = tbl.AD_Table_ID)
|
||||||
|
INNER JOIN AD_REFERENCE r ON (c.AD_Reference_ID = r.AD_Reference_ID)
|
||||||
|
LEFT OUTER JOIN AD_VAL_RULE vr ON (c.AD_Val_Rule_ID=vr.AD_Val_Rule_ID)
|
||||||
|
WHERE f.IsActive = 'Y'
|
||||||
|
AND c.IsActive = 'Y'
|
||||||
|
;
|
||||||
|
|
||||||
|
CREATE OR REPLACE VIEW AD_FIELD_VT
|
||||||
|
AS
|
||||||
|
SELECT trl.AD_LANGUAGE, t.AD_Window_ID, f.AD_Tab_ID, f.AD_Field_ID, tbl.AD_Table_ID, f.AD_Column_ID,
|
||||||
|
trl.NAME, trl.Description, trl.Help, f.IsDisplayed, f.DisplayLogic, f.DisplayLength,
|
||||||
|
f.SeqNo, f.SortNo, f.IsSameLine, f.IsHeading, f.IsFieldOnly, f.IsReadOnly,
|
||||||
|
f.IsEncrypted AS IsEncryptedField, f.ObscureType,
|
||||||
|
c.ColumnName, c.ColumnSQL, c.FieldLength, c.VFormat,
|
||||||
|
COALESCE(f.DefaultValue, c.DefaultValue) AS DefaultValue,
|
||||||
|
c.IsKey, c.IsParent,
|
||||||
|
COALESCE(f.IsMandatory, c.IsMandatory) AS IsMandatory,
|
||||||
|
c.IsIdentifier, c.IsTranslated, c.AD_Reference_Value_ID,
|
||||||
|
c.Callout, COALESCE(f.AD_Reference_ID, c.AD_Reference_ID) AS AD_Reference_ID,
|
||||||
|
c.AD_Val_Rule_ID, c.AD_Process_ID, c.IsAlwaysUpdateable,
|
||||||
|
c.ReadOnlyLogic, c.MandatoryLogic, c.IsUpdateable, c.IsEncrypted AS IsEncryptedColumn, c.IsSelectionColumn,
|
||||||
|
tbl.TableName, c.ValueMin, c.ValueMax,
|
||||||
|
fgt.NAME AS FieldGroup, vr.Code AS ValidationCode,
|
||||||
|
f.Included_Tab_ID, fg.FieldGroupType
|
||||||
|
FROM AD_FIELD f
|
||||||
|
INNER JOIN AD_FIELD_TRL trl ON (f.AD_Field_ID = trl.AD_Field_ID)
|
||||||
|
INNER JOIN AD_TAB t ON (f.AD_Tab_ID = t.AD_Tab_ID)
|
||||||
|
LEFT OUTER JOIN AD_FIELDGROUP fg ON (f.AD_FieldGroup_ID = fg.AD_FieldGroup_ID)
|
||||||
|
LEFT OUTER JOIN AD_FIELDGROUP_TRL fgt ON
|
||||||
|
(f.AD_FieldGroup_ID = fgt.AD_FieldGroup_ID AND trl.AD_LANGUAGE=fgt.AD_LANGUAGE)
|
||||||
|
LEFT OUTER JOIN AD_COLUMN c ON (f.AD_Column_ID = c.AD_Column_ID)
|
||||||
|
INNER JOIN AD_TABLE tbl ON (c.AD_Table_ID = tbl.AD_Table_ID)
|
||||||
|
INNER JOIN AD_REFERENCE r ON (c.AD_Reference_ID = r.AD_Reference_ID)
|
||||||
|
LEFT OUTER JOIN AD_VAL_RULE vr ON (c.AD_Val_Rule_ID=vr.AD_Val_Rule_ID)
|
||||||
|
WHERE f.IsActive = 'Y'
|
||||||
|
AND c.IsActive = 'Y'
|
||||||
|
;
|
|
@ -0,0 +1,135 @@
|
||||||
|
CREATE OR
|
||||||
|
REPLACE VIEW ad_field_v AS
|
||||||
|
SELECT t.ad_window_id,
|
||||||
|
f.ad_tab_id,
|
||||||
|
f.ad_field_id,
|
||||||
|
tbl.ad_table_id,
|
||||||
|
f.ad_column_id,
|
||||||
|
f.NAME,
|
||||||
|
f.description,
|
||||||
|
f.help,
|
||||||
|
f.isdisplayed,
|
||||||
|
f.displaylogic,
|
||||||
|
f.displaylength,
|
||||||
|
f.seqno,
|
||||||
|
f.sortno,
|
||||||
|
f.issameline,
|
||||||
|
f.isheading,
|
||||||
|
f.isfieldonly,
|
||||||
|
f.isreadonly,
|
||||||
|
f.isencrypted AS isencryptedfield,
|
||||||
|
f.obscuretype,
|
||||||
|
C.columnname,
|
||||||
|
C.columnsql,
|
||||||
|
C.fieldlength,
|
||||||
|
C.vformat,
|
||||||
|
C.defaultvalue,
|
||||||
|
C.iskey,
|
||||||
|
C.isparent,
|
||||||
|
COALESCE(f.ismandatory, C.ismandatory) AS ismandatory,
|
||||||
|
C.isidentifier,
|
||||||
|
C.istranslated,
|
||||||
|
C.ad_reference_value_id,
|
||||||
|
C.callout,
|
||||||
|
COALESCE(f.ad_reference_id, C.ad_reference_id) AS ad_reference_id,
|
||||||
|
C.ad_val_rule_id,
|
||||||
|
C.ad_process_id,
|
||||||
|
C.isalwaysupdateable,
|
||||||
|
C.readonlylogic,
|
||||||
|
C.isupdateable,
|
||||||
|
C.isencrypted AS isencryptedcolumn,
|
||||||
|
C.isselectioncolumn,
|
||||||
|
tbl.tablename,
|
||||||
|
C.valuemin,
|
||||||
|
C.valuemax,
|
||||||
|
fg.NAME AS fieldgroup,
|
||||||
|
vr.code AS validationcode,
|
||||||
|
f.Included_Tab_ID,
|
||||||
|
fg.FieldGroupType
|
||||||
|
FROM ((((((ad_field f
|
||||||
|
JOIN ad_tab t
|
||||||
|
ON ((f.ad_tab_id = t.ad_tab_id)))
|
||||||
|
LEFT JOIN ad_fieldgroup fg
|
||||||
|
ON ((f.ad_fieldgroup_id = fg.ad_fieldgroup_id)))
|
||||||
|
LEFT JOIN ad_column C
|
||||||
|
ON ((f.ad_column_id = C.ad_column_id)))
|
||||||
|
JOIN ad_table tbl
|
||||||
|
ON ((C.ad_table_id = tbl.ad_table_id)))
|
||||||
|
JOIN ad_reference r
|
||||||
|
ON ((C.ad_reference_id = r.ad_reference_id)))
|
||||||
|
LEFT JOIN ad_val_rule vr
|
||||||
|
ON ((C.ad_val_rule_id = vr.ad_val_rule_id)))
|
||||||
|
WHERE ((f.isactive = 'Y'::bpchar) AND
|
||||||
|
(C.isactive = 'Y'::bpchar))
|
||||||
|
;
|
||||||
|
|
||||||
|
CREATE OR
|
||||||
|
REPLACE VIEW ad_field_vt AS
|
||||||
|
SELECT trl.ad_language,
|
||||||
|
t.ad_window_id,
|
||||||
|
f.ad_tab_id,
|
||||||
|
f.ad_field_id,
|
||||||
|
tbl.ad_table_id,
|
||||||
|
f.ad_column_id,
|
||||||
|
trl.NAME,
|
||||||
|
trl.description,
|
||||||
|
trl.help,
|
||||||
|
f.isdisplayed,
|
||||||
|
f.displaylogic,
|
||||||
|
f.displaylength,
|
||||||
|
f.seqno,
|
||||||
|
f.sortno,
|
||||||
|
f.issameline,
|
||||||
|
f.isheading,
|
||||||
|
f.isfieldonly,
|
||||||
|
f.isreadonly,
|
||||||
|
f.isencrypted AS isencryptedfield,
|
||||||
|
f.obscuretype,
|
||||||
|
C.columnname,
|
||||||
|
C.columnsql,
|
||||||
|
C.fieldlength,
|
||||||
|
C.vformat,
|
||||||
|
C.defaultvalue,
|
||||||
|
C.iskey,
|
||||||
|
C.isparent,
|
||||||
|
COALESCE(f.ismandatory, C.ismandatory) AS ismandatory,
|
||||||
|
C.isidentifier,
|
||||||
|
C.istranslated,
|
||||||
|
C.ad_reference_value_id,
|
||||||
|
C.callout,
|
||||||
|
COALESCE(f.ad_reference_id, C.ad_reference_id) AS ad_reference_id,
|
||||||
|
C.ad_val_rule_id,
|
||||||
|
C.ad_process_id,
|
||||||
|
C.isalwaysupdateable,
|
||||||
|
C.readonlylogic,
|
||||||
|
C.isupdateable,
|
||||||
|
C.isencrypted AS isencryptedcolumn,
|
||||||
|
C.isselectioncolumn,
|
||||||
|
tbl.tablename,
|
||||||
|
C.valuemin,
|
||||||
|
C.valuemax,
|
||||||
|
fgt.NAME AS fieldgroup,
|
||||||
|
vr.code AS validationcode,
|
||||||
|
f.Included_Tab_ID,
|
||||||
|
fg.FieldGroupType
|
||||||
|
FROM (((((((ad_field f
|
||||||
|
JOIN ad_field_trl trl
|
||||||
|
ON ((f.ad_field_id = trl.ad_field_id)))
|
||||||
|
JOIN ad_tab t
|
||||||
|
ON ((f.ad_tab_id = t.ad_tab_id)))
|
||||||
|
LEFT JOIN AD_FIELDGROUP fg
|
||||||
|
ON (f.AD_FieldGroup_ID = fg.AD_FieldGroup_ID)
|
||||||
|
LEFT JOIN ad_fieldgroup_trl fgt
|
||||||
|
ON (((f.ad_fieldgroup_id = fgt.ad_fieldgroup_id) AND
|
||||||
|
((trl.ad_language)::text = (fgt.ad_language)::text))))
|
||||||
|
LEFT JOIN ad_column C
|
||||||
|
ON ((f.ad_column_id = C.ad_column_id)))
|
||||||
|
JOIN ad_table tbl
|
||||||
|
ON ((C.ad_table_id = tbl.ad_table_id)))
|
||||||
|
JOIN ad_reference r
|
||||||
|
ON ((C.ad_reference_id = r.ad_reference_id)))
|
||||||
|
LEFT JOIN ad_val_rule vr
|
||||||
|
ON ((C.ad_val_rule_id = vr.ad_val_rule_id)))
|
||||||
|
WHERE ((f.isactive = 'Y'::bpchar) AND
|
||||||
|
(C.isactive = 'Y'::bpchar))
|
||||||
|
;
|
Loading…
Reference in New Issue