FR2818821 Copy "Report and Process" process

https://sourceforge.net/tracker/?func=detail&atid=879335&aid=2818821&group_id=176962
This commit is contained in:
phib 2009-07-13 05:26:09 +00:00
parent 30616a0000
commit 25b2a8bd96
5 changed files with 289 additions and 0 deletions

View File

@ -19,6 +19,7 @@ package org.compiere.model;
import java.sql.ResultSet; import java.sql.ResultSet;
import java.util.List; import java.util.List;
import java.util.Properties; import java.util.Properties;
import java.util.logging.Level;
import org.adempiere.util.ProcessUtil; import org.adempiere.util.ProcessUtil;
import org.compiere.process.ProcessInfo; import org.compiere.process.ProcessInfo;
@ -382,4 +383,45 @@ public class MProcess extends X_AD_Process
return retValue; return retValue;
} }
/**
* Copy settings from another process
* overwrites existing data
* (including translations)
* and saves.
* Not overwritten: name, value, entitytype
* @param source
*/
public void copyFrom (MProcess source)
{
log.log(Level.FINE, "Copying from:" + source + ", to: " + this);
setAccessLevel(source.getAccessLevel());
setAD_Form_ID(source.getAD_Form_ID());
setAD_PrintFormat_ID(source.getAD_PrintFormat_ID());
setAD_ReportView_ID(source.getAD_ReportView_ID());
setAD_Workflow_ID(source.getAD_Workflow_ID());
setClassname(source.getClassname());
setDescription(source.getDescription());
setHelp(source.getHelp());
setIsBetaFunctionality(source.isBetaFunctionality());
setIsDirectPrint(source.isDirectPrint());
setIsReport(source.isReport());
setIsServerProcess(source.isServerProcess());
setJasperReport(source.getJasperReport());
setProcedureName(source.getProcedureName());
setShowHelp(source.getShowHelp());
saveEx();
// copy parameters
// TODO? Perhaps should delete existing first?
MProcessPara[] parameters = source.getParameters();
for ( MProcessPara sourcePara : parameters )
{
MProcessPara targetPara = new MProcessPara(this);
targetPara.copyFrom (sourcePara); // saves automatically
}
}
} // MProcess } // MProcess

View File

@ -21,6 +21,7 @@ import java.util.Properties;
import java.util.logging.Level; import java.util.logging.Level;
import org.compiere.util.CCache; import org.compiere.util.CCache;
import org.compiere.util.DB;
import org.compiere.util.DisplayType; import org.compiere.util.DisplayType;
import org.compiere.util.Env; import org.compiere.util.Env;
@ -98,6 +99,18 @@ public class MProcessPara extends X_AD_Process_Para
super(ctx, rs, trxName); super(ctx, rs, trxName);
} // MProcessPara } // MProcessPara
/**
* Parent constructor
* @param parent process
*/
public MProcessPara(MProcess parent) {
this (parent.getCtx(), 0, parent.get_TrxName());
setClientOrg(parent);
setAD_Process_ID(parent.getAD_Process_ID());
setEntityType(parent.getEntityType());
}
/** Virtual Window No - 999 */ /** Virtual Window No - 999 */
public static int WINDOW_NO = 999; public static int WINDOW_NO = 999;
/** Virtual Tab No - 0 */ /** Virtual Tab No - 0 */
@ -203,5 +216,56 @@ public class MProcessPara extends X_AD_Process_Para
.append ("]"); .append ("]");
return sb.toString (); return sb.toString ();
} // toString } // toString
/**
* Copy settings from another process parameter
* overwrites existing data
* (including translations)
* and saves
* @param source
*/
public void copyFrom (MProcessPara source)
{
log.log(Level.FINE, "Copying from:" + source + ", to: " + this);
setAD_Element_ID(source.getAD_Element_ID());
setAD_Reference_ID(source.getAD_Reference_ID());
setAD_Reference_Value_ID(source.getAD_Reference_Value_ID());
setAD_Val_Rule_ID(source.getAD_Val_Rule_ID());
setColumnName(source.getColumnName());
setDefaultValue(source.getDefaultValue());
setDefaultValue2(source.getDefaultValue2());
setDescription(source.getDescription());
setDisplayLogic(source.getDisplayLogic());
setFieldLength(source.getFieldLength());
setHelp(source.getHelp());
setIsActive(source.isActive());
setIsCentrallyMaintained(source.isCentrallyMaintained());
setIsMandatory(source.isMandatory());
setIsRange(source.isRange());
setName(source.getName());
setReadOnlyLogic(source.getReadOnlyLogic());
setSeqNo(source.getSeqNo());
setValueMax(source.getValueMax());
setValueMin(source.getValueMin());
setVFormat(source.getVFormat());
saveEx();
// delete new translations and copy translations from source
String sql = "DELETE FROM AD_Process_Para_Trl WHERE AD_Process_Para_ID = ?";
int count = DB.executeUpdateEx(sql, new Object[] { getAD_Process_Para_ID() }, get_TrxName());
log.log(Level.FINE, "AD_Process_Para_Trl deleted: " + count);
sql = "INSERT INTO AD_Process_Para_Trl (AD_Process_Para_ID, AD_Language, " +
" AD_Client_ID, AD_Org_ID, IsActive, Created, CreatedBy, Updated, UpdatedBy, " +
" Name, Description, Help, IsTranslated) " +
" SELECT ?, AD_Language, AD_Client_ID, AD_Org_ID, IsActive, Created, CreatedBy, " +
" Updated, UpdatedBy, Name, Description, Help, IsTranslated " +
" FROM AD_Process_Para_Trl WHERE AD_Process_Para_ID = ? ";
count = DB.executeUpdateEx(sql, new Object[] { getAD_Process_Para_ID(), source.getAD_Process_Para_ID() }, get_TrxName());
log.log(Level.FINE, "AD_Process_Para_Trl inserted: " + count);
}
} // MProcessPara } // MProcessPara

View File

@ -0,0 +1,73 @@
/******************************************************************************
* Product: Adempiere ERP & CRM Smart Business Solution *
* Copyright (C) 2007 ADempiere, Inc. All Rights Reserved. *
* 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 *
* by the Free Software Foundation. This program is distributed in the hope *
* that it will be useful, but WITHOUT ANY WARRANTY; without even the implied *
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. *
* See the GNU General Public License for more details. *
* You should have received a copy of the GNU General Public License along *
* with this program; if not, write to the Free Software Foundation, Inc., *
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
* For the text or an alternative of this public license, you may reach us *
* Adempiere, Inc. *
*****************************************************************************/
package org.compiere.process;
import java.util.logging.Level;
import org.adempiere.exceptions.AdempiereException;
import org.compiere.model.MProcess;
import org.compiere.model.MProcessPara;
import org.compiere.util.Msg;
/**
*
* @author Paul Bowden (phib)
* Adaxa Pty Ltd
* Copy settings and parameters from source "Report and Process" to target
* overwrites existing data (including translations)
*
*/
public class CopyReportProcess extends SvrProcess {
private int sourceId = 0;
private int targetId = 0;
@Override
protected String doIt() throws Exception {
MProcess source = new MProcess(getCtx(), sourceId, get_TrxName());
MProcess target = new MProcess(getCtx(), targetId, get_TrxName());
if ( sourceId <= 0 || targetId <= 0 || source == null || target == null )
throw new AdempiereException(Msg.getMsg(getCtx(), "CopyProcessRequired"));
target.copyFrom(source); // saves automatically
return "@OK@";
}
@Override
protected void prepare() {
ProcessInfoParameter[] params = getParameter();
for (ProcessInfoParameter parameter : params)
{
String para = parameter.getParameterName();
if ( para.equals("AD_Process_ID") )
sourceId = parameter.getParameterAsInt();
else if ( para.equals("AD_Process_To_ID"))
targetId = parameter.getParameterAsInt();
else
log.log(Level.WARNING, "Unknown paramter: " + para);
}
if ( targetId == 0 )
targetId = getRecord_ID();
}
}

View File

@ -0,0 +1,55 @@
-- 9/07/2009 11:24:09
-- Copy report and process
INSERT INTO AD_Process (AD_Client_ID,AD_Org_ID,AD_Process_ID,AccessLevel,Classname,Created,CreatedBy,Description,EntityType,Help,IsActive,IsBetaFunctionality,IsDirectPrint,IsReport,IsServerProcess,Name,ShowHelp,Statistic_Count,Statistic_Seconds,Updated,UpdatedBy,Value) VALUES (0,0,53179,'4','org.compiere.process.CopyReportProcess',TO_DATE('2009-07-09 11:24:07','YYYY-MM-DD HH24:MI:SS'),100,'Copy settings from one report and process to another.','D','Copy the settings from the selected report and process to the current one. This overwrites existing settings and translations.','Y','N','N','N','N','Copy From Report and Process','Y',0,0,TO_DATE('2009-07-09 11:24:07','YYYY-MM-DD HH24:MI:SS'),100,'CopyFromProcess')
;
-- 9/07/2009 11:24:09
-- Copy report and process
INSERT INTO AD_Process_Trl (AD_Language,AD_Process_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Process_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_Process t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Process_ID=53179 AND EXISTS (SELECT * FROM AD_Process_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Process_ID!=t.AD_Process_ID)
;
-- 9/07/2009 11:25:08
-- Copy report and process
INSERT INTO AD_Process_Para (AD_Client_ID,AD_Element_ID,AD_Org_ID,AD_Process_ID,AD_Process_Para_ID,AD_Reference_ID,ColumnName,Created,CreatedBy,DefaultValue,Description,EntityType,FieldLength,Help,IsActive,IsCentrallyMaintained,IsMandatory,IsRange,Name,SeqNo,Updated,UpdatedBy) VALUES (0,117,0,53179,53321,19,'AD_Process_ID',TO_DATE('2009-07-09 11:25:04','YYYY-MM-DD HH24:MI:SS'),100,'-1','Report and Process to copy from','D',22,NULL,'Y','Y','Y','N','Copy from',10,TO_DATE('2009-07-09 11:25:04','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 9/07/2009 11:25:08
-- Copy report and process
INSERT INTO AD_Process_Para_Trl (AD_Language,AD_Process_Para_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Process_Para_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_Process_Para t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Process_Para_ID=53321 AND EXISTS (SELECT * FROM AD_Process_Para_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Process_Para_ID!=t.AD_Process_Para_ID)
;
-- 9/07/2009 11:25:58
-- Copy report and process
INSERT INTO AD_Element (AD_Client_ID,AD_Element_ID,AD_Org_ID,ColumnName,Created,CreatedBy,Description,EntityType,Help,IsActive,Name,PrintName,Updated,UpdatedBy) VALUES (0,53893,0,'CopyFromProcess',TO_DATE('2009-07-09 11:25:57','YYYY-MM-DD HH24:MI:SS'),100,'Copy settings from one report and process to another.','D','Copy the settings from the selected report and process to the current one. This overwrites existing settings and translations.','Y','Copy From Report and Process','Copy From Report and Process',TO_DATE('2009-07-09 11:25:57','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 9/07/2009 11:25:58
-- Copy report and process
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=53893 AND EXISTS (SELECT * FROM AD_Element_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Element_ID!=t.AD_Element_ID)
;
-- 9/07/2009 11:26:46
-- Copy report and process
INSERT INTO AD_Column (AD_Client_ID,AD_Column_ID,AD_Element_ID,AD_Org_ID,AD_Process_ID,AD_Reference_ID,AD_Table_ID,ColumnName,Created,CreatedBy,Description,EntityType,FieldLength,Help,IsActive,IsAllowLogging,IsAlwaysUpdateable,IsAutocomplete,IsEncrypted,IsIdentifier,IsKey,IsMandatory,IsParent,IsSelectionColumn,IsSyncDatabase,IsTranslated,IsUpdateable,Name,SeqNo,Updated,UpdatedBy,Version) VALUES (0,57920,53893,0,53179,28,284,'CopyFromProcess',TO_DATE('2009-07-09 11:26:44','YYYY-MM-DD HH24:MI:SS'),100,'Copy settings from one report and process to another.','D',1,'Copy the settings from the selected report and process to the current one. This overwrites existing settings and translations.','Y','Y','N','N','N','N','N','N','N','N','N','N','Y','Copy From Report and Process',0,TO_DATE('2009-07-09 11:26:44','YYYY-MM-DD HH24:MI:SS'),100,0)
;
-- 9/07/2009 11:26:46
-- Copy report and process
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=57920 AND EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Column_ID!=t.AD_Column_ID)
;
-- 9/07/2009 11:28:01
-- Copy report and process
INSERT INTO AD_Field (AD_Client_ID,AD_Column_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,Created,CreatedBy,Description,DisplayLength,EntityType,Help,IsActive,IsCentrallyMaintained,IsDisplayed,IsEncrypted,IsFieldOnly,IsHeading,IsReadOnly,IsSameLine,Name,SeqNo,SortNo,Updated,UpdatedBy) VALUES (0,57920,57342,0,245,TO_DATE('2009-07-09 11:28:00','YYYY-MM-DD HH24:MI:SS'),100,'Copy settings from one report and process to another.',22,'D','Copy the settings from the selected report and process to the current one. This overwrites existing settings and translations.','Y','Y','Y','N','N','N','N','N','Copy From Report and Process',220,0,TO_DATE('2009-07-09 11:28:00','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 9/07/2009 11:28:01
-- Copy report and process
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=57342 AND EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Field_ID!=t.AD_Field_ID)
;
-- 9/07/2009 11:29:37
-- Copy report and process
ALTER TABLE AD_Process ADD CopyFromProcess CHAR(1) DEFAULT NULL
;

View File

@ -0,0 +1,55 @@
-- 9/07/2009 11:24:09
-- Copy report and process
INSERT INTO AD_Process (AD_Client_ID,AD_Org_ID,AD_Process_ID,AccessLevel,Classname,Created,CreatedBy,Description,EntityType,Help,IsActive,IsBetaFunctionality,IsDirectPrint,IsReport,IsServerProcess,Name,ShowHelp,Statistic_Count,Statistic_Seconds,Updated,UpdatedBy,Value) VALUES (0,0,53179,'4','org.compiere.process.CopyReportProcess',TO_TIMESTAMP('2009-07-09 11:24:07','YYYY-MM-DD HH24:MI:SS'),100,'Copy settings from one report and process to another.','D','Copy the settings from the selected report and process to the current one. This overwrites existing settings and translations.','Y','N','N','N','N','Copy From Report and Process','Y',0,0,TO_TIMESTAMP('2009-07-09 11:24:07','YYYY-MM-DD HH24:MI:SS'),100,'CopyFromProcess')
;
-- 9/07/2009 11:24:09
-- Copy report and process
INSERT INTO AD_Process_Trl (AD_Language,AD_Process_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Process_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_Process t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Process_ID=53179 AND EXISTS (SELECT * FROM AD_Process_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Process_ID!=t.AD_Process_ID)
;
-- 9/07/2009 11:25:08
-- Copy report and process
INSERT INTO AD_Process_Para (AD_Client_ID,AD_Element_ID,AD_Org_ID,AD_Process_ID,AD_Process_Para_ID,AD_Reference_ID,ColumnName,Created,CreatedBy,DefaultValue,Description,EntityType,FieldLength,Help,IsActive,IsCentrallyMaintained,IsMandatory,IsRange,Name,SeqNo,Updated,UpdatedBy) VALUES (0,117,0,53179,53321,19,'AD_Process_ID',TO_TIMESTAMP('2009-07-09 11:25:04','YYYY-MM-DD HH24:MI:SS'),100,'-1','Report and Process to copy from','D',22,NULL,'Y','Y','Y','N','Copy from',10,TO_TIMESTAMP('2009-07-09 11:25:04','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 9/07/2009 11:25:08
-- Copy report and process
INSERT INTO AD_Process_Para_Trl (AD_Language,AD_Process_Para_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Process_Para_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_Process_Para t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Process_Para_ID=53321 AND EXISTS (SELECT * FROM AD_Process_Para_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Process_Para_ID!=t.AD_Process_Para_ID)
;
-- 9/07/2009 11:25:58
-- Copy report and process
INSERT INTO AD_Element (AD_Client_ID,AD_Element_ID,AD_Org_ID,ColumnName,Created,CreatedBy,Description,EntityType,Help,IsActive,Name,PrintName,Updated,UpdatedBy) VALUES (0,53893,0,'CopyFromProcess',TO_TIMESTAMP('2009-07-09 11:25:57','YYYY-MM-DD HH24:MI:SS'),100,'Copy settings from one report and process to another.','D','Copy the settings from the selected report and process to the current one. This overwrites existing settings and translations.','Y','Copy From Report and Process','Copy From Report and Process',TO_TIMESTAMP('2009-07-09 11:25:57','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 9/07/2009 11:25:58
-- Copy report and process
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=53893 AND EXISTS (SELECT * FROM AD_Element_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Element_ID!=t.AD_Element_ID)
;
-- 9/07/2009 11:26:46
-- Copy report and process
INSERT INTO AD_Column (AD_Client_ID,AD_Column_ID,AD_Element_ID,AD_Org_ID,AD_Process_ID,AD_Reference_ID,AD_Table_ID,ColumnName,Created,CreatedBy,Description,EntityType,FieldLength,Help,IsActive,IsAllowLogging,IsAlwaysUpdateable,IsAutocomplete,IsEncrypted,IsIdentifier,IsKey,IsMandatory,IsParent,IsSelectionColumn,IsSyncDatabase,IsTranslated,IsUpdateable,Name,SeqNo,Updated,UpdatedBy,Version) VALUES (0,57920,53893,0,53179,28,284,'CopyFromProcess',TO_TIMESTAMP('2009-07-09 11:26:44','YYYY-MM-DD HH24:MI:SS'),100,'Copy settings from one report and process to another.','D',1,'Copy the settings from the selected report and process to the current one. This overwrites existing settings and translations.','Y','Y','N','N','N','N','N','N','N','N','N','N','Y','Copy From Report and Process',0,TO_TIMESTAMP('2009-07-09 11:26:44','YYYY-MM-DD HH24:MI:SS'),100,0)
;
-- 9/07/2009 11:26:46
-- Copy report and process
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=57920 AND EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Column_ID!=t.AD_Column_ID)
;
-- 9/07/2009 11:28:01
-- Copy report and process
INSERT INTO AD_Field (AD_Client_ID,AD_Column_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,Created,CreatedBy,Description,DisplayLength,EntityType,Help,IsActive,IsCentrallyMaintained,IsDisplayed,IsEncrypted,IsFieldOnly,IsHeading,IsReadOnly,IsSameLine,Name,SeqNo,SortNo,Updated,UpdatedBy) VALUES (0,57920,57342,0,245,TO_TIMESTAMP('2009-07-09 11:28:00','YYYY-MM-DD HH24:MI:SS'),100,'Copy settings from one report and process to another.',22,'D','Copy the settings from the selected report and process to the current one. This overwrites existing settings and translations.','Y','Y','Y','N','N','N','N','N','Copy From Report and Process',220,0,TO_TIMESTAMP('2009-07-09 11:28:00','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 9/07/2009 11:28:01
-- Copy report and process
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=57342 AND EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Field_ID!=t.AD_Field_ID)
;
-- 9/07/2009 11:29:37
-- Copy report and process
ALTER TABLE AD_Process ADD COLUMN CopyFromProcess CHAR(1) DEFAULT NULL
;