Implement [ 1810133 ] Add logging policy on column level
This commit is contained in:
parent
6aa7c87454
commit
d823361719
|
|
@ -509,4 +509,13 @@ public interface I_AD_Column
|
||||||
* Version of the table definition
|
* Version of the table definition
|
||||||
*/
|
*/
|
||||||
public BigDecimal getVersion();
|
public BigDecimal getVersion();
|
||||||
|
|
||||||
|
/** Column name IsAllowLogging */
|
||||||
|
public static final String COLUMNNAME_isAllowLogging = "IsAllowLogging";
|
||||||
|
|
||||||
|
|
||||||
|
/** Get IsAllowLogging .
|
||||||
|
* Determines, if a column must be recorded into the change log
|
||||||
|
*/
|
||||||
|
public boolean IsAllowLogging() ;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
/******************************************************************************
|
/******************************************************************************
|
||||||
* Product: Adempiere ERP & CRM Smart Business Solution *
|
* Product: Adempiere ERP & CRM Smart Business Solution *
|
||||||
* Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. *
|
* Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. *
|
||||||
* This program is free software; you can redistribute it and/or modify it *
|
* This program is free software; you can redistribute it and/or modify it *
|
||||||
* under the terms version 2 of the GNU General Public License as published *
|
* under the terms version 2 of the GNU General Public License as published *
|
||||||
|
|
@ -16,12 +16,15 @@
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
package org.compiere.model;
|
package org.compiere.model;
|
||||||
|
|
||||||
import java.sql.*;
|
import java.sql.PreparedStatement;
|
||||||
import java.util.*;
|
import java.sql.ResultSet;
|
||||||
import java.util.logging.*;
|
import java.util.ArrayList;
|
||||||
|
import java.util.Arrays;
|
||||||
|
import java.util.Properties;
|
||||||
|
import java.util.logging.Level;
|
||||||
|
|
||||||
import org.compiere.*;
|
import org.compiere.util.CLogger;
|
||||||
import org.compiere.util.*;
|
import org.compiere.util.DB;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Change Log Model
|
* Change Log Model
|
||||||
|
|
@ -31,6 +34,12 @@ import org.compiere.util.*;
|
||||||
*/
|
*/
|
||||||
public class MChangeLog extends X_AD_ChangeLog
|
public class MChangeLog extends X_AD_ChangeLog
|
||||||
{
|
{
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
private static final long serialVersionUID = -7156972859181201446L;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Do we track changes for this table
|
* Do we track changes for this table
|
||||||
* @param AD_Table_ID table
|
* @param AD_Table_ID table
|
||||||
|
|
|
||||||
|
|
@ -491,6 +491,14 @@ public class MColumn extends X_AD_Column
|
||||||
return sb.toString ();
|
return sb.toString ();
|
||||||
} // toString
|
} // toString
|
||||||
|
|
||||||
|
/** Get IsAllowLogging .
|
||||||
|
* Determines, if a column must be recorded into the change log
|
||||||
|
*/
|
||||||
|
public boolean IsAllowLogging() {
|
||||||
|
return super.IsAllowLogging();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
//begin vpj-cd e-evolution
|
//begin vpj-cd e-evolution
|
||||||
/**
|
/**
|
||||||
* get Column ID
|
* get Column ID
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
/******************************************************************************
|
/******************************************************************************
|
||||||
* Product: Adempiere ERP & CRM Smart Business Solution *
|
* Product: Adempiere ERP & CRM Smart Business Solution *
|
||||||
* Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. *
|
* Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. *
|
||||||
* This program is free software; you can redistribute it and/or modify it *
|
* This program is free software; you can redistribute it and/or modify it *
|
||||||
* under the terms version 2 of the GNU General Public License as published *
|
* under the terms version 2 of the GNU General Public License as published *
|
||||||
|
|
@ -16,13 +16,17 @@
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
package org.compiere.model;
|
package org.compiere.model;
|
||||||
|
|
||||||
import java.net.*;
|
import java.net.InetAddress;
|
||||||
import java.sql.*;
|
import java.net.UnknownHostException;
|
||||||
import java.util.*;
|
import java.sql.ResultSet;
|
||||||
import java.util.logging.*;
|
import java.util.Properties;
|
||||||
|
import java.util.logging.Level;
|
||||||
|
|
||||||
import org.compiere.Adempiere;
|
import org.compiere.Adempiere;
|
||||||
import org.compiere.util.*;
|
import org.compiere.util.CCache;
|
||||||
|
import org.compiere.util.Env;
|
||||||
|
import org.compiere.util.Ini;
|
||||||
|
import org.compiere.util.TimeUtil;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Session Model.
|
* Session Model.
|
||||||
|
|
@ -37,6 +41,12 @@ import org.compiere.util.*;
|
||||||
*/
|
*/
|
||||||
public class MSession extends X_AD_Session
|
public class MSession extends X_AD_Session
|
||||||
{
|
{
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
private static final long serialVersionUID = 480745219310430126L;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get existing or create local session
|
* Get existing or create local session
|
||||||
* @param ctx context
|
* @param ctx context
|
||||||
|
|
@ -269,11 +279,6 @@ public class MSession extends X_AD_Session
|
||||||
if (OldValue != null && NewValue != null && OldValue.equals(NewValue))
|
if (OldValue != null && NewValue != null && OldValue.equals(NewValue))
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
// No Log
|
|
||||||
if (AD_Column_ID == 6652
|
|
||||||
|| AD_Column_ID == 6653) // AD_Process.Statistics_
|
|
||||||
return null;
|
|
||||||
|
|
||||||
// Role Logging
|
// Role Logging
|
||||||
MRole role = MRole.getDefault(getCtx(), false);
|
MRole role = MRole.getDefault(getCtx(), false);
|
||||||
// Do we need to log
|
// Do we need to log
|
||||||
|
|
@ -288,8 +293,6 @@ public class MSession extends X_AD_Session
|
||||||
+ ", AD_Session_ID=" + getAD_Session_ID()
|
+ ", AD_Session_ID=" + getAD_Session_ID()
|
||||||
+ ", AD_Table_ID=" + AD_Table_ID + ", AD_Column_ID=" + AD_Column_ID
|
+ ", AD_Table_ID=" + AD_Table_ID + ", AD_Column_ID=" + AD_Column_ID
|
||||||
+ ": " + OldValue + " -> " + NewValue);
|
+ ": " + OldValue + " -> " + NewValue);
|
||||||
boolean success = false;
|
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
MChangeLog cl = new MChangeLog(getCtx(),
|
MChangeLog cl = new MChangeLog(getCtx(),
|
||||||
|
|
|
||||||
|
|
@ -74,6 +74,11 @@ import org.w3c.dom.Element;
|
||||||
public abstract class PO
|
public abstract class PO
|
||||||
implements Serializable, Comparator, Evaluatee
|
implements Serializable, Comparator, Evaluatee
|
||||||
{
|
{
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
private static final long serialVersionUID = -7147383015345754638L;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set Document Value Workflow Manager
|
* Set Document Value Workflow Manager
|
||||||
* @param docWFMgr mgr
|
* @param docWFMgr mgr
|
||||||
|
|
@ -2241,6 +2246,7 @@ public abstract class PO
|
||||||
// Change Log - Only
|
// Change Log - Only
|
||||||
if (session != null
|
if (session != null
|
||||||
&& m_IDs.length == 1
|
&& m_IDs.length == 1
|
||||||
|
&& p_info.isAllowLogging(i) // logging allowed
|
||||||
&& !p_info.isEncrypted(i) // not encrypted
|
&& !p_info.isEncrypted(i) // not encrypted
|
||||||
&& !p_info.isVirtualColumn(i) // no virtual column
|
&& !p_info.isVirtualColumn(i) // no virtual column
|
||||||
&& !"Password".equals(columnName)
|
&& !"Password".equals(columnName)
|
||||||
|
|
@ -2466,6 +2472,7 @@ public abstract class PO
|
||||||
String insertLog = MSysConfig.getValue("SYSTEM_INSERT_CHANGELOG", "Y", getAD_Client_ID());
|
String insertLog = MSysConfig.getValue("SYSTEM_INSERT_CHANGELOG", "Y", getAD_Client_ID());
|
||||||
if ( session != null
|
if ( session != null
|
||||||
&& m_IDs.length == 1
|
&& m_IDs.length == 1
|
||||||
|
&& p_info.isAllowLogging(i) // logging allowed
|
||||||
&& !p_info.isEncrypted(i) // not encrypted
|
&& !p_info.isEncrypted(i) // not encrypted
|
||||||
&& !p_info.isVirtualColumn(i) // no virtual column
|
&& !p_info.isVirtualColumn(i) // no virtual column
|
||||||
&& !"Password".equals(columnName)
|
&& !"Password".equals(columnName)
|
||||||
|
|
@ -2740,6 +2747,7 @@ public abstract class PO
|
||||||
{
|
{
|
||||||
Object value = m_oldValues[i];
|
Object value = m_oldValues[i];
|
||||||
if (value != null
|
if (value != null
|
||||||
|
&& p_info.isAllowLogging(i) // logging allowed
|
||||||
&& !p_info.isEncrypted(i) // not encrypted
|
&& !p_info.isEncrypted(i) // not encrypted
|
||||||
&& !p_info.isVirtualColumn(i) // no virtual column
|
&& !p_info.isVirtualColumn(i) // no virtual column
|
||||||
&& !"Password".equals(p_info.getColumnName(i))
|
&& !"Password".equals(p_info.getColumnName(i))
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
/******************************************************************************
|
/******************************************************************************
|
||||||
* Product: Adempiere ERP & CRM Smart Business Solution *
|
* Product: Adempiere ERP & CRM Smart Business Solution *
|
||||||
* Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. *
|
* Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. *
|
||||||
* This program is free software; you can redistribute it and/or modify it *
|
* This program is free software; you can redistribute it and/or modify it *
|
||||||
* under the terms version 2 of the GNU General Public License as published *
|
* under the terms version 2 of the GNU General Public License as published *
|
||||||
|
|
@ -135,7 +135,8 @@ public class POInfo implements Serializable
|
||||||
+ "c.IsKey,c.IsParent, " // 10..11
|
+ "c.IsKey,c.IsParent, " // 10..11
|
||||||
+ "c.AD_Reference_Value_ID, vr.Code, " // 12..13
|
+ "c.AD_Reference_Value_ID, vr.Code, " // 12..13
|
||||||
+ "c.FieldLength, c.ValueMin, c.ValueMax, c.IsTranslated, " // 14..17
|
+ "c.FieldLength, c.ValueMin, c.ValueMax, c.IsTranslated, " // 14..17
|
||||||
+ "t.AccessLevel, c.ColumnSQL, c.IsEncrypted "); // 18..20
|
+ "t.AccessLevel, c.ColumnSQL, c.IsEncrypted, " // 18..20
|
||||||
|
+ "c.IsAllowLogging "); // 21
|
||||||
sql.append("FROM AD_Table t"
|
sql.append("FROM AD_Table t"
|
||||||
+ " INNER JOIN AD_Column c ON (t.AD_Table_ID=c.AD_Table_ID)"
|
+ " INNER JOIN AD_Column c ON (t.AD_Table_ID=c.AD_Table_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)"
|
||||||
|
|
@ -182,6 +183,7 @@ public class POInfo implements Serializable
|
||||||
m_AccessLevel = rs.getString(18);
|
m_AccessLevel = rs.getString(18);
|
||||||
String ColumnSQL = rs.getString(19);
|
String ColumnSQL = rs.getString(19);
|
||||||
boolean IsEncrypted = "Y".equals(rs.getString(20));
|
boolean IsEncrypted = "Y".equals(rs.getString(20));
|
||||||
|
boolean IsAllowLogging = "Y".equals(rs.getString(21));
|
||||||
|
|
||||||
POInfoColumn col = new POInfoColumn (
|
POInfoColumn col = new POInfoColumn (
|
||||||
AD_Column_ID, ColumnName, ColumnSQL, AD_Reference_ID,
|
AD_Column_ID, ColumnName, ColumnSQL, AD_Reference_ID,
|
||||||
|
|
@ -190,7 +192,8 @@ public class POInfo implements Serializable
|
||||||
IsKey, IsParent,
|
IsKey, IsParent,
|
||||||
AD_Reference_Value_ID, ValidationCode,
|
AD_Reference_Value_ID, ValidationCode,
|
||||||
FieldLength, ValueMin, ValueMax,
|
FieldLength, ValueMin, ValueMax,
|
||||||
IsTranslated, IsEncrypted);
|
IsTranslated, IsEncrypted,
|
||||||
|
IsAllowLogging);
|
||||||
list.add(col);
|
list.add(col);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -397,7 +400,7 @@ public class POInfo implements Serializable
|
||||||
* @param index index
|
* @param index index
|
||||||
* @return Class
|
* @return Class
|
||||||
*/
|
*/
|
||||||
public Class getColumnClass (int index)
|
public Class<?> getColumnClass (int index)
|
||||||
{
|
{
|
||||||
if (index < 0 || index >= m_columns.length)
|
if (index < 0 || index >= m_columns.length)
|
||||||
return null;
|
return null;
|
||||||
|
|
@ -577,6 +580,19 @@ public class POInfo implements Serializable
|
||||||
return m_columns[index].IsEncrypted;
|
return m_columns[index].IsEncrypted;
|
||||||
} // isEncrypted
|
} // isEncrypted
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Is allowed logging on this column
|
||||||
|
*
|
||||||
|
* @param index
|
||||||
|
* index
|
||||||
|
* @return true if column is allowed to be logged
|
||||||
|
*/
|
||||||
|
public boolean isAllowLogging(int index) {
|
||||||
|
if (index < 0 || index >= m_columns.length)
|
||||||
|
return false;
|
||||||
|
return m_columns[index].IsAllowLogging;
|
||||||
|
} // isAllowLogging
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get Column FieldLength
|
* Get Column FieldLength
|
||||||
* @param index index
|
* @param index index
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
/******************************************************************************
|
/******************************************************************************
|
||||||
* Product: Adempiere ERP & CRM Smart Business Solution *
|
* Product: Adempiere ERP & CRM Smart Business Solution *
|
||||||
* Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. *
|
* Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. *
|
||||||
* This program is free software; you can redistribute it and/or modify it *
|
* This program is free software; you can redistribute it and/or modify it *
|
||||||
* under the terms version 2 of the GNU General Public License as published *
|
* under the terms version 2 of the GNU General Public License as published *
|
||||||
|
|
@ -16,10 +16,11 @@
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
package org.compiere.model;
|
package org.compiere.model;
|
||||||
|
|
||||||
import java.io.*;
|
import java.io.Serializable;
|
||||||
import java.math.*;
|
import java.math.BigDecimal;
|
||||||
import java.util.logging.*;
|
import java.util.logging.Level;
|
||||||
import org.compiere.util.*;
|
|
||||||
|
import org.compiere.util.CLogger;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* PO Info Column Info Value Object
|
* PO Info Column Info Value Object
|
||||||
|
|
@ -35,7 +36,7 @@ public class POInfoColumn implements Serializable
|
||||||
/**
|
/**
|
||||||
* Constructor
|
* Constructor
|
||||||
* @param ad_Column_ID Column ID
|
* @param ad_Column_ID Column ID
|
||||||
* @param columnName Dolumn name
|
* @param columnName Column name
|
||||||
* @param columnSQL virtual column
|
* @param columnSQL virtual column
|
||||||
* @param displayType Display Type
|
* @param displayType Display Type
|
||||||
* @param isMandatory Mandatory
|
* @param isMandatory Mandatory
|
||||||
|
|
@ -52,6 +53,7 @@ public class POInfoColumn implements Serializable
|
||||||
* @param valueMax maximal value
|
* @param valueMax maximal value
|
||||||
* @param isTranslated translated
|
* @param isTranslated translated
|
||||||
* @param isEncrypted encrypted
|
* @param isEncrypted encrypted
|
||||||
|
* @param isAllowLogging allow logging
|
||||||
*/
|
*/
|
||||||
public POInfoColumn (int ad_Column_ID, String columnName, String columnSQL, int displayType,
|
public POInfoColumn (int ad_Column_ID, String columnName, String columnSQL, int displayType,
|
||||||
boolean isMandatory, boolean isUpdateable, String defaultLogic,
|
boolean isMandatory, boolean isUpdateable, String defaultLogic,
|
||||||
|
|
@ -59,7 +61,7 @@ public class POInfoColumn implements Serializable
|
||||||
boolean isKey, boolean isParent,
|
boolean isKey, boolean isParent,
|
||||||
int ad_Reference_Value_ID, String validationCode,
|
int ad_Reference_Value_ID, String validationCode,
|
||||||
int fieldLength, String valueMin, String valueMax,
|
int fieldLength, String valueMin, String valueMax,
|
||||||
boolean isTranslated, boolean isEncrypted)
|
boolean isTranslated, boolean isEncrypted, boolean isAllowLogging)
|
||||||
{
|
{
|
||||||
AD_Column_ID = ad_Column_ID;
|
AD_Column_ID = ad_Column_ID;
|
||||||
ColumnName = columnName;
|
ColumnName = columnName;
|
||||||
|
|
@ -117,6 +119,7 @@ public class POInfoColumn implements Serializable
|
||||||
}
|
}
|
||||||
IsTranslated = isTranslated;
|
IsTranslated = isTranslated;
|
||||||
IsEncrypted = isEncrypted;
|
IsEncrypted = isEncrypted;
|
||||||
|
IsAllowLogging = isAllowLogging;
|
||||||
} // Column
|
} // Column
|
||||||
|
|
||||||
/** Column ID */
|
/** Column ID */
|
||||||
|
|
@ -128,7 +131,7 @@ public class POInfoColumn implements Serializable
|
||||||
/** Display Type */
|
/** Display Type */
|
||||||
public int DisplayType;
|
public int DisplayType;
|
||||||
/** Data Type */
|
/** Data Type */
|
||||||
public Class ColumnClass;
|
public Class<?> ColumnClass;
|
||||||
/** Mandatory */
|
/** Mandatory */
|
||||||
public boolean IsMandatory;
|
public boolean IsMandatory;
|
||||||
/** Default Value */
|
/** Default Value */
|
||||||
|
|
@ -145,8 +148,10 @@ public class POInfoColumn implements Serializable
|
||||||
public boolean IsParent;
|
public boolean IsParent;
|
||||||
/** Translated */
|
/** Translated */
|
||||||
public boolean IsTranslated;
|
public boolean IsTranslated;
|
||||||
/** Encryoted */
|
/** Encrypted */
|
||||||
public boolean IsEncrypted;
|
public boolean IsEncrypted;
|
||||||
|
/** Allow Logging */
|
||||||
|
public boolean IsAllowLogging;
|
||||||
|
|
||||||
/** Reference Value */
|
/** Reference Value */
|
||||||
public int AD_Reference_Value_ID;
|
public int AD_Reference_Value_ID;
|
||||||
|
|
|
||||||
|
|
@ -958,4 +958,20 @@ public class X_AD_Column extends PO implements I_AD_Column, I_Persistent
|
||||||
return Env.ZERO;
|
return Env.ZERO;
|
||||||
return bd;
|
return bd;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** Get IsAllowLogging .
|
||||||
|
* Determines, if a column must be recorded into the change log
|
||||||
|
*/
|
||||||
|
public boolean IsAllowLogging() {
|
||||||
|
Object oo = get_Value(COLUMNNAME_isAllowLogging);
|
||||||
|
if (oo != null)
|
||||||
|
{
|
||||||
|
if (oo instanceof Boolean)
|
||||||
|
return ((Boolean)oo).booleanValue();
|
||||||
|
return "Y".equals(oo);
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -0,0 +1,29 @@
|
||||||
|
-- Jul 23, 2008 4:50:40 PM COT
|
||||||
|
-- [ 1810133 ] Add logging policy on column level
|
||||||
|
INSERT INTO AD_Element (AD_Client_ID,AD_Element_ID,AD_Org_ID,ColumnName,Created,CreatedBy,Description,EntityType,IsActive,Name,PrintName,Updated,UpdatedBy) VALUES (0,53669,0,'IsAllowLogging',TO_DATE('2008-07-23 16:50:36','YYYY-MM-DD HH24:MI:SS'),100,'Determine if a column must be recorded into the change log','U','Y','IsAllowLogging','IsAllowLogging',TO_DATE('2008-07-23 16:50:36','YYYY-MM-DD HH24:MI:SS'),100)
|
||||||
|
;
|
||||||
|
|
||||||
|
INSERT INTO AD_Element_Trl (AD_Language,AD_Element_ID, Description,Help,Name,PO_Description,PO_Help,PO_Name,PO_PrintName,PrintName, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Element_ID, t.Description,t.Help,t.Name,t.PO_Description,t.PO_Help,t.PO_Name,t.PO_PrintName,t.PrintName, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Element t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Element_ID=53669 AND EXISTS (SELECT * FROM AD_Element_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Element_ID!=t.AD_Element_ID)
|
||||||
|
;
|
||||||
|
|
||||||
|
UPDATE AD_Element_Trl SET IsTranslated='Y',Name='RegistrarEnLog',PrintName='Registrar en Log de Cambios',Description='Determina si una columna debe ser registrada en el log de cambios',Updated=TO_DATE('2008-07-23 16:53:04','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Element_ID=53669 AND AD_Language='es_MX'
|
||||||
|
;
|
||||||
|
|
||||||
|
INSERT INTO AD_Column (AD_Client_ID,AD_Column_ID,AD_Element_ID,AD_Org_ID,AD_Reference_ID,AD_Table_ID,ColumnName,Created,CreatedBy,DefaultValue,Description,EntityType,FieldLength,IsActive,IsAlwaysUpdateable,IsEncrypted,IsIdentifier,IsKey,IsMandatory,IsParent,IsSelectionColumn,IsSyncDatabase,IsTranslated,IsUpdateable,Name,SeqNo,Updated,UpdatedBy,Version) VALUES (0,56187,53669,0,20,101,'IsAllowLogging',TO_DATE('2008-07-23 16:55:42','YYYY-MM-DD HH24:MI:SS'),100,'Y','Determine if a column must be recorded into the change log','D',1,'Y','N','N','N','N','N','N','N','N','N','Y','IsAllowLogging',0,TO_DATE('2008-07-23 16:55:42','YYYY-MM-DD HH24:MI:SS'),100,0)
|
||||||
|
;
|
||||||
|
|
||||||
|
INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=56187 AND EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Column_ID!=t.AD_Column_ID)
|
||||||
|
;
|
||||||
|
|
||||||
|
ALTER TABLE AD_Column ADD IsAllowLogging CHAR(1) DEFAULT 'Y' CHECK (IsAllowLogging IN ('Y','N'))
|
||||||
|
;
|
||||||
|
|
||||||
|
INSERT INTO AD_Field (AD_Client_ID,AD_Column_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,Created,CreatedBy,Description,DisplayLength,EntityType,IsActive,IsCentrallyMaintained,IsDisplayed,IsEncrypted,IsFieldOnly,IsHeading,IsReadOnly,IsSameLine,Name,SeqNo,SortNo,Updated,UpdatedBy) VALUES (0,56187,56317,0,101,TO_DATE('2008-07-23 16:57:53','YYYY-MM-DD HH24:MI:SS'),100,'Determine if a column must be recorded into the change log',0,'D','Y','Y','Y','N','N','N','N','N','IsAllowLogging',370,0,TO_DATE('2008-07-23 16:57:53','YYYY-MM-DD HH24:MI:SS'),100)
|
||||||
|
;
|
||||||
|
|
||||||
|
INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=56317 AND EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Field_ID!=t.AD_Field_ID)
|
||||||
|
;
|
||||||
|
|
||||||
|
|
||||||
|
UPDATE AD_Column SET IsAllowLogging = 'N' WHERE AD_Column_ID IN (6652, 6653)
|
||||||
|
;
|
||||||
|
|
@ -0,0 +1,29 @@
|
||||||
|
-- Jul 23, 2008 4:50:40 PM COT
|
||||||
|
-- [ 1810133 ] Add logging policy on column level
|
||||||
|
INSERT INTO AD_Element (AD_Client_ID,AD_Element_ID,AD_Org_ID,ColumnName,Created,CreatedBy,Description,EntityType,IsActive,Name,PrintName,Updated,UpdatedBy) VALUES (0,53669,0,'IsAllowLogging',TO_TIMESTAMP('2008-07-23 16:50:36','YYYY-MM-DD HH24:MI:SS'),100,'Determine if a column must be recorded into the change log','U','Y','IsAllowLogging','IsAllowLogging',TO_TIMESTAMP('2008-07-23 16:50:36','YYYY-MM-DD HH24:MI:SS'),100)
|
||||||
|
;
|
||||||
|
|
||||||
|
INSERT INTO AD_Element_Trl (AD_Language,AD_Element_ID, Description,Help,Name,PO_Description,PO_Help,PO_Name,PO_PrintName,PrintName, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Element_ID, t.Description,t.Help,t.Name,t.PO_Description,t.PO_Help,t.PO_Name,t.PO_PrintName,t.PrintName, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Element t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Element_ID=53669 AND EXISTS (SELECT * FROM AD_Element_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Element_ID!=t.AD_Element_ID)
|
||||||
|
;
|
||||||
|
|
||||||
|
UPDATE AD_Element_Trl SET IsTranslated='Y',Name='RegistrarEnLog',PrintName='Registrar en Log de Cambios',Description='Determina si una columna debe ser registrada en el log de cambios',Updated=TO_TIMESTAMP('2008-07-23 16:53:04','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Element_ID=53669 AND AD_Language='es_MX'
|
||||||
|
;
|
||||||
|
|
||||||
|
INSERT INTO AD_Column (AD_Client_ID,AD_Column_ID,AD_Element_ID,AD_Org_ID,AD_Reference_ID,AD_Table_ID,ColumnName,Created,CreatedBy,DefaultValue,Description,EntityType,FieldLength,IsActive,IsAlwaysUpdateable,IsEncrypted,IsIdentifier,IsKey,IsMandatory,IsParent,IsSelectionColumn,IsSyncDatabase,IsTranslated,IsUpdateable,Name,SeqNo,Updated,UpdatedBy,Version) VALUES (0,56187,53669,0,20,101,'IsAllowLogging',TO_TIMESTAMP('2008-07-23 16:55:42','YYYY-MM-DD HH24:MI:SS'),100,'Y','Determine if a column must be recorded into the change log','D',1,'Y','N','N','N','N','N','N','N','N','N','Y','IsAllowLogging',0,TO_TIMESTAMP('2008-07-23 16:55:42','YYYY-MM-DD HH24:MI:SS'),100,0)
|
||||||
|
;
|
||||||
|
|
||||||
|
INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=56187 AND EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Column_ID!=t.AD_Column_ID)
|
||||||
|
;
|
||||||
|
|
||||||
|
ALTER TABLE AD_Column ADD COLUMN IsAllowLogging CHAR(1) DEFAULT 'Y' CHECK (IsAllowLogging IN ('Y','N'))
|
||||||
|
;
|
||||||
|
|
||||||
|
INSERT INTO AD_Field (AD_Client_ID,AD_Column_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,Created,CreatedBy,Description,DisplayLength,EntityType,IsActive,IsCentrallyMaintained,IsDisplayed,IsEncrypted,IsFieldOnly,IsHeading,IsReadOnly,IsSameLine,Name,SeqNo,SortNo,Updated,UpdatedBy) VALUES (0,56187,56317,0,101,TO_TIMESTAMP('2008-07-23 16:57:53','YYYY-MM-DD HH24:MI:SS'),100,'Determine if a column must be recorded into the change log',0,'D','Y','Y','Y','N','N','N','N','N','IsAllowLogging',370,0,TO_TIMESTAMP('2008-07-23 16:57:53','YYYY-MM-DD HH24:MI:SS'),100)
|
||||||
|
;
|
||||||
|
|
||||||
|
INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=56317 AND EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Field_ID!=t.AD_Field_ID)
|
||||||
|
;
|
||||||
|
|
||||||
|
|
||||||
|
UPDATE AD_Column SET IsAllowLogging = 'N' WHERE AD_Column_ID IN (6652, 6653)
|
||||||
|
;
|
||||||
Loading…
Reference in New Issue