Integrate Karsten's autocompletion from trunk revisions 5521 and 5670

FR [2003044] Autocomplete for Textfields
http://sourceforge.net/tracker/index.php?func=detail&aid=2003044&group_id=176962&atid=879335
[Ctrl + Tab] iterates through all available matches
This commit is contained in:
Carlos Ruiz 2008-07-29 17:57:49 +00:00
parent 14244c9b7f
commit 574b0befe5
12 changed files with 872 additions and 18 deletions

View File

@ -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. *
* 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 *
@ -17,13 +17,27 @@
*****************************************************************************/
package org.compiere.model;
import java.beans.*;
import java.io.*;
import java.math.*;
import java.sql.*;
import java.util.*;
import java.util.logging.*;
import org.compiere.util.*;
import java.beans.PropertyChangeListener;
import java.beans.PropertyChangeSupport;
import java.io.Serializable;
import java.math.BigDecimal;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.List;
import java.util.Properties;
import java.util.StringTokenizer;
import java.util.logging.Level;
import org.compiere.util.CLogMgt;
import org.compiere.util.CLogger;
import org.compiere.util.DB;
import org.compiere.util.DisplayType;
import org.compiere.util.Env;
import org.compiere.util.Evaluatee;
import org.compiere.util.Evaluator;
/**
* Grid Field Model.
@ -46,9 +60,14 @@ import org.compiere.util.*;
public class GridField
implements Serializable, Evaluatee
{
/**
*
*/
private static final long serialVersionUID = 1783359481690560938L;
/**
* Field Constructor.
* requires initField for complete instatanciation
* requires initField for complete instantiation
* @param vo ValueObjecy
*/
public GridField (GridFieldVO vo)
@ -926,6 +945,13 @@ public class GridField
return false;
return m_vo.IsUpdateable;
}
/**
* Is Autocomplete
* @return true if autocomplete
*/
public boolean isAutocomplete() {
return m_vo.IsAutocomplete;
}
/**
* Is Always Updateable
* @return true if always updateable
@ -1650,4 +1676,58 @@ public class GridField
public boolean getIsCollapsedByDefault() {
return m_vo.IsCollapsedByDefault;
}
/**
* Returns a list containing all existing entries of this field
* with the actual AD_Org_ID and AD_Client_ID.
* @return List of existing entries for this field
*/
public List getEntries() {
ArrayList<String> list = new ArrayList<String>();
PreparedStatement pstmt1;
PreparedStatement pstmt2;
String sql = "";
try
{
String tableName = null;
String columnName = null;
int AD_Org_ID = Env.getAD_Org_ID(Env.getCtx());
int AD_Client_ID = Env.getAD_Client_ID(Env.getCtx());
sql = "SELECT t.TableName, c.ColumnName " +
" FROM AD_COLUMN c INNER JOIN AD_Table t ON (c.AD_Table_ID=t.AD_Table_ID)" +
" WHERE AD_Column_ID=?";
pstmt1 = DB.prepareStatement(sql, null);
pstmt1.setInt(1, getAD_Column_ID());
ResultSet rs1 = pstmt1.executeQuery();
if (rs1.next())
{
tableName = rs1.getString(1);
columnName = rs1.getString(2);
}
DB.close(rs1, pstmt1);
if (tableName != null && columnName != null) {
sql = "SELECT DISTINCT " + columnName + " FROM " + tableName + " WHERE AD_Client_ID=? "
+ " AND AD_Org_ID=?";
pstmt2 = DB.prepareStatement(sql, null);
pstmt2.setInt(1, AD_Client_ID);
pstmt2.setInt(2, AD_Org_ID);
ResultSet rs2 = pstmt2.executeQuery();
while (rs2.next())
{
list.add(rs2.getString(1));
}
DB.close(rs2, pstmt2);
}
}
catch (Exception e)
{
log.log(Level.SEVERE, sql, e);
}
return list;
}
} // MField

View File

@ -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. *
* 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 *
@ -174,6 +174,9 @@ public class GridFieldVO implements Serializable
//Info Factory class
else if (columnName.equalsIgnoreCase("InfoFactoryClass"))
vo.InfoFactoryClass = rs.getString(i);
// Feature Request FR [ 2003044 ]
else if (columnName.equalsIgnoreCase("IsAutocomplete"))
vo.IsAutocomplete = "Y".equals(rs.getString(i));
}
if (vo.Header == null)
vo.Header = vo.ColumnName;
@ -504,6 +507,8 @@ public class GridFieldVO implements Serializable
/** Collapse By Default * */
public boolean IsCollapsedByDefault = false;
/** Autocompletion for textfields - Feature Request FR [ 1757088 ] */
public boolean IsAutocomplete = false;
/**
* Set Context including contained elements
@ -599,6 +604,7 @@ public class GridFieldVO implements Serializable
clone.IsEncryptedField = IsEncryptedField;
clone.IsEncryptedColumn = IsEncryptedColumn;
clone.IsSelectionColumn = IsSelectionColumn;
clone.IsAutocomplete = IsAutocomplete;
clone.SortNo = SortNo;
clone.FieldLength = FieldLength;
clone.VFormat = VFormat;

View File

@ -289,6 +289,19 @@ public interface I_AD_Column
*/
public boolean isAlwaysUpdateable();
/** Column name IsAutocomplete */
public static final String COLUMNNAME_IsAutocomplete = "IsAutocomplete";
/** Set Autocomplete.
* Automatic completion for textfields
*/
public void setIsAutocomplete (boolean IsAutocomplete);
/** Get Autocomplete.
* Automatic completion for textfields
*/
public boolean isAutocomplete();
/** Column name IsEncrypted */
public static final String COLUMNNAME_IsEncrypted = "IsEncrypted";

View File

@ -50,6 +50,8 @@ public class X_AD_Column extends PO implements I_AD_Column, I_Persistent
setEntityType (null);
// U
setIsAlwaysUpdateable (false);
// N
setIsAutocomplete (false);
// N
setIsEncrypted (null);
// N
@ -559,6 +561,30 @@ public class X_AD_Column extends PO implements I_AD_Column, I_Persistent
return false;
}
/** Set Autocomplete.
@param IsAutocomplete
Automatic completion for textfields
*/
public void setIsAutocomplete (boolean IsAutocomplete)
{
set_Value (COLUMNNAME_IsAutocomplete, Boolean.valueOf(IsAutocomplete));
}
/** Get Autocomplete.
@return Automatic completion for textfields
*/
public boolean isAutocomplete ()
{
Object oo = get_Value(COLUMNNAME_IsAutocomplete);
if (oo != null)
{
if (oo instanceof Boolean)
return ((Boolean)oo).booleanValue();
return "Y".equals(oo);
}
return false;
}
/** IsEncrypted AD_Reference_ID=354 */
public static final int ISENCRYPTED_AD_Reference_ID=354;
/** Encrypted = Y */

View File

@ -0,0 +1,208 @@
/*
* $Id: AutoCompleteDecorator.java,v 1.9 2007/01/29 08:52:45 Bierhance Exp $
*
* Copyright 2004 Sun Microsystems, Inc., 4150 Network Circle,
* Santa Clara, California 95054, U.S.A. All rights reserved.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library 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
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
package org.compiere.grid.ed;
import java.awt.event.ActionEvent;
import java.awt.event.FocusAdapter;
import java.awt.event.FocusEvent;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import javax.swing.Action;
import javax.swing.ActionMap;
import javax.swing.InputMap;
import javax.swing.KeyStroke;
import javax.swing.UIManager;
import javax.swing.text.DefaultEditorKit;
import javax.swing.text.JTextComponent;
import javax.swing.text.TextAction;
import org.jdesktop.swingx.autocomplete.AbstractAutoCompleteAdaptor;
import org.jdesktop.swingx.autocomplete.AutoCompleteDecorator;
import org.jdesktop.swingx.autocomplete.AutoCompleteDocument;
import org.jdesktop.swingx.autocomplete.ObjectToStringConverter;
import org.jdesktop.swingx.autocomplete.TextComponentAdaptor;
/**
* Adds Ctrl+Tab invoked action to run through all potential auto completion values.
*/
public class ADempiereAutoCompleteDecorator extends AutoCompleteDecorator{
/**
* Enables automatic completion for the given JTextComponent based on the
* items contained in the given <tt>List</tt>.
* @param textComponent the text component that will be used for automatic
* completion.
* @param items contains the items that are used for autocompletion
* @param strictMatching <tt>true</tt>, if only given items should be allowed to be entered
*/
public static void decorate(JTextComponent textComponent, List items, boolean strictMatching) {
decorate(textComponent, items, strictMatching, ObjectToStringConverter.DEFAULT_IMPLEMENTATION);
}
/**
* Enables automatic completion for the given JTextComponent based on the
* items contained in the given <tt>List</tt>.
* @param items contains the items that are used for autocompletion
* @param textComponent the text component that will be used for automatic
* completion.
* @param strictMatching <tt>true</tt>, if only given items should be allowed to be entered
* @param stringConverter the converter used to transform items to strings
*/
public static void decorate(JTextComponent textComponent, List items, boolean strictMatching, ObjectToStringConverter stringConverter) {
AbstractAutoCompleteAdaptor adaptor = new TextComponentAdaptor(textComponent, items);
AutoCompleteDocument document = new AutoCompleteDocument(adaptor, strictMatching, stringConverter);
decorate(textComponent, document, adaptor);
}
/**
* Decorates a given text component for automatic completion using the
* given AutoCompleteDocument and AbstractAutoCompleteAdaptor.
*
*
* @param textComponent a text component that should be decorated
* @param document the AutoCompleteDocument to be installed on the text component
* @param adaptor the AbstractAutoCompleteAdaptor to be used
*/
public static void decorate(JTextComponent textComponent, AutoCompleteDocument document, final AbstractAutoCompleteAdaptor adaptor) {
// install the document on the text component
textComponent.setDocument(document);
// mark entire text when the text component gains focus
// otherwise the last mark would have been retained which is quiet confusing
textComponent.addFocusListener(new FocusAdapter() {
public void focusGained(FocusEvent e) {
JTextComponent textComponent = (JTextComponent) e.getSource();
adaptor.markEntireText();
}
});
// Tweak some key bindings
InputMap editorInputMap = textComponent.getInputMap();
if (document.isStrictMatching()) {
// move the selection to the left on VK_BACK_SPACE
editorInputMap.put(KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_BACK_SPACE, 0), DefaultEditorKit.selectionBackwardAction);
// ignore VK_DELETE and CTRL+VK_X and beep instead when strict matching
editorInputMap.put(KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_DELETE, 0), errorFeedbackAction);
editorInputMap.put(KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_X, java.awt.event.InputEvent.CTRL_DOWN_MASK), errorFeedbackAction);
} else {
ActionMap editorActionMap = textComponent.getActionMap();
// leave VK_DELETE and CTRL+VK_X as is
// VK_BACKSPACE will move the selection to the left if the selected item is in the list
// it will delete the previous character otherwise
editorInputMap.put(KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_BACK_SPACE, 0), "nonstrict-backspace");
editorActionMap.put("nonstrict-backspace", new NonStrictBackspaceAction(
editorActionMap.get(DefaultEditorKit.deletePrevCharAction),
editorActionMap.get(DefaultEditorKit.selectionBackwardAction),
adaptor));
editorInputMap.put(KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_TAB, java.awt.event.KeyEvent.CTRL_DOWN_MASK), "NextMatchAction");
editorActionMap.put("NextMatchAction", new NextMatchAction(textComponent, document, adaptor));
}
}
static class NonStrictBackspaceAction extends TextAction {
Action backspace;
Action selectionBackward;
AbstractAutoCompleteAdaptor adaptor;
public NonStrictBackspaceAction(Action backspace, Action selectionBackward, AbstractAutoCompleteAdaptor adaptor) {
super("nonstrict-backspace");
this.backspace = backspace;
this.selectionBackward = selectionBackward;
this.adaptor = adaptor;
}
public void actionPerformed(ActionEvent e) {
if (adaptor.listContainsSelectedItem()) {
selectionBackward.actionPerformed(e);
} else {
backspace.actionPerformed(e);
}
}
}
static class NextMatchAction extends TextAction {
JTextComponent textComponent;
AutoCompleteDocument document;
final AbstractAutoCompleteAdaptor adaptor;
final List<String> items;
int currentIndex = 0;
public NextMatchAction(JTextComponent textComponent, AutoCompleteDocument document, final AbstractAutoCompleteAdaptor adaptor) {
super("NextMatchAction");
this.textComponent = textComponent;
this.document = document;
this.adaptor = adaptor;
items = new ArrayList<String>(adaptor.getItemCount());
for (int i = 0; i < adaptor.getItemCount(); i++) {
Object o = adaptor.getItem(i);
items.add((o!=null)?(String) adaptor.getItem(i):"");
}
Collections.sort(items);
}
private String getNextMatch(String start) {
for (int i = currentIndex; i < items.size(); i++) {
if(items.get(i).toLowerCase().startsWith(start.toLowerCase())) {
currentIndex = i+1;
return items.get(i);
}
}
currentIndex=0;
return start;
}
/**
* Shows the next match.
*
* @param e the action event
*/
public void actionPerformed(ActionEvent e) {
JTextComponent target = getTextComponent(e);
if ((target != null) && (e != null)) {
if ((! target.isEditable()) || (! target.isEnabled())) {
UIManager.getLookAndFeel().provideErrorFeedback(target);
return;
}
String content = target.getText();
if (content != null && target.getSelectionStart()>0) {
content = content.substring(0,target.getSelectionStart());
}
if (content != null) {
target.setText(getNextMatch(content));
adaptor.markText(content.length());
}
}
}
}
/**
* A TextAction that provides an error feedback for the text component that invoked
* the action. The error feedback is most likely a "beep".
*/
static Object errorFeedbackAction = new TextAction("provide-error-feedback") {
public void actionPerformed(ActionEvent e) {
UIManager.getLookAndFeel().provideErrorFeedback(getTextComponent(e));
}
};
}

View File

@ -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. *
* 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 *
@ -16,16 +16,23 @@
*****************************************************************************/
package org.compiere.grid.ed;
import org.compiere.model.*;
import org.compiere.swing.*;
import java.util.logging.*;
import org.compiere.util.*;
import java.util.logging.Level;
import org.compiere.model.GridField;
import org.compiere.model.GridTab;
import org.compiere.model.MAccountLookup;
import org.compiere.model.MLocationLookup;
import org.compiere.model.MLocatorLookup;
import org.compiere.model.MPAttributeLookup;
import org.compiere.swing.CLabel;
import org.compiere.util.CLogger;
import org.compiere.util.DisplayType;
/**
* Factory for VEditor and its Label for single Row display and multi row-editor
*
* @see VCellRenderer for multi-row display
* @author Jorg Janke
* @author Jorg Janked
* @version $Id: VEditorFactory.java,v 1.3 2006/07/30 00:51:28 jjanke Exp $
*/
public class VEditorFactory
@ -87,6 +94,9 @@ public class VEditorFactory
mField.getVFormat(), mField.getObscureType());
vs.setName (columnName);
vs.setField (mField);
if (mField.isAutocomplete()) {
ADempiereAutoCompleteDecorator.decorate(vs, mField.getEntries(), false);
}
editor = vs;
}
}
@ -318,5 +328,6 @@ public class VEditorFactory
/** Logger */
private static CLogger log = CLogger.getCLogger(VEditorFactory.class);
} // VEditorFactory

View File

@ -1,6 +1,6 @@
-- 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 (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','D','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)

View File

@ -0,0 +1,269 @@
-- Jun 26, 2008 12:37:51 PM CEST
-- FR[ 2003044 ] Autocomplete for Textfields - kthiemann@adempiere.org
INSERT INTO AD_Element (AD_Org_ID,UpdatedBy,Updated,PrintName,Name,IsActive,Help,EntityType,Description,CreatedBy,Created,ColumnName,AD_Element_ID,AD_Client_ID) VALUES (0,100,TO_DATE('2008-06-26 12:37:50','YYYY-MM-DD HH24:MI:SS'),'Autocomplete','Autocomplete','Y','The autocompletion uses all existing values (from the same client and organization) of the field.','D','Automatic completion for textfields',100,TO_DATE('2008-06-26 12:37:50','YYYY-MM-DD HH24:MI:SS'),'IsAutocomplete',53655,0)
;
-- Jun 26, 2008 12:37:51 PM CEST
-- FR[ 2003044 ] Autocomplete for Textfields - kthiemann@adempiere.org
INSERT INTO AD_Element_Trl (AD_Language,AD_Element_ID, PrintName,PO_PrintName,PO_Name,PO_Help,PO_Description,Name,Help,Description, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Element_ID, t.PrintName,t.PO_PrintName,t.PO_Name,t.PO_Help,t.PO_Description,t.Name,t.Help,t.Description, '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=53655 AND EXISTS (SELECT * FROM AD_Element_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Element_ID!=t.AD_Element_ID)
;
-- Jun 26, 2008 12:37:59 PM CEST
-- FR[ 2003044 ] Autocomplete for Textfields - kthiemann@adempiere.org
UPDATE AD_Element SET EntityType='D',Updated=TO_DATE('2008-06-26 12:37:59','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Element_ID=53655
;
-- Jun 26, 2008 12:37:59 PM CEST
-- FR[ 2003044 ] Autocomplete for Textfields - kthiemann@adempiere.org
UPDATE AD_Column SET ColumnName='IsAutocomplete', Name='Autocomplete', Description='Automatic completion for textfields', Help='The autocompletion uses all existing values (from the same client and organization) of the field.' WHERE AD_Element_ID=53655
;
-- Jun 26, 2008 12:37:59 PM CEST
-- FR[ 2003044 ] Autocomplete for Textfields - kthiemann@adempiere.org
UPDATE AD_Field SET Name='Autocomplete', Description='Automatic completion for textfields', Help='The autocompletion uses all existing values (from the same client and organization) of the field.' WHERE AD_Column_ID IN (SELECT AD_Column_ID FROM AD_Column WHERE AD_Element_ID=53655) AND IsCentrallyMaintained='Y'
;
-- Jun 26, 2008 12:37:59 PM CEST
-- FR[ 2003044 ] Autocomplete for Textfields - kthiemann@adempiere.org
UPDATE AD_Process_Para SET ColumnName='IsAutocomplete', Name='Autocomplete', Description='Automatic completion for textfields', Help='The autocompletion uses all existing values (from the same client and organization) of the field.', AD_Element_ID=53655 WHERE UPPER(ColumnName)='ISAUTOCOMPLETE' AND IsCentrallyMaintained='Y' AND AD_Element_ID IS NULL
;
-- Jun 26, 2008 12:38:00 PM CEST
-- FR[ 2003044 ] Autocomplete for Textfields - kthiemann@adempiere.org
UPDATE AD_Process_Para SET ColumnName='IsAutocomplete', Name='Autocomplete', Description='Automatic completion for textfields', Help='The autocompletion uses all existing values (from the same client and organization) of the field.' WHERE AD_Element_ID=53655 AND IsCentrallyMaintained='Y'
;
-- Jun 26, 2008 12:38:00 PM CEST
-- FR[ 2003044 ] Autocomplete for Textfields - kthiemann@adempiere.org
UPDATE AD_PrintFormatItem pi SET PrintName='Autocomplete', Name='Autocomplete' WHERE IsCentrallyMaintained='Y' AND EXISTS (SELECT * FROM AD_Column c WHERE c.AD_Column_ID=pi.AD_Column_ID AND c.AD_Element_ID=53655)
;
-- Jun 26, 2008 12:38:00 PM CEST
-- FR[ 2003044 ] Autocomplete for Textfields - kthiemann@adempiere.org
UPDATE AD_PrintFormatItem pi SET PrintName='Autocomplete', Name='Autocomplete' WHERE IsCentrallyMaintained='Y' AND EXISTS (SELECT * FROM AD_Column c WHERE c.AD_Column_ID=pi.AD_Column_ID AND c.AD_Element_ID=53655)
;
-- Jun 26, 2008 12:39:11 PM CEST
-- FR[ 2003044 ] Autocomplete for Textfields - kthiemann@adempiere.org
INSERT INTO AD_Column (AD_Org_ID,Version,UpdatedBy,Updated,SeqNo,Name,IsUpdateable,IsTranslated,IsSyncDatabase,IsSelectionColumn,IsParent,IsMandatory,IsKey,IsIdentifier,IsEncrypted,IsAlwaysUpdateable,IsActive,Help,FieldLength,EntityType,Description,DefaultValue,CreatedBy,Created,ColumnName,AD_Table_ID,AD_Reference_ID,AD_Element_ID,AD_Column_ID,AD_Client_ID) VALUES (0,0,100,TO_DATE('2008-06-26 12:39:10','YYYY-MM-DD HH24:MI:SS'),0,'Autocomplete','Y','N','N','N','N','Y','N','N','N','N','Y','The autocompletion uses all existing values (from the same client and organization) of the field.',1,'D','Automatic completion for textfields','N',100,TO_DATE('2008-06-26 12:39:10','YYYY-MM-DD HH24:MI:SS'),'IsAutocomplete',101,20,53655,56149,0)
;
-- Jun 26, 2008 12:39:11 PM CEST
-- FR[ 2003044 ] Autocomplete for Textfields - kthiemann@adempiere.org
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=56149 AND EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Column_ID!=t.AD_Column_ID)
;
-- Jun 26, 2008 12:39:16 PM CEST
-- FR[ 2003044 ] Autocomplete for Textfields - kthiemann@adempiere.org
UPDATE AD_Column SET EntityType='D',Updated=TO_DATE('2008-06-26 12:39:16','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=56149
;
-- Jun 26, 2008 12:39:22 PM CEST
-- FR[ 2003044 ] Autocomplete for Textfields - kthiemann@adempiere.org
ALTER TABLE AD_Column ADD IsAutocomplete CHAR(1) DEFAULT 'N' CHECK (IsAutocomplete IN ('Y','N')) NOT NULL
;
-- Jun 26, 2008 12:40:30 PM CEST
-- FR[ 2003044 ] Autocomplete for Textfields - kthiemann@adempiere.org
INSERT INTO AD_Field (AD_Column_ID,AD_Org_ID,UpdatedBy,Updated,Name,IsSameLine,IsReadOnly,IsHeading,IsFieldOnly,IsEncrypted,IsDisplayed,IsCentrallyMaintained,IsActive,Help,EntityType,DisplayLength,Description,CreatedBy,Created,AD_Tab_ID,AD_Field_ID,AD_Client_ID) VALUES (56149,0,100,TO_DATE('2008-06-26 12:40:30','YYYY-MM-DD HH24:MI:SS'),'Autocomplete','N','N','N','N','N','Y','Y','Y','The autocompletion uses all existing values (from the same client and organization) of the field.','D',1,'Automatic completion for textfields',100,TO_DATE('2008-06-26 12:40:30','YYYY-MM-DD HH24:MI:SS'),101,56279,0)
;
-- Jun 26, 2008 12:40:31 PM CEST
-- FR[ 2003044 ] Autocomplete for Textfields - kthiemann@adempiere.org
INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Name,Help,Description, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Name,t.Help,t.Description, '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=56279 AND EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Field_ID!=t.AD_Field_ID)
;
-- Jun 26, 2008 12:52:59 PM CEST
-- FR[ 2003044 ] Autocomplete for Textfields - kthiemann@adempiere.org
UPDATE AD_Field SET SeqNo=160,IsDisplayed='Y' WHERE AD_Field_ID=56279
;
-- Jun 26, 2008 12:52:59 PM CEST
-- FR[ 2003044 ] Autocomplete for Textfields - kthiemann@adempiere.org
UPDATE AD_Field SET SeqNo=170,IsDisplayed='Y' WHERE AD_Field_ID=2526
;
-- Jun 26, 2008 12:52:59 PM CEST
-- FR[ 2003044 ] Autocomplete for Textfields - kthiemann@adempiere.org
UPDATE AD_Field SET SeqNo=180,IsDisplayed='Y' WHERE AD_Field_ID=171
;
-- Jun 26, 2008 12:52:59 PM CEST
-- FR[ 2003044 ] Autocomplete for Textfields - kthiemann@adempiere.org
UPDATE AD_Field SET SeqNo=190,IsDisplayed='Y' WHERE AD_Field_ID=54403
;
-- Jun 26, 2008 12:52:59 PM CEST
-- FR[ 2003044 ] Autocomplete for Textfields - kthiemann@adempiere.org
UPDATE AD_Field SET SeqNo=200,IsDisplayed='Y' WHERE AD_Field_ID=2574
;
-- Jun 26, 2008 12:52:59 PM CEST
-- FR[ 2003044 ] Autocomplete for Textfields - kthiemann@adempiere.org
UPDATE AD_Field SET SeqNo=210,IsDisplayed='Y' WHERE AD_Field_ID=2573
;
-- Jun 26, 2008 12:52:59 PM CEST
-- FR[ 2003044 ] Autocomplete for Textfields - kthiemann@adempiere.org
UPDATE AD_Field SET SeqNo=220,IsDisplayed='Y' WHERE AD_Field_ID=160
;
-- Jun 26, 2008 12:52:59 PM CEST
-- FR[ 2003044 ] Autocomplete for Textfields - kthiemann@adempiere.org
UPDATE AD_Field SET SeqNo=230,IsDisplayed='Y' WHERE AD_Field_ID=161
;
-- Jun 26, 2008 12:52:59 PM CEST
-- FR[ 2003044 ] Autocomplete for Textfields - kthiemann@adempiere.org
UPDATE AD_Field SET SeqNo=240,IsDisplayed='Y' WHERE AD_Field_ID=162
;
-- Jun 26, 2008 12:52:59 PM CEST
-- FR[ 2003044 ] Autocomplete for Textfields - kthiemann@adempiere.org
UPDATE AD_Field SET SeqNo=250,IsDisplayed='Y' WHERE AD_Field_ID=166
;
-- Jun 26, 2008 12:52:59 PM CEST
-- FR[ 2003044 ] Autocomplete for Textfields - kthiemann@adempiere.org
UPDATE AD_Field SET SeqNo=260,IsDisplayed='Y' WHERE AD_Field_ID=2370
;
-- Jun 26, 2008 12:52:59 PM CEST
-- FR[ 2003044 ] Autocomplete for Textfields - kthiemann@adempiere.org
UPDATE AD_Field SET SeqNo=270,IsDisplayed='Y' WHERE AD_Field_ID=169
;
-- Jun 26, 2008 12:52:59 PM CEST
-- FR[ 2003044 ] Autocomplete for Textfields - kthiemann@adempiere.org
UPDATE AD_Field SET SeqNo=280,IsDisplayed='Y' WHERE AD_Field_ID=10128
;
-- Jun 26, 2008 12:52:59 PM CEST
-- FR[ 2003044 ] Autocomplete for Textfields - kthiemann@adempiere.org
UPDATE AD_Field SET SeqNo=290,IsDisplayed='Y' WHERE AD_Field_ID=4941
;
-- Jun 26, 2008 12:52:59 PM CEST
-- FR[ 2003044 ] Autocomplete for Textfields - kthiemann@adempiere.org
UPDATE AD_Field SET SeqNo=300,IsDisplayed='Y' WHERE AD_Field_ID=50188
;
-- Jun 26, 2008 12:52:59 PM CEST
-- FR[ 2003044 ] Autocomplete for Textfields - kthiemann@adempiere.org
UPDATE AD_Field SET SeqNo=310,IsDisplayed='Y' WHERE AD_Field_ID=168
;
-- Jun 26, 2008 12:53:00 PM CEST
-- FR[ 2003044 ] Autocomplete for Textfields - kthiemann@adempiere.org
UPDATE AD_Field SET SeqNo=320,IsDisplayed='Y' WHERE AD_Field_ID=159
;
-- Jun 26, 2008 12:53:00 PM CEST
-- FR[ 2003044 ] Autocomplete for Textfields - kthiemann@adempiere.org
UPDATE AD_Field SET SeqNo=330,IsDisplayed='Y' WHERE AD_Field_ID=825
;
-- Jun 26, 2008 12:53:00 PM CEST
-- FR[ 2003044 ] Autocomplete for Textfields - kthiemann@adempiere.org
UPDATE AD_Field SET SeqNo=340,IsDisplayed='Y' WHERE AD_Field_ID=4940
;
-- Jun 26, 2008 12:53:00 PM CEST
-- FR[ 2003044 ] Autocomplete for Textfields - kthiemann@adempiere.org
UPDATE AD_Field SET SeqNo=350,IsDisplayed='Y' WHERE AD_Field_ID=167
;
-- Jun 26, 2008 12:53:00 PM CEST
-- FR[ 2003044 ] Autocomplete for Textfields - kthiemann@adempiere.org
UPDATE AD_Field SET SeqNo=360,IsDisplayed='Y' WHERE AD_Field_ID=5121
;
-- Jun 26, 2008 12:53:00 PM CEST
-- FR[ 2003044 ] Autocomplete for Textfields - kthiemann@adempiere.org
UPDATE AD_Field SET SeqNo=370,IsDisplayed='Y' WHERE AD_Field_ID=5122
;
-- Jun 26, 2008 12:53:41 PM CEST
-- FR[ 2003044 ] Autocomplete for Textfields - kthiemann@adempiere.org
UPDATE AD_Field SET IsSameLine='Y', DisplayLogic='@AD_Reference_ID@=10',Updated=TO_DATE('2008-06-26 12:53:41','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=56279
;
-- Jul 29, 2008 12:51:57 PM COT
UPDATE AD_Field SET SeqNo=380,Updated=TO_DATE('2008-07-29 12:51:57','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=5122
;
drop view AD_FIELD_V;
CREATE OR REPLACE VIEW AD_FIELD_V
(AD_WINDOW_ID, AD_TAB_ID, AD_FIELD_ID, AD_TABLE_ID, AD_COLUMN_ID, NAME, DESCRIPTION, HELP, ISDISPLAYED,
DISPLAYLOGIC, DISPLAYLENGTH, SEQNO, SORTNO, ISSAMELINE, ISHEADING, ISFIELDONLY, ISREADONLY, ISENCRYPTEDFIELD,
OBSCURETYPE, COLUMNNAME, COLUMNSQL, FIELDLENGTH, VFORMAT, DEFAULTVALUE, ISKEY, ISPARENT, ISMANDATORY, ISIDENTIFIER,
ISTRANSLATED, AD_REFERENCE_VALUE_ID, CALLOUT, AD_REFERENCE_ID, AD_VAL_RULE_ID, AD_PROCESS_ID, ISALWAYSUPDATEABLE,
READONLYLOGIC, MANDATORYLOGIC, ISUPDATEABLE, ISENCRYPTEDCOLUMN, ISSELECTIONCOLUMN, TABLENAME, VALUEMIN, VALUEMAX,
FIELDGROUP, VALIDATIONCODE, INCLUDED_TAB_ID, FIELDGROUPTYPE, ISCOLLAPSEDBYDEFAULT, INFOFACTORYCLASS, ISAUTOCOMPLETE) 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, COALESCE(f.AD_Reference_Value_ID, c.AD_Reference_Value_ID) AS AD_Reference_Value_ID,
c.Callout, COALESCE(f.AD_Reference_ID, c.AD_Reference_ID) AS AD_Reference_ID,
COALESCE(f.AD_Val_Rule_ID, c.AD_Val_Rule_ID) AS 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, fg.IsCollapsedByDefault,
COALESCE(f.InfoFactoryClass, c.InfoFactoryClass) as InfoFactoryClass,
c.IsAutocomplete
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 (vr.AD_Val_Rule_ID = COALESCE(f.AD_Val_Rule_ID, c.AD_Val_Rule_ID))
WHERE f.IsActive = 'Y'
AND c.IsActive = 'Y';
drop view AD_FIELD_VT;
CREATE OR REPLACE VIEW AD_FIELD_VT (AD_LANGUAGE, AD_WINDOW_ID, AD_TAB_ID, AD_FIELD_ID, AD_TABLE_ID,
AD_COLUMN_ID, NAME, DESCRIPTION, HELP, ISDISPLAYED, DISPLAYLOGIC, DISPLAYLENGTH, SEQNO, SORTNO, ISSAMELINE,
ISHEADING, ISFIELDONLY, ISREADONLY, ISENCRYPTEDFIELD, OBSCURETYPE, COLUMNNAME, COLUMNSQL, FIELDLENGTH, VFORMAT,
DEFAULTVALUE, ISKEY, ISPARENT, ISMANDATORY, ISIDENTIFIER, ISTRANSLATED, AD_REFERENCE_VALUE_ID, CALLOUT,
AD_REFERENCE_ID, AD_VAL_RULE_ID, AD_PROCESS_ID, ISALWAYSUPDATEABLE, READONLYLOGIC, MANDATORYLOGIC, ISUPDATEABLE,
ISENCRYPTEDCOLUMN, ISSELECTIONCOLUMN, TABLENAME, VALUEMIN, VALUEMAX, FIELDGROUP, VALIDATIONCODE, INCLUDED_TAB_ID,
FIELDGROUPTYPE, ISCOLLAPSEDBYDEFAULT, INFOFACTORYCLASS, ISAUTOCOMPLETE) 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, COALESCE(f.AD_Reference_Value_ID, c.AD_Reference_Value_ID) AS AD_Reference_Value_ID,
c.Callout, COALESCE(f.AD_Reference_ID, c.AD_Reference_ID) AS AD_Reference_ID,
COALESCE(f.AD_Val_Rule_ID, c.AD_Val_Rule_ID) as 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, fg.IsCollapsedByDefault,
COALESCE(f.InfoFactoryClass, c.InfoFactoryClass) as InfoFactoryClass,
c.IsAutocomplete
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 (vr.AD_Val_Rule_ID=COALESCE(f.AD_Val_Rule_ID, c.AD_Val_Rule_ID))
WHERE f.IsActive = 'Y'
AND c.IsActive = 'Y';

View File

@ -1,6 +1,6 @@
-- 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 (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','D','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)

View File

@ -0,0 +1,241 @@
-- Jun 26, 2008 12:37:51 PM CEST
-- FR[ 2003044 ] Autocomplete for Textfields - kthiemann@adempiere.org
INSERT INTO AD_Element (AD_Org_ID,UpdatedBy,Updated,PrintName,Name,IsActive,Help,EntityType,Description,CreatedBy,Created,ColumnName,AD_Element_ID,AD_Client_ID) VALUES (0,100,TO_TIMESTAMP('2008-06-26 12:37:50','YYYY-MM-DD HH24:MI:SS'),'Autocomplete','Autocomplete','Y','The autocompletion uses all existing values (from the same client and organization) of the field.','D','Automatic completion for textfields',100,TO_TIMESTAMP('2008-06-26 12:37:50','YYYY-MM-DD HH24:MI:SS'),'IsAutocomplete',53655,0)
;
-- Jun 26, 2008 12:37:52 PM CEST
-- FR[ 2003044 ] Autocomplete for Textfields - kthiemann@adempiere.org
INSERT INTO AD_Element_Trl (AD_Language,AD_Element_ID, PrintName,PO_PrintName,PO_Name,PO_Help,PO_Description,Name,Help,Description, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Element_ID, t.PrintName,t.PO_PrintName,t.PO_Name,t.PO_Help,t.PO_Description,t.Name,t.Help,t.Description, '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=53655 AND EXISTS (SELECT * FROM AD_Element_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Element_ID!=t.AD_Element_ID)
;
-- Jun 26, 2008 12:37:59 PM CEST
-- FR[ 2003044 ] Autocomplete for Textfields - kthiemann@adempiere.org
UPDATE AD_Element SET EntityType='D',Updated=TO_TIMESTAMP('2008-06-26 12:37:59','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Element_ID=53655
;
-- Jun 26, 2008 12:37:59 PM CEST
-- FR[ 2003044 ] Autocomplete for Textfields - kthiemann@adempiere.org
UPDATE AD_Column SET ColumnName='IsAutocomplete', Name='Autocomplete', Description='Automatic completion for textfields', Help='The autocompletion uses all existing values (from the same client and organization) of the field.' WHERE AD_Element_ID=53655
;
-- Jun 26, 2008 12:37:59 PM CEST
-- FR[ 2003044 ] Autocomplete for Textfields - kthiemann@adempiere.org
UPDATE AD_Field SET Name='Autocomplete', Description='Automatic completion for textfields', Help='The autocompletion uses all existing values (from the same client and organization) of the field.' WHERE AD_Column_ID IN (SELECT AD_Column_ID FROM AD_Column WHERE AD_Element_ID=53655) AND IsCentrallyMaintained='Y'
;
-- Jun 26, 2008 12:37:59 PM CEST
-- FR[ 2003044 ] Autocomplete for Textfields - kthiemann@adempiere.org
UPDATE AD_Process_Para SET ColumnName='IsAutocomplete', Name='Autocomplete', Description='Automatic completion for textfields', Help='The autocompletion uses all existing values (from the same client and organization) of the field.', AD_Element_ID=53655 WHERE UPPER(ColumnName)='ISAUTOCOMPLETE' AND IsCentrallyMaintained='Y' AND AD_Element_ID IS NULL
;
-- Jun 26, 2008 12:38:00 PM CEST
-- FR[ 2003044 ] Autocomplete for Textfields - kthiemann@adempiere.org
UPDATE AD_Process_Para SET ColumnName='IsAutocomplete', Name='Autocomplete', Description='Automatic completion for textfields', Help='The autocompletion uses all existing values (from the same client and organization) of the field.' WHERE AD_Element_ID=53655 AND IsCentrallyMaintained='Y'
;
-- Jun 26, 2008 12:38:00 PM CEST
-- FR[ 2003044 ] Autocomplete for Textfields - kthiemann@adempiere.org
UPDATE AD_PrintFormatItem SET PrintName='Autocomplete', Name='Autocomplete' WHERE IsCentrallyMaintained='Y' AND EXISTS (SELECT * FROM AD_Column c WHERE c.AD_Column_ID=AD_PrintFormatItem.AD_Column_ID AND c.AD_Element_ID=53655)
;
-- Jun 26, 2008 12:38:00 PM CEST
-- FR[ 2003044 ] Autocomplete for Textfields - kthiemann@adempiere.org
UPDATE AD_PrintFormatItem SET PrintName='Autocomplete', Name='Autocomplete' WHERE IsCentrallyMaintained='Y' AND EXISTS (SELECT * FROM AD_Column c WHERE c.AD_Column_ID=AD_PrintFormatItem.AD_Column_ID AND c.AD_Element_ID=53655)
;
-- Jun 26, 2008 12:39:11 PM CEST
-- FR[ 2003044 ] Autocomplete for Textfields - kthiemann@adempiere.org
INSERT INTO AD_Column (AD_Org_ID,Version,UpdatedBy,Updated,SeqNo,Name,IsUpdateable,IsTranslated,IsSyncDatabase,IsSelectionColumn,IsParent,IsMandatory,IsKey,IsIdentifier,IsEncrypted,IsAlwaysUpdateable,IsActive,Help,FieldLength,EntityType,Description,DefaultValue,CreatedBy,Created,ColumnName,AD_Table_ID,AD_Reference_ID,AD_Element_ID,AD_Column_ID,AD_Client_ID) VALUES (0,0,100,TO_TIMESTAMP('2008-06-26 12:39:10','YYYY-MM-DD HH24:MI:SS'),0,'Autocomplete','Y','N','N','N','N','Y','N','N','N','N','Y','The autocompletion uses all existing values (from the same client and organization) of the field.',1,'D','Automatic completion for textfields','N',100,TO_TIMESTAMP('2008-06-26 12:39:10','YYYY-MM-DD HH24:MI:SS'),'IsAutocomplete',101,20,53655,56149,0)
;
-- Jun 26, 2008 12:39:11 PM CEST
-- FR[ 2003044 ] Autocomplete for Textfields - kthiemann@adempiere.org
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=56149 AND EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Column_ID!=t.AD_Column_ID)
;
-- Jun 26, 2008 12:39:16 PM CEST
-- FR[ 2003044 ] Autocomplete for Textfields - kthiemann@adempiere.org
UPDATE AD_Column SET EntityType='D',Updated=TO_TIMESTAMP('2008-06-26 12:39:16','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=56149
;
-- Jun 26, 2008 12:39:22 PM CEST
-- FR[ 2003044 ] Autocomplete for Textfields - kthiemann@adempiere.org
ALTER TABLE AD_Column ADD COLUMN IsAutocomplete CHAR(1) DEFAULT 'N' CHECK (IsAutocomplete IN ('Y','N')) NOT NULL
;
-- Jun 26, 2008 12:40:30 PM CEST
-- FR[ 2003044 ] Autocomplete for Textfields - kthiemann@adempiere.org
INSERT INTO AD_Field (AD_Column_ID,AD_Org_ID,UpdatedBy,Updated,Name,IsSameLine,IsReadOnly,IsHeading,IsFieldOnly,IsEncrypted,IsDisplayed,IsCentrallyMaintained,IsActive,Help,EntityType,DisplayLength,Description,CreatedBy,Created,AD_Tab_ID,AD_Field_ID,AD_Client_ID) VALUES (56149,0,100,TO_TIMESTAMP('2008-06-26 12:40:30','YYYY-MM-DD HH24:MI:SS'),'Autocomplete','N','N','N','N','N','Y','Y','Y','The autocompletion uses all existing values (from the same client and organization) of the field.','D',1,'Automatic completion for textfields',100,TO_TIMESTAMP('2008-06-26 12:40:30','YYYY-MM-DD HH24:MI:SS'),101,56279,0)
;
-- Jun 26, 2008 12:40:31 PM CEST
-- FR[ 2003044 ] Autocomplete for Textfields - kthiemann@adempiere.org
INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Name,Help,Description, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Name,t.Help,t.Description, '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=56279 AND EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Field_ID!=t.AD_Field_ID)
;
-- Jun 26, 2008 12:52:59 PM CEST
-- FR[ 2003044 ] Autocomplete for Textfields - kthiemann@adempiere.org
UPDATE AD_Field SET SeqNo=160,IsDisplayed='Y' WHERE AD_Field_ID=56279
;
-- Jun 26, 2008 12:52:59 PM CEST
-- FR[ 2003044 ] Autocomplete for Textfields - kthiemann@adempiere.org
UPDATE AD_Field SET SeqNo=170,IsDisplayed='Y' WHERE AD_Field_ID=2526
;
-- Jun 26, 2008 12:52:59 PM CEST
-- FR[ 2003044 ] Autocomplete for Textfields - kthiemann@adempiere.org
UPDATE AD_Field SET SeqNo=180,IsDisplayed='Y' WHERE AD_Field_ID=171
;
-- Jun 26, 2008 12:52:59 PM CEST
-- FR[ 2003044 ] Autocomplete for Textfields - kthiemann@adempiere.org
UPDATE AD_Field SET SeqNo=190,IsDisplayed='Y' WHERE AD_Field_ID=54403
;
-- Jun 26, 2008 12:52:59 PM CEST
-- FR[ 2003044 ] Autocomplete for Textfields - kthiemann@adempiere.org
UPDATE AD_Field SET SeqNo=200,IsDisplayed='Y' WHERE AD_Field_ID=2574
;
-- Jun 26, 2008 12:52:59 PM CEST
-- FR[ 2003044 ] Autocomplete for Textfields - kthiemann@adempiere.org
UPDATE AD_Field SET SeqNo=210,IsDisplayed='Y' WHERE AD_Field_ID=2573
;
-- Jun 26, 2008 12:52:59 PM CEST
-- FR[ 2003044 ] Autocomplete for Textfields - kthiemann@adempiere.org
UPDATE AD_Field SET SeqNo=220,IsDisplayed='Y' WHERE AD_Field_ID=160
;
-- Jun 26, 2008 12:52:59 PM CEST
-- FR[ 2003044 ] Autocomplete for Textfields - kthiemann@adempiere.org
UPDATE AD_Field SET SeqNo=230,IsDisplayed='Y' WHERE AD_Field_ID=161
;
-- Jun 26, 2008 12:52:59 PM CEST
-- FR[ 2003044 ] Autocomplete for Textfields - kthiemann@adempiere.org
UPDATE AD_Field SET SeqNo=240,IsDisplayed='Y' WHERE AD_Field_ID=162
;
-- Jun 26, 2008 12:52:59 PM CEST
-- FR[ 2003044 ] Autocomplete for Textfields - kthiemann@adempiere.org
UPDATE AD_Field SET SeqNo=250,IsDisplayed='Y' WHERE AD_Field_ID=166
;
-- Jun 26, 2008 12:52:59 PM CEST
-- FR[ 2003044 ] Autocomplete for Textfields - kthiemann@adempiere.org
UPDATE AD_Field SET SeqNo=260,IsDisplayed='Y' WHERE AD_Field_ID=2370
;
-- Jun 26, 2008 12:52:59 PM CEST
-- FR[ 2003044 ] Autocomplete for Textfields - kthiemann@adempiere.org
UPDATE AD_Field SET SeqNo=270,IsDisplayed='Y' WHERE AD_Field_ID=169
;
-- Jun 26, 2008 12:52:59 PM CEST
-- FR[ 2003044 ] Autocomplete for Textfields - kthiemann@adempiere.org
UPDATE AD_Field SET SeqNo=280,IsDisplayed='Y' WHERE AD_Field_ID=10128
;
-- Jun 26, 2008 12:52:59 PM CEST
-- FR[ 2003044 ] Autocomplete for Textfields - kthiemann@adempiere.org
UPDATE AD_Field SET SeqNo=290,IsDisplayed='Y' WHERE AD_Field_ID=4941
;
-- Jun 26, 2008 12:52:59 PM CEST
-- FR[ 2003044 ] Autocomplete for Textfields - kthiemann@adempiere.org
UPDATE AD_Field SET SeqNo=300,IsDisplayed='Y' WHERE AD_Field_ID=50188
;
-- Jun 26, 2008 12:53:00 PM CEST
-- FR[ 2003044 ] Autocomplete for Textfields - kthiemann@adempiere.org
UPDATE AD_Field SET SeqNo=310,IsDisplayed='Y' WHERE AD_Field_ID=168
;
-- Jun 26, 2008 12:53:00 PM CEST
-- FR[ 2003044 ] Autocomplete for Textfields - kthiemann@adempiere.org
UPDATE AD_Field SET SeqNo=320,IsDisplayed='Y' WHERE AD_Field_ID=159
;
-- Jun 26, 2008 12:53:00 PM CEST
-- FR[ 2003044 ] Autocomplete for Textfields - kthiemann@adempiere.org
UPDATE AD_Field SET SeqNo=330,IsDisplayed='Y' WHERE AD_Field_ID=825
;
-- Jun 26, 2008 12:53:00 PM CEST
-- FR[ 2003044 ] Autocomplete for Textfields - kthiemann@adempiere.org
UPDATE AD_Field SET SeqNo=340,IsDisplayed='Y' WHERE AD_Field_ID=4940
;
-- Jun 26, 2008 12:53:00 PM CEST
-- FR[ 2003044 ] Autocomplete for Textfields - kthiemann@adempiere.org
UPDATE AD_Field SET SeqNo=350,IsDisplayed='Y' WHERE AD_Field_ID=167
;
-- Jun 26, 2008 12:53:00 PM CEST
-- FR[ 2003044 ] Autocomplete for Textfields - kthiemann@adempiere.org
UPDATE AD_Field SET SeqNo=360,IsDisplayed='Y' WHERE AD_Field_ID=5121
;
-- Jun 26, 2008 12:53:00 PM CEST
-- FR[ 2003044 ] Autocomplete for Textfields - kthiemann@adempiere.org
UPDATE AD_Field SET SeqNo=370,IsDisplayed='Y' WHERE AD_Field_ID=5122
;
-- Jun 26, 2008 12:53:41 PM CEST
-- FR[ 2003044 ] Autocomplete for Textfields - kthiemann@adempiere.org
UPDATE AD_Field SET IsSameLine='Y', DisplayLogic='@AD_Reference_ID@=10',Updated=TO_TIMESTAMP('2008-06-26 12:53:41','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=56279
;
-- Jul 29, 2008 12:51:57 PM COT
UPDATE AD_Field SET SeqNo=380,Updated=TO_TIMESTAMP('2008-07-29 12:51:57','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=5122
;
DROP VIEW ad_field_v;
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,
COALESCE(f.ad_reference_value_id, c.ad_reference_value_id) AS ad_reference_value_id, c.callout,
COALESCE(f.ad_reference_id, c.ad_reference_id) AS ad_reference_id,
COALESCE(f.ad_val_rule_id, c.ad_val_rule_id) AS 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, fg.iscollapsedbydefault,
COALESCE(f.infofactoryclass, c.infofactoryclass) AS infofactoryclass, c.isautocomplete
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 vr.ad_val_rule_id = COALESCE(f.ad_val_rule_id, c.ad_val_rule_id)
WHERE f.isactive = 'Y'::bpchar AND c.isactive = 'Y'::bpchar;
DROP VIEW ad_field_vt;
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,
COALESCE(f.ad_reference_value_id, c.ad_reference_value_id) AS ad_reference_value_id, c.callout, COALESCE(f.ad_reference_id, c.ad_reference_id) AS ad_reference_id,
COALESCE(f.ad_val_rule_id, c.ad_val_rule_id) AS 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, fg.iscollapsedbydefault, COALESCE(f.infofactoryclass, c.infofactoryclass) AS infofactoryclass, c.isautocomplete
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 vr.ad_val_rule_id = COALESCE(f.ad_val_rule_id, c.ad_val_rule_id)
WHERE f.isactive = 'Y'::bpchar AND c.isactive = 'Y'::bpchar;