Merge with 4df4ee104b0da4a1c67146cdd50ce05e6ab7c575
This commit is contained in:
commit
fab2a53ccd
|
@ -0,0 +1,40 @@
|
||||||
|
-- Jan 24, 2013 12:10:51 PM CET
|
||||||
|
-- IDEMPIERE 90
|
||||||
|
INSERT INTO AD_Element (AD_Client_ID,AD_Element_ID,AD_Element_UU,AD_Org_ID,ColumnName,Created,CreatedBy,Description,EntityType,Help,IsActive,Name,PrintName,Updated,UpdatedBy) VALUES (0,202202,'7d389ba2-a5c9-4a9f-a93c-a42588b6e62d',0,'IsShortList',TO_DATE('2013-01-24 12:10:49','YYYY-MM-DD HH24:MI:SS'),100,'This record is in the short list','D','The most used records could be set into the short list in order to be selected faster','Y','Short list','Short list',TO_DATE('2013-01-24 12:10:49','YYYY-MM-DD HH24:MI:SS'),100)
|
||||||
|
;
|
||||||
|
|
||||||
|
-- Jan 24, 2013 12:10:51 PM CET
|
||||||
|
-- IDEMPIERE 90
|
||||||
|
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,AD_Element_Trl_UU ) 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,Generate_UUID() FROM AD_Language l, AD_Element t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Element_ID=202202 AND NOT EXISTS (SELECT * FROM AD_Element_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Element_ID=t.AD_Element_ID)
|
||||||
|
;
|
||||||
|
|
||||||
|
-- Jan 24, 2013 12:11:24 PM CET
|
||||||
|
-- IDEMPIERE 90
|
||||||
|
INSERT INTO AD_Message (AD_Client_ID,AD_Message_ID,AD_Message_UU,AD_Org_ID,Created,CreatedBy,EntityType,IsActive,MsgText,MsgType,Updated,UpdatedBy,Value) VALUES (0,200136,'a8e26155-174f-4fdb-b575-ba4bd3fe0523',0,TO_DATE('2013-01-24 12:11:23','YYYY-MM-DD HH24:MI:SS'),100,'D','Y','All records','I',TO_DATE('2013-01-24 12:11:23','YYYY-MM-DD HH24:MI:SS'),100,'ShortListListAllItems')
|
||||||
|
;
|
||||||
|
|
||||||
|
-- Jan 24, 2013 12:11:24 PM CET
|
||||||
|
-- IDEMPIERE 90
|
||||||
|
INSERT INTO AD_Message_Trl (AD_Language,AD_Message_ID, MsgText,MsgTip, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Message_Trl_UU ) SELECT l.AD_Language,t.AD_Message_ID, t.MsgText,t.MsgTip, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Message t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Message_ID=200136 AND NOT EXISTS (SELECT * FROM AD_Message_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Message_ID=t.AD_Message_ID)
|
||||||
|
;
|
||||||
|
|
||||||
|
-- Jan 24, 2013 12:11:32 PM CET
|
||||||
|
-- IDEMPIERE 90
|
||||||
|
INSERT INTO AD_Message (AD_Client_ID,AD_Message_ID,AD_Message_UU,AD_Org_ID,Created,CreatedBy,EntityType,IsActive,MsgText,MsgType,Updated,UpdatedBy,Value) VALUES (0,200137,'eb83b9c3-95c6-4324-870b-975965aa033f',0,TO_DATE('2013-01-24 12:11:32','YYYY-MM-DD HH24:MI:SS'),100,'D','Y','Short list items','I',TO_DATE('2013-01-24 12:11:32','YYYY-MM-DD HH24:MI:SS'),100,'ShortListShortListItems')
|
||||||
|
;
|
||||||
|
|
||||||
|
-- Jan 24, 2013 12:11:32 PM CET
|
||||||
|
-- IDEMPIERE 90
|
||||||
|
INSERT INTO AD_Message_Trl (AD_Language,AD_Message_ID, MsgText,MsgTip, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Message_Trl_UU ) SELECT l.AD_Language,t.AD_Message_ID, t.MsgText,t.MsgTip, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Message t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Message_ID=200137 AND NOT EXISTS (SELECT * FROM AD_Message_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Message_ID=t.AD_Message_ID)
|
||||||
|
;
|
||||||
|
|
||||||
|
-- Jan 24, 2013 12:11:41 PM CET
|
||||||
|
-- IDEMPIERE 90
|
||||||
|
INSERT INTO AD_Message (AD_Client_ID,AD_Message_ID,AD_Message_UU,AD_Org_ID,Created,CreatedBy,EntityType,IsActive,MsgText,MsgType,Updated,UpdatedBy,Value) VALUES (0,200138,'ac962f08-3465-4be3-b330-ba0b4e8e388f',0,TO_DATE('2013-01-24 12:11:40','YYYY-MM-DD HH24:MI:SS'),100,'D','Y','Short list / All','I',TO_DATE('2013-01-24 12:11:40','YYYY-MM-DD HH24:MI:SS'),100,'ShortListSwitchSearchMode')
|
||||||
|
;
|
||||||
|
|
||||||
|
-- Jan 24, 2013 12:11:41 PM CET
|
||||||
|
-- IDEMPIERE 90
|
||||||
|
INSERT INTO AD_Message_Trl (AD_Language,AD_Message_ID, MsgText,MsgTip, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Message_Trl_UU ) SELECT l.AD_Language,t.AD_Message_ID, t.MsgText,t.MsgTip, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Message t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Message_ID=200138 AND NOT EXISTS (SELECT * FROM AD_Message_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Message_ID=t.AD_Message_ID)
|
||||||
|
;
|
||||||
|
|
|
@ -1,10 +1,11 @@
|
||||||
-- IDEMPIERE-294 Maintenance / Fix wrong datatype of column on DB
|
-- IDEMPIERE-294 Maintenance / Fix wrong datatype of column on DB
|
||||||
ALTER TABLE ad_broadcastmessage DROP COLUMN notification_client_id;
|
ALTER TABLE ad_broadcastmessage DROP COLUMN notification_client_id
|
||||||
;
|
;
|
||||||
|
|
||||||
ALTER TABLE ad_broadcastmessage ADD (notification_client_id NUMBER(10,0) NULL);
|
ALTER TABLE ad_broadcastmessage ADD (notification_client_id NUMBER(10,0) NULL)
|
||||||
;
|
;
|
||||||
|
|
||||||
|
|
||||||
SELECT register_migration_script('201301291717_IDEMPIERE-294.sql') FROM dual
|
SELECT register_migration_script('201301291717_IDEMPIERE-294.sql') FROM dual
|
||||||
;
|
;
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,40 @@
|
||||||
|
-- Jan 24, 2013 12:10:51 PM CET
|
||||||
|
-- IDEMPIERE 90
|
||||||
|
INSERT INTO AD_Element (AD_Client_ID,AD_Element_ID,AD_Element_UU,AD_Org_ID,ColumnName,Created,CreatedBy,Description,EntityType,Help,IsActive,Name,PrintName,Updated,UpdatedBy) VALUES (0,202202,'7d389ba2-a5c9-4a9f-a93c-a42588b6e62d',0,'IsShortList',TO_TIMESTAMP('2013-01-24 12:10:49','YYYY-MM-DD HH24:MI:SS'),100,'This record is in the short list','D','The most used records could be set into the short list in order to be selected faster','Y','Short list','Short list',TO_TIMESTAMP('2013-01-24 12:10:49','YYYY-MM-DD HH24:MI:SS'),100)
|
||||||
|
;
|
||||||
|
|
||||||
|
-- Jan 24, 2013 12:10:51 PM CET
|
||||||
|
-- IDEMPIERE 90
|
||||||
|
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,AD_Element_Trl_UU ) 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,Generate_UUID() FROM AD_Language l, AD_Element t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Element_ID=202202 AND NOT EXISTS (SELECT * FROM AD_Element_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Element_ID=t.AD_Element_ID)
|
||||||
|
;
|
||||||
|
|
||||||
|
-- Jan 24, 2013 12:11:24 PM CET
|
||||||
|
-- IDEMPIERE 90
|
||||||
|
INSERT INTO AD_Message (AD_Client_ID,AD_Message_ID,AD_Message_UU,AD_Org_ID,Created,CreatedBy,EntityType,IsActive,MsgText,MsgType,Updated,UpdatedBy,Value) VALUES (0,200136,'a8e26155-174f-4fdb-b575-ba4bd3fe0523',0,TO_TIMESTAMP('2013-01-24 12:11:23','YYYY-MM-DD HH24:MI:SS'),100,'D','Y','All records','I',TO_TIMESTAMP('2013-01-24 12:11:23','YYYY-MM-DD HH24:MI:SS'),100,'ShortListListAllItems')
|
||||||
|
;
|
||||||
|
|
||||||
|
-- Jan 24, 2013 12:11:24 PM CET
|
||||||
|
-- IDEMPIERE 90
|
||||||
|
INSERT INTO AD_Message_Trl (AD_Language,AD_Message_ID, MsgText,MsgTip, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Message_Trl_UU ) SELECT l.AD_Language,t.AD_Message_ID, t.MsgText,t.MsgTip, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Message t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Message_ID=200136 AND NOT EXISTS (SELECT * FROM AD_Message_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Message_ID=t.AD_Message_ID)
|
||||||
|
;
|
||||||
|
|
||||||
|
-- Jan 24, 2013 12:11:32 PM CET
|
||||||
|
-- IDEMPIERE 90
|
||||||
|
INSERT INTO AD_Message (AD_Client_ID,AD_Message_ID,AD_Message_UU,AD_Org_ID,Created,CreatedBy,EntityType,IsActive,MsgText,MsgType,Updated,UpdatedBy,Value) VALUES (0,200137,'eb83b9c3-95c6-4324-870b-975965aa033f',0,TO_TIMESTAMP('2013-01-24 12:11:32','YYYY-MM-DD HH24:MI:SS'),100,'D','Y','Short list items','I',TO_TIMESTAMP('2013-01-24 12:11:32','YYYY-MM-DD HH24:MI:SS'),100,'ShortListShortListItems')
|
||||||
|
;
|
||||||
|
|
||||||
|
-- Jan 24, 2013 12:11:32 PM CET
|
||||||
|
-- IDEMPIERE 90
|
||||||
|
INSERT INTO AD_Message_Trl (AD_Language,AD_Message_ID, MsgText,MsgTip, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Message_Trl_UU ) SELECT l.AD_Language,t.AD_Message_ID, t.MsgText,t.MsgTip, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Message t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Message_ID=200137 AND NOT EXISTS (SELECT * FROM AD_Message_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Message_ID=t.AD_Message_ID)
|
||||||
|
;
|
||||||
|
|
||||||
|
-- Jan 24, 2013 12:11:41 PM CET
|
||||||
|
-- IDEMPIERE 90
|
||||||
|
INSERT INTO AD_Message (AD_Client_ID,AD_Message_ID,AD_Message_UU,AD_Org_ID,Created,CreatedBy,EntityType,IsActive,MsgText,MsgType,Updated,UpdatedBy,Value) VALUES (0,200138,'ac962f08-3465-4be3-b330-ba0b4e8e388f',0,TO_TIMESTAMP('2013-01-24 12:11:40','YYYY-MM-DD HH24:MI:SS'),100,'D','Y','Short list / All','I',TO_TIMESTAMP('2013-01-24 12:11:40','YYYY-MM-DD HH24:MI:SS'),100,'ShortListSwitchSearchMode')
|
||||||
|
;
|
||||||
|
|
||||||
|
-- Jan 24, 2013 12:11:41 PM CET
|
||||||
|
-- IDEMPIERE 90
|
||||||
|
INSERT INTO AD_Message_Trl (AD_Language,AD_Message_ID, MsgText,MsgTip, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Message_Trl_UU ) SELECT l.AD_Language,t.AD_Message_ID, t.MsgText,t.MsgTip, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Message t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Message_ID=200138 AND NOT EXISTS (SELECT * FROM AD_Message_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Message_ID=t.AD_Message_ID)
|
||||||
|
;
|
||||||
|
|
|
@ -433,14 +433,17 @@ public class ImportBankStatement extends SvrProcess
|
||||||
statement.setEndingBalance(Env.ZERO);
|
statement.setEndingBalance(Env.ZERO);
|
||||||
|
|
||||||
// Copy statement data
|
// Copy statement data
|
||||||
if (imp.getName() != null)
|
if (imp.getName() != null) {
|
||||||
{
|
|
||||||
statement.setName(imp.getName());
|
statement.setName(imp.getName());
|
||||||
}
|
}
|
||||||
if (imp.getStatementDate() != null)
|
if (imp.getStatementDate() != null) {
|
||||||
{
|
|
||||||
statement.setStatementDate(imp.getStatementDate());
|
statement.setStatementDate(imp.getStatementDate());
|
||||||
}
|
}
|
||||||
|
if (imp.getDateAcct() != null) {
|
||||||
|
statement.setDateAcct(imp.getDateAcct());
|
||||||
|
} else {
|
||||||
|
statement.setDateAcct(statement.getStatementDate());
|
||||||
|
}
|
||||||
statement.setDescription(imp.getDescription());
|
statement.setDescription(imp.getDescription());
|
||||||
statement.setEftStatementReference(imp.getEftStatementReference());
|
statement.setEftStatementReference(imp.getEftStatementReference());
|
||||||
statement.setEftStatementDate(imp.getEftStatementDate());
|
statement.setEftStatementDate(imp.getEftStatementDate());
|
||||||
|
@ -460,7 +463,7 @@ public class ImportBankStatement extends SvrProcess
|
||||||
line.setReferenceNo(imp.getReferenceNo());
|
line.setReferenceNo(imp.getReferenceNo());
|
||||||
line.setDescription(imp.getLineDescription());
|
line.setDescription(imp.getLineDescription());
|
||||||
line.setStatementLineDate(imp.getStatementLineDate());
|
line.setStatementLineDate(imp.getStatementLineDate());
|
||||||
line.setDateAcct(imp.getStatementLineDate());
|
// line.setDateAcct(imp.getStatementLineDate()); // set on beforeSave
|
||||||
line.setValutaDate(imp.getValutaDate());
|
line.setValutaDate(imp.getValutaDate());
|
||||||
line.setIsReversal(imp.isReversal());
|
line.setIsReversal(imp.isReversal());
|
||||||
line.setC_Currency_ID(imp.getC_Currency_ID());
|
line.setC_Currency_ID(imp.getC_Currency_ID());
|
||||||
|
|
|
@ -0,0 +1,77 @@
|
||||||
|
/******************************************************************************
|
||||||
|
* Product: iDempiere ERP & CRM Smart Business Solution *
|
||||||
|
* Copyright (C) Trek Global 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. *
|
||||||
|
* *
|
||||||
|
* @author Juliana Corredor, jcorredor@trekglobal.com *
|
||||||
|
* @author Carlos Ruiz *
|
||||||
|
*****************************************************************************/
|
||||||
|
package org.adempiere.util;
|
||||||
|
|
||||||
|
import java.io.BufferedWriter;
|
||||||
|
import java.io.File;
|
||||||
|
import java.io.FileOutputStream;
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.io.OutputStreamWriter;
|
||||||
|
import java.io.Writer;
|
||||||
|
import java.sql.Timestamp;
|
||||||
|
import java.text.SimpleDateFormat;
|
||||||
|
|
||||||
|
import org.compiere.util.CLogger;
|
||||||
|
import org.compiere.util.DisplayType;
|
||||||
|
import org.compiere.util.Ini;
|
||||||
|
|
||||||
|
|
||||||
|
public class LogAuthFailure {
|
||||||
|
|
||||||
|
private static FileOutputStream file = null;
|
||||||
|
private static Writer writer;
|
||||||
|
/** Logger */
|
||||||
|
private static CLogger log = CLogger.getCLogger(LogAuthFailure.class);
|
||||||
|
|
||||||
|
public LogAuthFailure() {
|
||||||
|
|
||||||
|
String path = Ini.getAdempiereHome() + File.separator + "log";
|
||||||
|
String name = path + File.separator + "AuthFailure.log";
|
||||||
|
File fileName;
|
||||||
|
try {
|
||||||
|
fileName = new File(name);
|
||||||
|
file = new FileOutputStream(fileName, true);
|
||||||
|
writer = new BufferedWriter(new OutputStreamWriter(file, "UTF8"));
|
||||||
|
} catch (IOException e) {
|
||||||
|
log.fine(e.getMessage());
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void log(String clientIP, String context, String username, String msg) {
|
||||||
|
try {
|
||||||
|
SimpleDateFormat format = DisplayType.getTimestampFormat_Default();
|
||||||
|
String dateTimeText = format.format(new Timestamp(System.currentTimeMillis()));
|
||||||
|
|
||||||
|
writer.append("[");
|
||||||
|
writer.append(dateTimeText);
|
||||||
|
writer.append("] [error] [client ");
|
||||||
|
writer.append(clientIP);
|
||||||
|
writer.append("] [context ");
|
||||||
|
writer.append(context);
|
||||||
|
writer.append("] [username ");
|
||||||
|
writer.append(username);
|
||||||
|
writer.append("] ");
|
||||||
|
writer.append(msg);
|
||||||
|
writer.append("\n");
|
||||||
|
writer.flush();
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.fine(e.getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -2392,6 +2392,8 @@ public class GridTab implements DataStatusListener, Evaluatee, Serializable
|
||||||
newRow = 0;
|
newRow = 0;
|
||||||
log.fine("Set to first Row");
|
log.fine("Set to first Row");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
m_mTable.waitLoadingForRow(newRow);
|
||||||
return newRow;
|
return newRow;
|
||||||
} // verifyRow
|
} // verifyRow
|
||||||
|
|
||||||
|
|
|
@ -1002,7 +1002,7 @@ public class GridTable extends AbstractTableModel
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
waitLoadm_sort(row);
|
waitLoadingForRow(row);
|
||||||
|
|
||||||
// empty buffer
|
// empty buffer
|
||||||
if (row >= m_sort.size())
|
if (row >= m_sort.size())
|
||||||
|
@ -1022,10 +1022,11 @@ public class GridTable extends AbstractTableModel
|
||||||
return rowData[col];
|
return rowData[col];
|
||||||
} // getValueAt
|
} // getValueAt
|
||||||
|
|
||||||
private void waitLoadm_sort(int row) {
|
public void waitLoadingForRow(int row) {
|
||||||
// need to wait for data read into buffer
|
// need to wait for data read into buffer
|
||||||
int loops = 0;
|
int loops = 0;
|
||||||
while (row >= m_sort.size() && m_loaderFuture != null && !m_loaderFuture.isDone() && loops < 15)
|
//wait for 30 seconds
|
||||||
|
while (row >= m_sort.size() && m_loaderFuture != null && !m_loaderFuture.isDone() && loops < 60)
|
||||||
{
|
{
|
||||||
log.fine("Waiting for loader row=" + row + ", size=" + m_sort.size());
|
log.fine("Waiting for loader row=" + row + ", size=" + m_sort.size());
|
||||||
try
|
try
|
||||||
|
@ -1036,6 +1037,9 @@ public class GridTable extends AbstractTableModel
|
||||||
{}
|
{}
|
||||||
loops++;
|
loops++;
|
||||||
}
|
}
|
||||||
|
if (row >= m_sort.size()) {
|
||||||
|
throw new IllegalStateException("Timeout loading row " + (row+1));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private Object[] getDataAtRow(int row)
|
private Object[] getDataAtRow(int row)
|
||||||
|
@ -1045,7 +1049,7 @@ public class GridTable extends AbstractTableModel
|
||||||
|
|
||||||
private Object[] getDataAtRow(int row, boolean fetchIfNotFound)
|
private Object[] getDataAtRow(int row, boolean fetchIfNotFound)
|
||||||
{
|
{
|
||||||
waitLoadm_sort(row);
|
waitLoadingForRow(row);
|
||||||
MSort sort = (MSort)m_sort.get(row);
|
MSort sort = (MSort)m_sort.get(row);
|
||||||
Object[] rowData = null;
|
Object[] rowData = null;
|
||||||
if (m_virtual)
|
if (m_virtual)
|
||||||
|
|
|
@ -76,6 +76,8 @@ public abstract class Lookup extends AbstractListModel
|
||||||
|
|
||||||
private boolean m_loaded;
|
private boolean m_loaded;
|
||||||
|
|
||||||
|
private boolean m_shortList; // IDEMPIERE 90
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get Display Type
|
* Get Display Type
|
||||||
* @return display type
|
* @return display type
|
||||||
|
@ -259,7 +261,7 @@ public abstract class Lookup extends AbstractListModel
|
||||||
* @param temporary save current values - restore via fillComboBox (true)
|
* @param temporary save current values - restore via fillComboBox (true)
|
||||||
*/
|
*/
|
||||||
public void fillComboBox (boolean mandatory, boolean onlyValidated,
|
public void fillComboBox (boolean mandatory, boolean onlyValidated,
|
||||||
boolean onlyActive, boolean temporary)
|
boolean onlyActive, boolean temporary, boolean shortList) // IDEMPIERE 90
|
||||||
{
|
{
|
||||||
long startTime = System.currentTimeMillis();
|
long startTime = System.currentTimeMillis();
|
||||||
m_loaded = false;
|
m_loaded = false;
|
||||||
|
@ -279,7 +281,7 @@ public abstract class Lookup extends AbstractListModel
|
||||||
p_data.clear();
|
p_data.clear();
|
||||||
|
|
||||||
// may cause delay *** The Actual Work ***
|
// may cause delay *** The Actual Work ***
|
||||||
p_data = getData (mandatory, onlyValidated, onlyActive, temporary);
|
p_data = getData (mandatory, onlyValidated, onlyActive, temporary, shortList); // IDEMPIERE 90
|
||||||
|
|
||||||
// Selected Object changed
|
// Selected Object changed
|
||||||
if (obj != m_selectedObject)
|
if (obj != m_selectedObject)
|
||||||
|
@ -335,7 +337,7 @@ public abstract class Lookup extends AbstractListModel
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (p_data != null)
|
if (p_data != null)
|
||||||
fillComboBox(isMandatory(), true, true, false);
|
fillComboBox(isMandatory(), true, true, false, false); // IDEMPIERE 90
|
||||||
} // fillComboBox
|
} // fillComboBox
|
||||||
|
|
||||||
|
|
||||||
|
@ -363,7 +365,7 @@ public abstract class Lookup extends AbstractListModel
|
||||||
* @return ArrayList
|
* @return ArrayList
|
||||||
*/
|
*/
|
||||||
public abstract ArrayList<Object> getData (boolean mandatory,
|
public abstract ArrayList<Object> getData (boolean mandatory,
|
||||||
boolean onlyValidated, boolean onlyActive, boolean temporary);
|
boolean onlyValidated, boolean onlyActive, boolean temporary, boolean shortlist); // IDEMPIERE 90
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get underlying fully qualified Table.Column Name.
|
* Get underlying fully qualified Table.Column Name.
|
||||||
|
@ -503,5 +505,16 @@ public abstract class Lookup extends AbstractListModel
|
||||||
{
|
{
|
||||||
return m_loaded;
|
return m_loaded;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// IDEMPIERE 90
|
||||||
|
public void setShortList(boolean shortlist)
|
||||||
|
{
|
||||||
|
m_shortList = shortlist;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isShortList()
|
||||||
|
{
|
||||||
|
return m_shortList;
|
||||||
|
}
|
||||||
|
// IDEMPIERE 90
|
||||||
} // Lookup
|
} // Lookup
|
||||||
|
|
|
@ -173,7 +173,7 @@ public final class MAccountLookup extends Lookup implements Serializable
|
||||||
* @return ArrayList with KeyNamePair
|
* @return ArrayList with KeyNamePair
|
||||||
*/
|
*/
|
||||||
public ArrayList<Object> getData (boolean mandatory, boolean onlyValidated,
|
public ArrayList<Object> getData (boolean mandatory, boolean onlyValidated,
|
||||||
boolean onlyActive, boolean temporary)
|
boolean onlyActive, boolean temporary, boolean isshortlist) // IDEMPIERE 90
|
||||||
{
|
{
|
||||||
ArrayList<Object> list = new ArrayList<Object>();
|
ArrayList<Object> list = new ArrayList<Object>();
|
||||||
if (!mandatory)
|
if (!mandatory)
|
||||||
|
|
|
@ -991,7 +991,7 @@ public class MBPartner extends X_C_BPartner
|
||||||
StringBuilder msgacc = new StringBuilder("p.C_BP_Group_ID=").append(getC_BP_Group_ID());
|
StringBuilder msgacc = new StringBuilder("p.C_BP_Group_ID=").append(getC_BP_Group_ID());
|
||||||
insert_Accounting("C_BP_Customer_Acct", "C_BP_Group_Acct", msgacc.toString());
|
insert_Accounting("C_BP_Customer_Acct", "C_BP_Group_Acct", msgacc.toString());
|
||||||
insert_Accounting("C_BP_Vendor_Acct", "C_BP_Group_Acct",msgacc.toString());
|
insert_Accounting("C_BP_Vendor_Acct", "C_BP_Group_Acct",msgacc.toString());
|
||||||
insert_Accounting("C_BP_Employee_Acct", "C_AcctSchema_Default", null);
|
// insert_Accounting("C_BP_Employee_Acct", "C_AcctSchema_Default", null);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Value/Name change
|
// Value/Name change
|
||||||
|
|
|
@ -100,6 +100,7 @@ public class MBankStatement extends X_C_BankStatement implements DocAction
|
||||||
setClientOrg(account);
|
setClientOrg(account);
|
||||||
setC_BankAccount_ID(account.getC_BankAccount_ID());
|
setC_BankAccount_ID(account.getC_BankAccount_ID());
|
||||||
setStatementDate(new Timestamp(System.currentTimeMillis()));
|
setStatementDate(new Timestamp(System.currentTimeMillis()));
|
||||||
|
setDateAcct(new Timestamp(System.currentTimeMillis()));
|
||||||
setBeginningBalance(account.getCurrentBalance());
|
setBeginningBalance(account.getCurrentBalance());
|
||||||
setName(getStatementDate().toString());
|
setName(getStatementDate().toString());
|
||||||
setIsManual(isManual);
|
setIsManual(isManual);
|
||||||
|
|
|
@ -144,7 +144,7 @@ public final class MLocationLookup extends Lookup
|
||||||
* @param temporary force load for temporary display
|
* @param temporary force load for temporary display
|
||||||
* @return null
|
* @return null
|
||||||
*/
|
*/
|
||||||
public ArrayList<Object> getData (boolean mandatory, boolean onlyValidated, boolean onlyActive, boolean temporary)
|
public ArrayList<Object> getData (boolean mandatory, boolean onlyValidated, boolean onlyActive, boolean temporary, boolean shortlist) // IDEMPIERE 90
|
||||||
{
|
{
|
||||||
log.log(Level.SEVERE, "not implemented");
|
log.log(Level.SEVERE, "not implemented");
|
||||||
return null;
|
return null;
|
||||||
|
|
|
@ -414,7 +414,7 @@ public final class MLocatorLookup extends Lookup implements Serializable
|
||||||
* @param temporary force load for temporary display
|
* @param temporary force load for temporary display
|
||||||
* @return ArrayList of lookup values
|
* @return ArrayList of lookup values
|
||||||
*/
|
*/
|
||||||
public ArrayList<Object> getData (boolean mandatory, boolean onlyValidated, boolean onlyActive, boolean temporary)
|
public ArrayList<Object> getData (boolean mandatory, boolean onlyValidated, boolean onlyActive, boolean temporary, boolean shortlist) // IDEMPIERE 90
|
||||||
{
|
{
|
||||||
// create list
|
// create list
|
||||||
Collection<MLocator> collection = getData();
|
Collection<MLocator> collection = getData();
|
||||||
|
|
|
@ -103,7 +103,6 @@ public final class MLookup extends Lookup implements Serializable
|
||||||
/** Indicator for Null */
|
/** Indicator for Null */
|
||||||
private static Integer MINUS_ONE = new Integer(-1);
|
private static Integer MINUS_ONE = new Integer(-1);
|
||||||
|
|
||||||
|
|
||||||
/** The Lookup Info Value Object */
|
/** The Lookup Info Value Object */
|
||||||
private MLookupInfo m_info = null;
|
private MLookupInfo m_info = null;
|
||||||
|
|
||||||
|
@ -122,7 +121,14 @@ public final class MLookup extends Lookup implements Serializable
|
||||||
private boolean m_refreshing = false;
|
private boolean m_refreshing = false;
|
||||||
/** Next Read for Parent */
|
/** Next Read for Parent */
|
||||||
private long m_nextRead = 0;
|
private long m_nextRead = 0;
|
||||||
|
|
||||||
|
/** Not in short List item Marker Start IDEMPIERE 90 */
|
||||||
|
public static final String SHORTLIST_S = "*";
|
||||||
|
/** Not in short List item Marker End IDEMPIERE 90 */
|
||||||
|
public static final String SHORTLIST_E = "*";
|
||||||
|
|
||||||
|
private boolean m_hasShortListItems = false; // IDEMPIERE 90
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Dispose
|
* Dispose
|
||||||
*/
|
*/
|
||||||
|
@ -391,9 +397,10 @@ public final class MLookup extends Lookup implements Serializable
|
||||||
* @param onlyValidated only validated
|
* @param onlyValidated only validated
|
||||||
* @param onlyActive only active
|
* @param onlyActive only active
|
||||||
* @param temporary force load for temporary display
|
* @param temporary force load for temporary display
|
||||||
|
* @param isshortlist
|
||||||
* @return list
|
* @return list
|
||||||
*/
|
*/
|
||||||
public ArrayList<Object> getData (boolean mandatory, boolean onlyValidated, boolean onlyActive, boolean temporary)
|
public ArrayList<Object> getData (boolean mandatory, boolean onlyValidated, boolean onlyActive, boolean temporary, boolean shortlist) // idempiere 90
|
||||||
{
|
{
|
||||||
// create list
|
// create list
|
||||||
ArrayList<Object> list = getData (onlyValidated, true);
|
ArrayList<Object> list = getData (onlyValidated, true);
|
||||||
|
@ -414,6 +421,23 @@ public final class MLookup extends Lookup implements Serializable
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Remove non short list items IDEMPIERE 90
|
||||||
|
if (shortlist && m_hasShortListItems)
|
||||||
|
{
|
||||||
|
// list from the back
|
||||||
|
for (int i = list.size(); i > 0; i--)
|
||||||
|
{
|
||||||
|
Object o = list.get(i-1);
|
||||||
|
if (o != null)
|
||||||
|
{
|
||||||
|
String s = o.toString();
|
||||||
|
if (s.startsWith(SHORTLIST_S) && s.endsWith(SHORTLIST_E))
|
||||||
|
list.remove(i-1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// End Remove non short list items IDEMPIERE 90
|
||||||
|
|
||||||
// Add Optional (empty) selection
|
// Add Optional (empty) selection
|
||||||
if (!mandatory)
|
if (!mandatory)
|
||||||
{
|
{
|
||||||
|
@ -597,7 +621,7 @@ public final class MLookup extends Lookup implements Serializable
|
||||||
m_refreshing = true;
|
m_refreshing = true;
|
||||||
//force refresh
|
//force refresh
|
||||||
m_lookup.clear();
|
m_lookup.clear();
|
||||||
fillComboBox(isMandatory(), true, true, false);
|
fillComboBox(isMandatory(), true, true, false, isShortList()); // idempiere 90
|
||||||
m_refreshing = false;
|
m_refreshing = false;
|
||||||
return m_lookup.size();
|
return m_lookup.size();
|
||||||
} // refresh
|
} // refresh
|
||||||
|
@ -677,6 +701,17 @@ public final class MLookup extends Lookup implements Serializable
|
||||||
MLookupCache.loadStart (m_info);
|
MLookupCache.loadStart (m_info);
|
||||||
StringBuilder sql = new StringBuilder().append(m_info.Query);
|
StringBuilder sql = new StringBuilder().append(m_info.Query);
|
||||||
|
|
||||||
|
// IDEMPIERE 90
|
||||||
|
if (isShortList())
|
||||||
|
{
|
||||||
|
// Adding ", IsShortList" to the sql SELECT clause
|
||||||
|
int posFirstPoint = sql.indexOf(".");
|
||||||
|
String tableName = sql.substring(7, posFirstPoint);
|
||||||
|
int posFirstFrom = sql.indexOf(tableName+".IsActive FROM "+tableName) + tableName.length() + 9 ; // 9 = .IsActive
|
||||||
|
String ClauseFromWhereOrder = sql.substring(posFirstFrom, sql.length());
|
||||||
|
sql = new StringBuilder(sql.substring(0, posFirstFrom) + ", " + tableName + ".IsShortList" + ClauseFromWhereOrder);
|
||||||
|
} // IDEMPIERE 90
|
||||||
|
|
||||||
// not validated
|
// not validated
|
||||||
if (!m_info.IsValidated)
|
if (!m_info.IsValidated)
|
||||||
{
|
{
|
||||||
|
@ -768,6 +803,17 @@ public final class MLookup extends Lookup implements Serializable
|
||||||
name = new StringBuilder(INACTIVE_S).append(name).append(INACTIVE_E);
|
name = new StringBuilder(INACTIVE_S).append(name).append(INACTIVE_E);
|
||||||
m_hasInactive = true;
|
m_hasInactive = true;
|
||||||
}
|
}
|
||||||
|
// IDEMPIERE 90
|
||||||
|
if (isShortList())
|
||||||
|
{
|
||||||
|
boolean isShortListItem = rs.getString(5).equals("Y");
|
||||||
|
if (!isShortListItem)
|
||||||
|
{
|
||||||
|
name = new StringBuilder(SHORTLIST_S).append(name).append(SHORTLIST_S);
|
||||||
|
m_hasShortListItems = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// IDEMPIERE 90
|
||||||
if (isNumber)
|
if (isNumber)
|
||||||
{
|
{
|
||||||
int key = rs.getInt(1);
|
int key = rs.getInt(1);
|
||||||
|
|
|
@ -168,7 +168,7 @@ public class MPAttributeLookup extends Lookup
|
||||||
* @param temporary force load for temporary display
|
* @param temporary force load for temporary display
|
||||||
* @return null
|
* @return null
|
||||||
*/
|
*/
|
||||||
public ArrayList<Object> getData (boolean mandatory, boolean onlyValidated, boolean onlyActive, boolean temporary)
|
public ArrayList<Object> getData (boolean mandatory, boolean onlyValidated, boolean onlyActive, boolean temporary, boolean shortlist) // IDEMPIERE 90
|
||||||
{
|
{
|
||||||
log.log(Level.SEVERE, "Not implemented");
|
log.log(Level.SEVERE, "Not implemented");
|
||||||
return null;
|
return null;
|
||||||
|
|
|
@ -199,7 +199,7 @@ public class MPaymentLookup extends Lookup implements Serializable {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ArrayList<Object> getData(boolean mandatory, boolean onlyValidated,
|
public ArrayList<Object> getData(boolean mandatory, boolean onlyValidated,
|
||||||
boolean onlyActive, boolean temporary) {
|
boolean onlyActive, boolean temporary, boolean shortlist) { // IDEMPIERE 90
|
||||||
ArrayList<Object> list = new ArrayList<Object>();
|
ArrayList<Object> list = new ArrayList<Object>();
|
||||||
|
|
||||||
ValueNamePair[] values = getData();
|
ValueNamePair[] values = getData();
|
||||||
|
@ -220,7 +220,7 @@ public class MPaymentLookup extends Lookup implements Serializable {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int refresh() {
|
public int refresh() {
|
||||||
fillComboBox(isMandatory(), true, true, false);
|
fillComboBox(isMandatory(), true, true, false, false); // IDEMPIERE 90
|
||||||
return super.getSize();
|
return super.getSize();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -20,8 +20,10 @@ package org.compiere.model;
|
||||||
import java.sql.PreparedStatement;
|
import java.sql.PreparedStatement;
|
||||||
import java.sql.ResultSet;
|
import java.sql.ResultSet;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
import java.util.HashMap;
|
||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
import java.util.Properties;
|
import java.util.Properties;
|
||||||
import java.util.logging.Level;
|
import java.util.logging.Level;
|
||||||
|
|
||||||
|
@ -53,7 +55,7 @@ public class MTable extends X_AD_Table
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
private static final long serialVersionUID = 8264472455498363565L;
|
private static final long serialVersionUID = -8904670462021706436L;
|
||||||
|
|
||||||
public final static int MAX_OFFICIAL_ID = 999999;
|
public final static int MAX_OFFICIAL_ID = 999999;
|
||||||
|
|
||||||
|
@ -211,6 +213,10 @@ public class MTable extends X_AD_Table
|
||||||
|
|
||||||
/** Columns */
|
/** Columns */
|
||||||
private MColumn[] m_columns = null;
|
private MColumn[] m_columns = null;
|
||||||
|
/** column name to index map **/
|
||||||
|
private Map<String, Integer> m_columnNameMap;
|
||||||
|
/** ad_column_id to index map **/
|
||||||
|
private Map<Integer, Integer> m_columnIdMap;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get Columns
|
* Get Columns
|
||||||
|
@ -221,6 +227,8 @@ public class MTable extends X_AD_Table
|
||||||
{
|
{
|
||||||
if (m_columns != null && !requery)
|
if (m_columns != null && !requery)
|
||||||
return m_columns;
|
return m_columns;
|
||||||
|
m_columnNameMap = new HashMap<String, Integer>();
|
||||||
|
m_columnIdMap = new HashMap<Integer, Integer>();
|
||||||
String sql = "SELECT * FROM AD_Column WHERE AD_Table_ID=? ORDER BY ColumnName";
|
String sql = "SELECT * FROM AD_Column WHERE AD_Table_ID=? ORDER BY ColumnName";
|
||||||
ArrayList<MColumn> list = new ArrayList<MColumn>();
|
ArrayList<MColumn> list = new ArrayList<MColumn>();
|
||||||
PreparedStatement pstmt = null;
|
PreparedStatement pstmt = null;
|
||||||
|
@ -229,8 +237,12 @@ public class MTable extends X_AD_Table
|
||||||
pstmt = DB.prepareStatement (sql, get_TrxName());
|
pstmt = DB.prepareStatement (sql, get_TrxName());
|
||||||
pstmt.setInt (1, getAD_Table_ID());
|
pstmt.setInt (1, getAD_Table_ID());
|
||||||
ResultSet rs = pstmt.executeQuery ();
|
ResultSet rs = pstmt.executeQuery ();
|
||||||
while (rs.next ())
|
while (rs.next ()) {
|
||||||
list.add (new MColumn (getCtx(), rs, get_TrxName()));
|
MColumn column = new MColumn (getCtx(), rs, get_TrxName());
|
||||||
|
list.add (column);
|
||||||
|
m_columnNameMap.put(column.getColumnName().toUpperCase(), list.size() - 1);
|
||||||
|
m_columnIdMap.put(column.getAD_Column_ID(), list.size() - 1);
|
||||||
|
}
|
||||||
rs.close ();
|
rs.close ();
|
||||||
pstmt.close ();
|
pstmt.close ();
|
||||||
pstmt = null;
|
pstmt = null;
|
||||||
|
@ -274,6 +286,38 @@ public class MTable extends X_AD_Table
|
||||||
return null;
|
return null;
|
||||||
} // getColumn
|
} // getColumn
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get Column Index
|
||||||
|
* @param ColumnName column name
|
||||||
|
* @return index of column with ColumnName or -1 if not found
|
||||||
|
*/
|
||||||
|
public int getColumnIndex (String ColumnName)
|
||||||
|
{
|
||||||
|
if (m_columns == null)
|
||||||
|
getColumns(false);
|
||||||
|
Integer i = m_columnNameMap.get(ColumnName.toUpperCase());
|
||||||
|
if (i != null)
|
||||||
|
return i.intValue();
|
||||||
|
|
||||||
|
return -1;
|
||||||
|
} // getColumnIndex
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get Column Index
|
||||||
|
* @param AD_Column_ID column
|
||||||
|
* @return index of column with ColumnName or -1 if not found
|
||||||
|
*/
|
||||||
|
public int getColumnIndex (int AD_Column_ID)
|
||||||
|
{
|
||||||
|
if (m_columns == null)
|
||||||
|
getColumns(false);
|
||||||
|
Integer i = m_columnIdMap.get(AD_Column_ID);
|
||||||
|
if (i != null)
|
||||||
|
return i.intValue();
|
||||||
|
|
||||||
|
return -1;
|
||||||
|
} // getColumnIndex
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Table has a single Key
|
* Table has a single Key
|
||||||
* @return true if table has single key column
|
* @return true if table has single key column
|
||||||
|
|
|
@ -528,7 +528,10 @@ public class TableElement extends PrintElement
|
||||||
if (col != dataCol)
|
if (col != dataCol)
|
||||||
{
|
{
|
||||||
m_columnWidths.add(new Float(0.0)); // for the data column
|
m_columnWidths.add(new Float(0.0)); // for the data column
|
||||||
Float origWidth = (Float)m_columnWidths.get(col);
|
Float origWidth=null;
|
||||||
|
try{
|
||||||
|
origWidth = (Float)m_columnWidths.get(col);
|
||||||
|
}catch(IndexOutOfBoundsException e){}
|
||||||
if (origWidth == null)
|
if (origWidth == null)
|
||||||
log.log(Level.SEVERE, "Column " + dataCol + " below " + col + " - no value for orig width");
|
log.log(Level.SEVERE, "Column " + dataCol + " below " + col + " - no value for orig width");
|
||||||
else
|
else
|
||||||
|
|
|
@ -532,12 +532,9 @@ public class Login
|
||||||
//
|
//
|
||||||
String sql = " SELECT DISTINCT r.UserLevel, r.ConnectionProfile,o.AD_Org_ID,o.Name,o.IsSummary "
|
String sql = " SELECT DISTINCT r.UserLevel, r.ConnectionProfile,o.AD_Org_ID,o.Name,o.IsSummary "
|
||||||
+" FROM AD_Org o"
|
+" FROM AD_Org o"
|
||||||
+" INNER JOIN AD_Role_OrgAccess ra ON (ra.AD_Org_ID=o.AD_Org_ID)"
|
+" INNER JOIN AD_Role r on (r.AD_Role_ID=?)"
|
||||||
+" INNER JOIN AD_Role r on (ra.AD_Role_ID=r.AD_Role_ID) "
|
+" INNER JOIN AD_Client c on (c.AD_Client_ID=?)"
|
||||||
+" INNER JOIN AD_Client c on (ra.AD_Client_ID=c.AD_Client_ID)"
|
+" WHERE o.IsActive='Y' "
|
||||||
+" WHERE r.AD_Role_ID=?"
|
|
||||||
+" AND c.AD_Client_ID=?"
|
|
||||||
+" AND o.IsActive='Y' "
|
|
||||||
+" AND o.IsSummary='N'"
|
+" AND o.IsSummary='N'"
|
||||||
+" AND (r.IsAccessAllOrgs='Y'"
|
+" AND (r.IsAccessAllOrgs='Y'"
|
||||||
+" OR (r.IsUseUserOrgAccess='N' AND o.AD_Org_ID IN (SELECT AD_Org_ID FROM AD_Role_OrgAccess ra"
|
+" OR (r.IsUseUserOrgAccess='N' AND o.AD_Org_ID IN (SELECT AD_Org_ID FROM AD_Role_OrgAccess ra"
|
||||||
|
@ -1204,7 +1201,7 @@ public class Login
|
||||||
public KeyNamePair[] getClients(String app_user, String app_pwd) {
|
public KeyNamePair[] getClients(String app_user, String app_pwd) {
|
||||||
log.info("User=" + app_user);
|
log.info("User=" + app_user);
|
||||||
|
|
||||||
if (app_user == null)
|
if (Util.isEmpty(app_user))
|
||||||
{
|
{
|
||||||
log.warning("No Apps User");
|
log.warning("No Apps User");
|
||||||
return null;
|
return null;
|
||||||
|
|
|
@ -170,6 +170,7 @@ public class PackOut extends SvrProcess
|
||||||
packagedir += File.separator;
|
packagedir += File.separator;
|
||||||
packagename = packagedir + rs1.getString(X_AD_Package_Exp.COLUMNNAME_Name);
|
packagename = packagedir + rs1.getString(X_AD_Package_Exp.COLUMNNAME_Name);
|
||||||
includesdir = rs1.getString(X_AD_Package_Exp.COLUMNNAME_Name) + File.separator +"**";
|
includesdir = rs1.getString(X_AD_Package_Exp.COLUMNNAME_Name) + File.separator +"**";
|
||||||
|
@SuppressWarnings("unused")
|
||||||
boolean success = (new File(packagename+File.separator+"doc"+File.separator)).mkdirs();
|
boolean success = (new File(packagename+File.separator+"doc"+File.separator)).mkdirs();
|
||||||
String file_document = packagename+File.separator+"doc"+File.separator+rs1.getString(X_AD_Package_Exp.COLUMNNAME_Name)+"Doc.xml";
|
String file_document = packagename+File.separator+"doc"+File.separator+rs1.getString(X_AD_Package_Exp.COLUMNNAME_Name)+"Doc.xml";
|
||||||
packageDocStream = new FileOutputStream (file_document, false);
|
packageDocStream = new FileOutputStream (file_document, false);
|
||||||
|
@ -457,6 +458,7 @@ public class PackOut extends SvrProcess
|
||||||
File destGZipFile = new File(packagename+".tar.gz");
|
File destGZipFile = new File(packagename+".tar.gz");
|
||||||
|
|
||||||
//delete the old packages if necessary
|
//delete the old packages if necessary
|
||||||
|
@SuppressWarnings("unused")
|
||||||
boolean success = destZipFile.delete();
|
boolean success = destZipFile.delete();
|
||||||
success = destTarFile.delete();
|
success = destTarFile.delete();
|
||||||
success = destGZipFile.delete();
|
success = destGZipFile.delete();
|
||||||
|
|
|
@ -60,6 +60,7 @@ import org.compiere.util.Env;
|
||||||
public class PackRoll extends SvrProcess {
|
public class PackRoll extends SvrProcess {
|
||||||
/** Package from Record */
|
/** Package from Record */
|
||||||
private int m_AD_Package_Imp_ID = 0;
|
private int m_AD_Package_Imp_ID = 0;
|
||||||
|
@SuppressWarnings("unused")
|
||||||
private String m_Processing = null;
|
private String m_Processing = null;
|
||||||
StringBuffer sql = null;
|
StringBuffer sql = null;
|
||||||
StringBuffer sqlB = null;
|
StringBuffer sqlB = null;
|
||||||
|
@ -96,6 +97,7 @@ public class PackRoll extends SvrProcess {
|
||||||
sqlB = new StringBuffer("UPDATE AD_Package_Imp "
|
sqlB = new StringBuffer("UPDATE AD_Package_Imp "
|
||||||
+ "SET PK_Status = 'Uninstalling' "
|
+ "SET PK_Status = 'Uninstalling' "
|
||||||
+ "WHERE AD_Package_Imp_ID = " + m_AD_Package_Imp_ID);
|
+ "WHERE AD_Package_Imp_ID = " + m_AD_Package_Imp_ID);
|
||||||
|
@SuppressWarnings("unused")
|
||||||
int no = DB.executeUpdate(sqlB.toString(), get_TrxName());
|
int no = DB.executeUpdate(sqlB.toString(), get_TrxName());
|
||||||
|
|
||||||
log.info("Starting Package Reversal");
|
log.info("Starting Package Reversal");
|
||||||
|
|
|
@ -45,6 +45,7 @@ public class CodeSnipitElementHandler extends AbstractElementHandler {
|
||||||
|
|
||||||
public void startElement(Properties ctx, Element element) throws SAXException {
|
public void startElement(Properties ctx, Element element) throws SAXException {
|
||||||
String elementValue = element.getElementValue();
|
String elementValue = element.getElementValue();
|
||||||
|
@SuppressWarnings("unused")
|
||||||
int AD_Backup_ID = -1;
|
int AD_Backup_ID = -1;
|
||||||
String Object_Status = null;
|
String Object_Status = null;
|
||||||
log.info(elementValue);
|
log.info(elementValue);
|
||||||
|
@ -61,6 +62,7 @@ public class CodeSnipitElementHandler extends AbstractElementHandler {
|
||||||
int idDetail=0;
|
int idDetail=0;
|
||||||
InputStream source; // Stream for reading from the source file.
|
InputStream source; // Stream for reading from the source file.
|
||||||
OutputStream copy; // Stream for writing the copy.
|
OutputStream copy; // Stream for writing the copy.
|
||||||
|
@SuppressWarnings("unused")
|
||||||
File currentDirectory = new File(".");
|
File currentDirectory = new File(".");
|
||||||
|
|
||||||
String packagePath=null;
|
String packagePath=null;
|
||||||
|
|
|
@ -36,7 +36,6 @@ import org.adempiere.pipo.IDFinder;
|
||||||
import org.adempiere.pipo.exception.POSaveFailedException;
|
import org.adempiere.pipo.exception.POSaveFailedException;
|
||||||
import org.compiere.model.MTable;
|
import org.compiere.model.MTable;
|
||||||
import org.compiere.model.PO;
|
import org.compiere.model.PO;
|
||||||
import org.compiere.model.POInfo;
|
|
||||||
import org.compiere.model.X_AD_Package_Exp_Detail;
|
import org.compiere.model.X_AD_Package_Exp_Detail;
|
||||||
import org.compiere.util.DB;
|
import org.compiere.util.DB;
|
||||||
import org.compiere.util.Env;
|
import org.compiere.util.Env;
|
||||||
|
@ -200,13 +199,13 @@ public class DataElementHandler extends AbstractElementHandler {
|
||||||
genericPO.set_ValueOfColumn("Name", d_rowname);
|
genericPO.set_ValueOfColumn("Name", d_rowname);
|
||||||
// Set defaults.
|
// Set defaults.
|
||||||
//TODO: get defaults from configuration
|
//TODO: get defaults from configuration
|
||||||
HashMap defaults = new HashMap();
|
HashMap<Object, Object> defaults = new HashMap<Object, Object>();
|
||||||
HashMap thisDefault = (HashMap)defaults.get(d_tablename);
|
HashMap<?, ?> thisDefault = (HashMap<?, ?>)defaults.get(d_tablename);
|
||||||
if (thisDefault != null) {
|
if (thisDefault != null) {
|
||||||
Iterator iter = thisDefault.values().iterator();
|
Iterator<?> iter = thisDefault.values().iterator();
|
||||||
ArrayList thisValue = null;
|
ArrayList<?> thisValue = null;
|
||||||
while (iter.hasNext()) {
|
while (iter.hasNext()) {
|
||||||
thisValue = (ArrayList)iter.next();
|
thisValue = (ArrayList<?>)iter.next();
|
||||||
if (((String)(thisValue.get(2))).equals("String"))
|
if (((String)(thisValue.get(2))).equals("String"))
|
||||||
genericPO.set_ValueOfColumn((String)thisValue.get(0), (String)thisValue.get(1));
|
genericPO.set_ValueOfColumn((String)thisValue.get(0), (String)thisValue.get(1));
|
||||||
else if (((String)(thisValue.get(2))).equals("Integer"))
|
else if (((String)(thisValue.get(2))).equals("Integer"))
|
||||||
|
|
|
@ -40,6 +40,7 @@ public class DistFileElementHandler extends AbstractElementHandler {
|
||||||
|
|
||||||
public void startElement(Properties ctx, Element element) throws SAXException {
|
public void startElement(Properties ctx, Element element) throws SAXException {
|
||||||
String elementValue = element.getElementValue();
|
String elementValue = element.getElementValue();
|
||||||
|
@SuppressWarnings("unused")
|
||||||
int AD_Backup_ID = -1;
|
int AD_Backup_ID = -1;
|
||||||
String Object_Status = null;
|
String Object_Status = null;
|
||||||
Attributes atts = element.attributes;
|
Attributes atts = element.attributes;
|
||||||
|
|
|
@ -54,7 +54,9 @@ public class FormAccessElementHandler extends AbstractElementHandler {
|
||||||
|
|
||||||
sqlB = new StringBuffer ("SELECT count(*) FROM AD_Form_Access WHERE AD_Role_ID=? and AD_Form_ID=?");
|
sqlB = new StringBuffer ("SELECT count(*) FROM AD_Form_Access WHERE AD_Role_ID=? and AD_Form_ID=?");
|
||||||
int count = DB.getSQLValue(getTrxName(ctx),sqlB.toString(),roleid,formid);
|
int count = DB.getSQLValue(getTrxName(ctx),sqlB.toString(),roleid,formid);
|
||||||
|
@SuppressWarnings("unused")
|
||||||
String Object_Status = null;
|
String Object_Status = null;
|
||||||
|
@SuppressWarnings("unused")
|
||||||
int AD_Backup_ID = -1;
|
int AD_Backup_ID = -1;
|
||||||
if (count>0){
|
if (count>0){
|
||||||
Object_Status = "Update";
|
Object_Status = "Update";
|
||||||
|
|
|
@ -108,7 +108,7 @@ public class MenuElementHandler extends AbstractElementHandler {
|
||||||
m_Menu.setAD_Task_ID(id);
|
m_Menu.setAD_Task_ID(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
name = atts.getValue("ADWorkbenchNameID");
|
/*name = atts.getValue("ADWorkbenchNameID");
|
||||||
if (name != null && name.trim().length() > 0) {
|
if (name != null && name.trim().length() > 0) {
|
||||||
int id = get_IDWithColumn(ctx, "AD_Workbench", "Name", name);
|
int id = get_IDWithColumn(ctx, "AD_Workbench", "Name", name);
|
||||||
if (id <= 0) {
|
if (id <= 0) {
|
||||||
|
@ -116,7 +116,7 @@ public class MenuElementHandler extends AbstractElementHandler {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
m_Menu.setAD_Workbench_ID(id);
|
m_Menu.setAD_Workbench_ID(id);
|
||||||
}
|
}*/
|
||||||
|
|
||||||
name = atts.getValue("ADWorkflowNameID");
|
name = atts.getValue("ADWorkflowNameID");
|
||||||
if (name != null && name.trim().length() > 0) {
|
if (name != null && name.trim().length() > 0) {
|
||||||
|
@ -319,12 +319,12 @@ public class MenuElementHandler extends AbstractElementHandler {
|
||||||
atts.addAttribute("", "", "ADTaskNameID", "CDATA", name);
|
atts.addAttribute("", "", "ADTaskNameID", "CDATA", name);
|
||||||
} else
|
} else
|
||||||
atts.addAttribute("", "", "ADTaskNameID", "CDATA", "");
|
atts.addAttribute("", "", "ADTaskNameID", "CDATA", "");
|
||||||
if (m_Menu.getAD_Workbench_ID() > 0) {
|
/*if (m_Menu.getAD_Workbench_ID() > 0) {
|
||||||
sql = "SELECT Name FROM AD_Workbench WHERE AD_Workbench_ID=?";
|
sql = "SELECT Name FROM AD_Workbench WHERE AD_Workbench_ID=?";
|
||||||
name = DB.getSQLValueString(null, sql, m_Menu.getAD_Workbench_ID());
|
name = DB.getSQLValueString(null, sql, m_Menu.getAD_Workbench_ID());
|
||||||
atts.addAttribute("", "", "ADWorkbenchNameID", "CDATA", name);
|
atts.addAttribute("", "", "ADWorkbenchNameID", "CDATA", name);
|
||||||
} else
|
} else
|
||||||
atts.addAttribute("", "", "ADWorkbenchNameID", "CDATA", "");
|
atts.addAttribute("", "", "ADWorkbenchNameID", "CDATA", "");*/
|
||||||
if (m_Menu.getAD_Workflow_ID() > 0) {
|
if (m_Menu.getAD_Workflow_ID() > 0) {
|
||||||
sql = "SELECT Name FROM AD_Workflow WHERE AD_Workflow_ID=?";
|
sql = "SELECT Name FROM AD_Workflow WHERE AD_Workflow_ID=?";
|
||||||
name = DB.getSQLValueString(null, sql, m_Menu.getAD_Workflow_ID());
|
name = DB.getSQLValueString(null, sql, m_Menu.getAD_Workflow_ID());
|
||||||
|
|
|
@ -52,7 +52,9 @@ public class OrgRoleElementHandler extends AbstractElementHandler {
|
||||||
|
|
||||||
sqlB = new StringBuffer ("SELECT count(*) FROM AD_Role_OrgAccess WHERE AD_Role_ID=? and AD_Org_ID=?");
|
sqlB = new StringBuffer ("SELECT count(*) FROM AD_Role_OrgAccess WHERE AD_Role_ID=? and AD_Org_ID=?");
|
||||||
int count = DB.getSQLValue(getTrxName(ctx),sqlB.toString(),roleid,orgid);
|
int count = DB.getSQLValue(getTrxName(ctx),sqlB.toString(),roleid,orgid);
|
||||||
|
@SuppressWarnings("unused")
|
||||||
int AD_Backup_ID = -1;
|
int AD_Backup_ID = -1;
|
||||||
|
@SuppressWarnings("unused")
|
||||||
String Object_Status = null;
|
String Object_Status = null;
|
||||||
if (count>0){
|
if (count>0){
|
||||||
Object_Status = "Update";
|
Object_Status = "Update";
|
||||||
|
|
|
@ -54,7 +54,9 @@ public class ProcessAccessElementHandler extends AbstractElementHandler {
|
||||||
|
|
||||||
sqlB = new StringBuffer ("SELECT count(*) FROM AD_Process_Access WHERE AD_Role_ID=? and AD_Process_ID=?");
|
sqlB = new StringBuffer ("SELECT count(*) FROM AD_Process_Access WHERE AD_Role_ID=? and AD_Process_ID=?");
|
||||||
int count = DB.getSQLValue(getTrxName(ctx),sqlB.toString(),roleid,processid);
|
int count = DB.getSQLValue(getTrxName(ctx),sqlB.toString(),roleid,processid);
|
||||||
|
@SuppressWarnings("unused")
|
||||||
int AD_Backup_ID = -1;
|
int AD_Backup_ID = -1;
|
||||||
|
@SuppressWarnings("unused")
|
||||||
String Object_Status = null;
|
String Object_Status = null;
|
||||||
|
|
||||||
if (count>0){
|
if (count>0){
|
||||||
|
|
|
@ -47,6 +47,7 @@ public class ReferenceListElementHandler extends AbstractElementHandler {
|
||||||
element.skip = true;
|
element.skip = true;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@SuppressWarnings("unused")
|
||||||
String name = atts.getValue("Name");
|
String name = atts.getValue("Name");
|
||||||
String value = atts.getValue("Value");
|
String value = atts.getValue("Value");
|
||||||
int AD_Reference_ID = 0;
|
int AD_Reference_ID = 0;
|
||||||
|
|
|
@ -42,7 +42,9 @@ public class ReferenceTableElementHandler extends AbstractElementHandler {
|
||||||
public void startElement(Properties ctx, Element element)
|
public void startElement(Properties ctx, Element element)
|
||||||
throws SAXException {
|
throws SAXException {
|
||||||
String elementValue = element.getElementValue();
|
String elementValue = element.getElementValue();
|
||||||
|
@SuppressWarnings("unused")
|
||||||
int AD_Backup_ID = -1;
|
int AD_Backup_ID = -1;
|
||||||
|
@SuppressWarnings("unused")
|
||||||
String Object_Status = null;
|
String Object_Status = null;
|
||||||
|
|
||||||
log.info(elementValue);
|
log.info(elementValue);
|
||||||
|
|
|
@ -37,7 +37,9 @@ public class SQLStatementElementHandler extends AbstractElementHandler {
|
||||||
|
|
||||||
public void startElement(Properties ctx, Element element) throws SAXException {
|
public void startElement(Properties ctx, Element element) throws SAXException {
|
||||||
String elementValue = element.getElementValue();
|
String elementValue = element.getElementValue();
|
||||||
|
@SuppressWarnings("unused")
|
||||||
int AD_Backup_ID = -1;
|
int AD_Backup_ID = -1;
|
||||||
|
@SuppressWarnings("unused")
|
||||||
String Object_Status = null;
|
String Object_Status = null;
|
||||||
|
|
||||||
log.info(elementValue);
|
log.info(elementValue);
|
||||||
|
@ -49,6 +51,7 @@ public class SQLStatementElementHandler extends AbstractElementHandler {
|
||||||
PreparedStatement pstmt = DB.prepareStatement(sql, getTrxName(ctx));
|
PreparedStatement pstmt = DB.prepareStatement(sql, getTrxName(ctx));
|
||||||
try {
|
try {
|
||||||
if(DBType.equals("ALL")) {
|
if(DBType.equals("ALL")) {
|
||||||
|
@SuppressWarnings("unused")
|
||||||
int n = pstmt.executeUpdate();
|
int n = pstmt.executeUpdate();
|
||||||
log.info("Executed SQL Statement: "+ atts.getValue("statement"));
|
log.info("Executed SQL Statement: "+ atts.getValue("statement"));
|
||||||
}
|
}
|
||||||
|
@ -69,6 +72,7 @@ public class SQLStatementElementHandler extends AbstractElementHandler {
|
||||||
Connection m_con = DB.getConnectionRW(true);
|
Connection m_con = DB.getConnectionRW(true);
|
||||||
try {
|
try {
|
||||||
Statement stmt = m_con.createStatement();
|
Statement stmt = m_con.createStatement();
|
||||||
|
@SuppressWarnings("unused")
|
||||||
int n = stmt.executeUpdate (atts.getValue("statement"));
|
int n = stmt.executeUpdate (atts.getValue("statement"));
|
||||||
log.info("Executed SQL Statement for PostgreSQL: "+ atts.getValue("statement"));
|
log.info("Executed SQL Statement for PostgreSQL: "+ atts.getValue("statement"));
|
||||||
// Postgres needs to commit DDL statements
|
// Postgres needs to commit DDL statements
|
||||||
|
|
|
@ -54,7 +54,9 @@ public class TaskAccessElementHandler extends AbstractElementHandler {
|
||||||
|
|
||||||
sqlB = new StringBuffer ("SELECT count(*) FROM AD_Task_Access WHERE AD_Role_ID=? and AD_Task_ID=?");
|
sqlB = new StringBuffer ("SELECT count(*) FROM AD_Task_Access WHERE AD_Role_ID=? and AD_Task_ID=?");
|
||||||
int count = DB.getSQLValue(getTrxName(ctx),sqlB.toString(),roleid,taskid);
|
int count = DB.getSQLValue(getTrxName(ctx),sqlB.toString(),roleid,taskid);
|
||||||
|
@SuppressWarnings("unused")
|
||||||
int AD_Backup_ID = -1;
|
int AD_Backup_ID = -1;
|
||||||
|
@SuppressWarnings("unused")
|
||||||
String Object_Status = null;
|
String Object_Status = null;
|
||||||
if (count>0){
|
if (count>0){
|
||||||
Object_Status = "Update";
|
Object_Status = "Update";
|
||||||
|
|
|
@ -62,7 +62,9 @@ public class UserRoleElementHandler extends AbstractElementHandler {
|
||||||
sqlB = new StringBuffer ("SELECT count(*) FROM AD_User_Roles WHERE AD_User_ID = ? and AD_Role_ID = ?");
|
sqlB = new StringBuffer ("SELECT count(*) FROM AD_User_Roles WHERE AD_User_ID = ? and AD_Role_ID = ?");
|
||||||
int count = DB.getSQLValue(getTrxName(ctx),sqlB.toString(),userid,roleid);
|
int count = DB.getSQLValue(getTrxName(ctx),sqlB.toString(),userid,roleid);
|
||||||
|
|
||||||
|
@SuppressWarnings("unused")
|
||||||
int AD_Backup_ID = -1;
|
int AD_Backup_ID = -1;
|
||||||
|
@SuppressWarnings("unused")
|
||||||
String Object_Status = null;
|
String Object_Status = null;
|
||||||
if (count>0){
|
if (count>0){
|
||||||
//AD_Backup_ID = copyRecord("AD_Role",m_Role);
|
//AD_Backup_ID = copyRecord("AD_Role",m_Role);
|
||||||
|
|
|
@ -61,7 +61,9 @@ public class WindowAccessElementHandler extends AbstractElementHandler {
|
||||||
|
|
||||||
sqlB = new StringBuffer ("SELECT count(*) FROM AD_Window_Access WHERE AD_Role_ID=? and AD_Window_ID=?");
|
sqlB = new StringBuffer ("SELECT count(*) FROM AD_Window_Access WHERE AD_Role_ID=? and AD_Window_ID=?");
|
||||||
int count = DB.getSQLValue(getTrxName(ctx),sqlB.toString(),roleid,windowid);
|
int count = DB.getSQLValue(getTrxName(ctx),sqlB.toString(),roleid,windowid);
|
||||||
|
@SuppressWarnings("unused")
|
||||||
int AD_Backup_ID = -1;
|
int AD_Backup_ID = -1;
|
||||||
|
@SuppressWarnings("unused")
|
||||||
String Object_Status = null;
|
String Object_Status = null;
|
||||||
if (count>0){
|
if (count>0){
|
||||||
Object_Status = "Update";
|
Object_Status = "Update";
|
||||||
|
|
|
@ -54,7 +54,9 @@ public class WorkflowAccessElementHandler extends AbstractElementHandler {
|
||||||
|
|
||||||
sqlB = new StringBuffer ("SELECT count(*) FROM AD_Workflow_Access WHERE AD_Role_ID=? and AD_Workflow_ID=?");
|
sqlB = new StringBuffer ("SELECT count(*) FROM AD_Workflow_Access WHERE AD_Role_ID=? and AD_Workflow_ID=?");
|
||||||
int count = DB.getSQLValue(getTrxName(ctx),sqlB.toString(),roleid,workflowid);
|
int count = DB.getSQLValue(getTrxName(ctx),sqlB.toString(),roleid,workflowid);
|
||||||
|
@SuppressWarnings("unused")
|
||||||
int AD_Backup_ID = -1;
|
int AD_Backup_ID = -1;
|
||||||
|
@SuppressWarnings("unused")
|
||||||
String Object_Status = null;
|
String Object_Status = null;
|
||||||
if (count>0){
|
if (count>0){
|
||||||
Object_Status = "Update";
|
Object_Status = "Update";
|
||||||
|
|
|
@ -24,7 +24,6 @@ import org.adempiere.pipo.AbstractElementHandler;
|
||||||
import org.adempiere.pipo.Element;
|
import org.adempiere.pipo.Element;
|
||||||
import org.adempiere.pipo.PackOut;
|
import org.adempiere.pipo.PackOut;
|
||||||
import org.adempiere.pipo.exception.POSaveFailedException;
|
import org.adempiere.pipo.exception.POSaveFailedException;
|
||||||
import org.compiere.model.X_AD_WF_NextCondition;
|
|
||||||
import org.compiere.model.X_AD_WF_NodeNext;
|
import org.compiere.model.X_AD_WF_NodeNext;
|
||||||
import org.compiere.util.DB;
|
import org.compiere.util.DB;
|
||||||
import org.compiere.util.Env;
|
import org.compiere.util.Env;
|
||||||
|
@ -187,6 +186,7 @@ public class WorkflowNodeNextElementHandler extends AbstractElementHandler {
|
||||||
return atts;
|
return atts;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
private AttributesImpl createWorkflowNodeNextConditionBinding(
|
private AttributesImpl createWorkflowNodeNextConditionBinding(
|
||||||
AttributesImpl atts, X_AD_WF_NextCondition m_WF_NodeNextCondition) {
|
AttributesImpl atts, X_AD_WF_NextCondition m_WF_NodeNextCondition) {
|
||||||
String sql = null;
|
String sql = null;
|
||||||
|
@ -271,4 +271,5 @@ public class WorkflowNodeNextElementHandler extends AbstractElementHandler {
|
||||||
|
|
||||||
return atts;
|
return atts;
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
}
|
}
|
||||||
|
|
|
@ -15,11 +15,13 @@ import test.AdempiereTestCase;
|
||||||
public class PackOutTest extends AdempiereTestCase {
|
public class PackOutTest extends AdempiereTestCase {
|
||||||
|
|
||||||
// Test: Specific variables
|
// Test: Specific variables
|
||||||
|
@SuppressWarnings("unused")
|
||||||
private MLocation location = null;
|
private MLocation location = null;
|
||||||
|
|
||||||
|
|
||||||
public void testPackOut() {
|
public void testPackOut() {
|
||||||
PackOut m_PackOut = new PackOut();
|
PackOut m_PackOut = new PackOut();
|
||||||
|
@SuppressWarnings("unused")
|
||||||
PackInHandler m_PackInHandler = new PackInHandler();
|
PackInHandler m_PackInHandler = new PackInHandler();
|
||||||
Trx m_trx = Trx.get(getTrxName(), true);
|
Trx m_trx = Trx.get(getTrxName(), true);
|
||||||
int m_ad_process_id = IDFinder.get_IDWithColumn("ad_process", "Name", "PackOut", getAD_Client_ID(), getTrxName());
|
int m_ad_process_id = IDFinder.get_IDWithColumn("ad_process", "Name", "PackOut", getAD_Client_ID(), getTrxName());
|
||||||
|
@ -70,6 +72,7 @@ public class PackOutTest extends AdempiereTestCase {
|
||||||
saveResult = m_PackDetail.save();
|
saveResult = m_PackDetail.save();
|
||||||
assertTrue("X_AD_Package_Exp_Detail.save()", saveResult);
|
assertTrue("X_AD_Package_Exp_Detail.save()", saveResult);
|
||||||
|
|
||||||
|
@SuppressWarnings("unused")
|
||||||
int m_ad_record_id = IDFinder.get_IDWithColumn("ad_package_exp", "Name", "test2packJunit", getAD_Client_ID(), getTrxName());
|
int m_ad_record_id = IDFinder.get_IDWithColumn("ad_package_exp", "Name", "test2packJunit", getAD_Client_ID(), getTrxName());
|
||||||
|
|
||||||
ProcessInfo m_ProcessInfo = new ProcessInfo("PackOut", m_ad_process_id, m_ad_table_id, m_MPackageExp.get_ID());
|
ProcessInfo m_ProcessInfo = new ProcessInfo("PackOut", m_ad_process_id, m_ad_table_id, m_MPackageExp.get_ID());
|
||||||
|
|
|
@ -924,12 +924,11 @@ public final class ALogin extends CDialog
|
||||||
{
|
{
|
||||||
clientCombo.setSelectedIndex(0);
|
clientCombo.setSelectedIndex(0);
|
||||||
clientCombo.setVisible(false);
|
clientCombo.setVisible(false);
|
||||||
clientCombo.setVisible(false);
|
|
||||||
clientLabel.setVisible(false);
|
clientLabel.setVisible(false);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
clientCombo.setVisible(true);
|
clientLabel.setVisible(true);
|
||||||
clientCombo.setVisible(true);
|
clientCombo.setVisible(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -973,6 +972,10 @@ public final class ALogin extends CDialog
|
||||||
}
|
}
|
||||||
//
|
//
|
||||||
KeyNamePair[] roles = m_login.getRoles(userTextField.getText(), client);
|
KeyNamePair[] roles = m_login.getRoles(userTextField.getText(), client);
|
||||||
|
// Make role Combo visible
|
||||||
|
roleCombo.setVisible(true);
|
||||||
|
roleLabel.setVisible(true);
|
||||||
|
|
||||||
// delete existing rol/org items
|
// delete existing rol/org items
|
||||||
if (roleCombo.getItemCount() > 0)
|
if (roleCombo.getItemCount() > 0)
|
||||||
roleCombo.removeAllItems();
|
roleCombo.removeAllItems();
|
||||||
|
@ -1005,7 +1008,6 @@ public final class ALogin extends CDialog
|
||||||
{
|
{
|
||||||
roleCombo.setSelectedIndex(0);
|
roleCombo.setSelectedIndex(0);
|
||||||
roleCombo.setVisible(false);
|
roleCombo.setVisible(false);
|
||||||
roleCombo.setVisible(false);
|
|
||||||
roleLabel.setVisible(false);
|
roleLabel.setVisible(false);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,8 +19,12 @@ package org.compiere.apps;
|
||||||
|
|
||||||
import static org.compiere.model.SystemIDs.PROCESS_AD_CHANGELOG_REDO;
|
import static org.compiere.model.SystemIDs.PROCESS_AD_CHANGELOG_REDO;
|
||||||
import static org.compiere.model.SystemIDs.PROCESS_AD_CHANGELOG_UNDO;
|
import static org.compiere.model.SystemIDs.PROCESS_AD_CHANGELOG_UNDO;
|
||||||
|
import static org.compiere.model.SystemIDs.REFERENCE_DOCUMENTACTION;
|
||||||
|
import static org.compiere.model.SystemIDs.REFERENCE_PAYMENTRULE;
|
||||||
|
import static org.compiere.model.SystemIDs.REFERENCE_POSTED;
|
||||||
|
|
||||||
import java.awt.BorderLayout;
|
import java.awt.BorderLayout;
|
||||||
|
import java.awt.Color;
|
||||||
import java.awt.Component;
|
import java.awt.Component;
|
||||||
import java.awt.Cursor;
|
import java.awt.Cursor;
|
||||||
import java.awt.Dimension;
|
import java.awt.Dimension;
|
||||||
|
@ -33,6 +37,9 @@ import java.awt.event.ActionListener;
|
||||||
import java.awt.event.InputEvent;
|
import java.awt.event.InputEvent;
|
||||||
import java.awt.event.KeyEvent;
|
import java.awt.event.KeyEvent;
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
|
import java.sql.PreparedStatement;
|
||||||
|
import java.sql.ResultSet;
|
||||||
|
import java.sql.SQLException;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
|
@ -46,13 +53,16 @@ import java.util.logging.Level;
|
||||||
import javax.swing.AbstractAction;
|
import javax.swing.AbstractAction;
|
||||||
import javax.swing.Action;
|
import javax.swing.Action;
|
||||||
import javax.swing.BorderFactory;
|
import javax.swing.BorderFactory;
|
||||||
|
import javax.swing.ImageIcon;
|
||||||
import javax.swing.JDialog;
|
import javax.swing.JDialog;
|
||||||
import javax.swing.JFrame;
|
import javax.swing.JFrame;
|
||||||
import javax.swing.JList;
|
import javax.swing.JList;
|
||||||
import javax.swing.JMenu;
|
import javax.swing.JMenu;
|
||||||
import javax.swing.JMenuBar;
|
import javax.swing.JMenuBar;
|
||||||
|
import javax.swing.JMenuItem;
|
||||||
import javax.swing.JOptionPane;
|
import javax.swing.JOptionPane;
|
||||||
import javax.swing.JPanel;
|
import javax.swing.JPanel;
|
||||||
|
import javax.swing.JPopupMenu;
|
||||||
import javax.swing.JScrollPane;
|
import javax.swing.JScrollPane;
|
||||||
import javax.swing.JTabbedPane;
|
import javax.swing.JTabbedPane;
|
||||||
import javax.swing.JTable;
|
import javax.swing.JTable;
|
||||||
|
@ -62,6 +72,8 @@ import javax.swing.ListSelectionModel;
|
||||||
import javax.swing.SwingUtilities;
|
import javax.swing.SwingUtilities;
|
||||||
import javax.swing.event.ChangeEvent;
|
import javax.swing.event.ChangeEvent;
|
||||||
import javax.swing.event.ChangeListener;
|
import javax.swing.event.ChangeListener;
|
||||||
|
import javax.swing.event.PopupMenuEvent;
|
||||||
|
import javax.swing.event.PopupMenuListener;
|
||||||
|
|
||||||
import org.adempiere.util.Callback;
|
import org.adempiere.util.Callback;
|
||||||
import org.adempiere.util.IProcessUI;
|
import org.adempiere.util.IProcessUI;
|
||||||
|
@ -87,6 +99,7 @@ import org.compiere.model.GridWindow;
|
||||||
import org.compiere.model.GridWindowVO;
|
import org.compiere.model.GridWindowVO;
|
||||||
import org.compiere.model.GridWorkbench;
|
import org.compiere.model.GridWorkbench;
|
||||||
import org.compiere.model.Lookup;
|
import org.compiere.model.Lookup;
|
||||||
|
import org.compiere.model.MLookup;
|
||||||
import org.compiere.model.MLookupFactory;
|
import org.compiere.model.MLookupFactory;
|
||||||
import org.compiere.model.MProcess;
|
import org.compiere.model.MProcess;
|
||||||
import org.compiere.model.MQuery;
|
import org.compiere.model.MQuery;
|
||||||
|
@ -104,9 +117,11 @@ import org.compiere.swing.CPanel;
|
||||||
import org.compiere.util.CLogMgt;
|
import org.compiere.util.CLogMgt;
|
||||||
import org.compiere.util.CLogger;
|
import org.compiere.util.CLogger;
|
||||||
import org.compiere.util.DB;
|
import org.compiere.util.DB;
|
||||||
|
import org.compiere.util.DisplayType;
|
||||||
import org.compiere.util.Env;
|
import org.compiere.util.Env;
|
||||||
import org.compiere.util.Language;
|
import org.compiere.util.Language;
|
||||||
import org.compiere.util.Msg;
|
import org.compiere.util.Msg;
|
||||||
|
import org.compiere.util.NamePair;
|
||||||
import org.compiere.util.Util;
|
import org.compiere.util.Util;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -258,7 +273,7 @@ public final class APanel extends CPanel
|
||||||
// Prepare GC
|
// Prepare GC
|
||||||
this.removeAll();
|
this.removeAll();
|
||||||
} // dispose
|
} // dispose
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The Layout.
|
* The Layout.
|
||||||
*/
|
*/
|
||||||
|
@ -308,7 +323,8 @@ public final class APanel extends CPanel
|
||||||
aNew, aCopy, aDelete, aPrint, aPrintPreview,
|
aNew, aCopy, aDelete, aPrint, aPrintPreview,
|
||||||
aExport = null,
|
aExport = null,
|
||||||
aRefresh, aHistory, aAttachment, aChat, aMulti, aFind,
|
aRefresh, aHistory, aAttachment, aChat, aMulti, aFind,
|
||||||
aWorkflow, aZoomAcross, aRequest, aWinSize, aArchive;
|
aWorkflow, aZoomAcross, aRequest, aWinSize, aArchive,
|
||||||
|
aProcess;
|
||||||
/** Ignore Button */
|
/** Ignore Button */
|
||||||
public AppsAction aIgnore;
|
public AppsAction aIgnore;
|
||||||
/** Save Button */
|
/** Save Button */
|
||||||
|
@ -482,6 +498,9 @@ public final class APanel extends CPanel
|
||||||
aOnline = addAction("Online", mHelp, null, false);
|
aOnline = addAction("Online", mHelp, null, false);
|
||||||
aMailSupport = addAction("EMailSupport", mHelp, null, false);
|
aMailSupport = addAction("EMailSupport", mHelp, null, false);
|
||||||
aAbout = addAction("About", mHelp, null, false);
|
aAbout = addAction("About", mHelp, null, false);
|
||||||
|
|
||||||
|
//
|
||||||
|
aProcess=addAction("Process",null,null,false);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ToolBar
|
* ToolBar
|
||||||
|
@ -495,6 +514,7 @@ public final class APanel extends CPanel
|
||||||
toolBar.add(aDeleteSelection.getButton());
|
toolBar.add(aDeleteSelection.getButton());
|
||||||
toolBar.add(aSave.getButton());
|
toolBar.add(aSave.getButton());
|
||||||
toolBar.add(aSaveAndCreate.getButton());
|
toolBar.add(aSaveAndCreate.getButton());
|
||||||
|
toolBar.add(aProcess.getButton());
|
||||||
toolBar.addSeparator();
|
toolBar.addSeparator();
|
||||||
toolBar.add(aRefresh.getButton()); // F5
|
toolBar.add(aRefresh.getButton()); // F5
|
||||||
toolBar.add(aFind.getButton());
|
toolBar.add(aFind.getButton());
|
||||||
|
@ -1573,7 +1593,20 @@ public final class APanel extends CPanel
|
||||||
aRefresh.setEnabled(true);
|
aRefresh.setEnabled(true);
|
||||||
aAttachment.setEnabled(true);
|
aAttachment.setEnabled(true);
|
||||||
aChat.setEnabled(true);
|
aChat.setEnabled(true);
|
||||||
|
|
||||||
|
// IDEMPIERE-587 - Swing: Toolbar Button to start Process from button fields
|
||||||
|
// tbayen - 2013-01-22
|
||||||
|
GridField[] fields = m_curGC.getMTab().getFields();
|
||||||
|
boolean processEnabled=false;
|
||||||
|
for(GridField field:fields){
|
||||||
|
if (field.isToolbarButton() && field.isDisplayed()){
|
||||||
|
processEnabled=true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
aProcess.setEnabled(processEnabled);
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
m_curWinTab.requestFocusInWindow();
|
m_curWinTab.requestFocusInWindow();
|
||||||
setBusy(false, true);
|
setBusy(false, true);
|
||||||
|
@ -1725,6 +1758,8 @@ public final class APanel extends CPanel
|
||||||
cmd_find();
|
cmd_find();
|
||||||
else if (m_isPersonalLock && cmd.equals(aLock.getName()))
|
else if (m_isPersonalLock && cmd.equals(aLock.getName()))
|
||||||
cmd_lock();
|
cmd_lock();
|
||||||
|
else if (cmd.equals(aProcess.getName()))
|
||||||
|
cmd_process();
|
||||||
// View
|
// View
|
||||||
else if (cmd.equals(aAttachment.getName()))
|
else if (cmd.equals(aAttachment.getName()))
|
||||||
cmd_attachment();
|
cmd_attachment();
|
||||||
|
@ -2088,6 +2123,143 @@ public final class APanel extends CPanel
|
||||||
return retValue;
|
return retValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private long m_popup_closingtime=0;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* opens a pulldown menu to start processes from "Button" type fields.
|
||||||
|
*/
|
||||||
|
// IDEMPIERE-587 - Swing: Toolbar Button to start Process from button fields
|
||||||
|
// tbayen - 2013-01-22
|
||||||
|
public void cmd_process() {
|
||||||
|
if(System.currentTimeMillis()-m_popup_closingtime<200)
|
||||||
|
return; // closed through the same click - user has clicked to close the menu
|
||||||
|
GridField[] fields = m_curGC.getMTab().getFields();
|
||||||
|
final ArrayList<GridField> processFields = new ArrayList<GridField>();
|
||||||
|
for (GridField field : fields) {
|
||||||
|
if (field.isToolbarButton() && field.isDisplayed()) {
|
||||||
|
processFields.add(field);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
JPopupMenu popup = new JPopupMenu();
|
||||||
|
popup.addPopupMenuListener(new PopupMenuListener() {
|
||||||
|
@Override
|
||||||
|
public void popupMenuWillBecomeInvisible(PopupMenuEvent e) {
|
||||||
|
m_popup_closingtime=System.currentTimeMillis();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override public void popupMenuWillBecomeVisible(PopupMenuEvent e) {}
|
||||||
|
@Override public void popupMenuCanceled(PopupMenuEvent e) {}
|
||||||
|
});
|
||||||
|
|
||||||
|
for (GridField field : processFields) {
|
||||||
|
if (field.isDisplayed(true)) {
|
||||||
|
ImageIcon icon = Env.getImageIcon2("Process16");
|
||||||
|
String text = field.getHeader();
|
||||||
|
Color color = null;
|
||||||
|
// preparing data like lookup tables
|
||||||
|
// code to find the text and icons to display is shameless
|
||||||
|
// stolen from org.compiere.grid.ed.VButton
|
||||||
|
MLookup m_lookup = null;
|
||||||
|
// Record_ID for Zoom Buttons (see
|
||||||
|
// http://www.adempiere.com/Entering_Data_-_Fields_and_Buttons#Button)
|
||||||
|
if (field.getColumnName().endsWith("_ID")
|
||||||
|
&& !field.getColumnName().equals("Record_ID")) {
|
||||||
|
m_lookup = MLookupFactory.get(Env.getCtx(),
|
||||||
|
field.getWindowNo(), 0, field.getAD_Column_ID(),
|
||||||
|
DisplayType.Search);
|
||||||
|
} else if (field.getAD_Reference_Value_ID() != 0) {
|
||||||
|
// Assuming List
|
||||||
|
m_lookup = MLookupFactory.get(Env.getCtx(),
|
||||||
|
field.getWindowNo(), 0, field.getAD_Column_ID(),
|
||||||
|
DisplayType.List);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Special Buttons
|
||||||
|
int AD_Reference_ID = -1;
|
||||||
|
String columnName = field.getColumnName();
|
||||||
|
if (columnName.equals("PaymentRule")) {
|
||||||
|
AD_Reference_ID = REFERENCE_PAYMENTRULE;
|
||||||
|
color = Color.blue;
|
||||||
|
icon = Env.getImageIcon("Payment16.gif"); // 29*14
|
||||||
|
} else if (columnName.equals("DocAction")) {
|
||||||
|
AD_Reference_ID = REFERENCE_DOCUMENTACTION;
|
||||||
|
color = Color.blue;
|
||||||
|
icon = Env.getImageIcon("Process16.gif"); // 16*16
|
||||||
|
} else if (columnName.equals("CreateFrom")) {
|
||||||
|
icon = Env.getImageIcon("Copy16.gif"); // 16*16
|
||||||
|
} else if (columnName.equals("Record_ID")) {
|
||||||
|
icon = Env.getImageIcon("Zoom16.gif"); // 16*16
|
||||||
|
text = Msg.getMsg(Env.getCtx(), "ZoomDocument");
|
||||||
|
} else if (columnName.equals("Posted")) {
|
||||||
|
AD_Reference_ID = REFERENCE_POSTED;
|
||||||
|
color = Color.magenta;
|
||||||
|
icon = Env.getImageIcon("InfoAccount16.gif"); // 16*16
|
||||||
|
}
|
||||||
|
|
||||||
|
Map<String, String> values = null;
|
||||||
|
if (AD_Reference_ID > 0) {
|
||||||
|
values = new HashMap<String, String>();
|
||||||
|
String SQL;
|
||||||
|
if (Env.isBaseLanguage(Env.getCtx(), "AD_Ref_List"))
|
||||||
|
SQL = "SELECT Value, Name FROM AD_Ref_List WHERE AD_Reference_ID=?";
|
||||||
|
else
|
||||||
|
SQL = "SELECT l.Value, t.Name FROM AD_Ref_List l, AD_Ref_List_Trl t "
|
||||||
|
+ "WHERE l.AD_Ref_List_ID=t.AD_Ref_List_ID"
|
||||||
|
+ " AND t.AD_Language='"
|
||||||
|
+ Env.getAD_Language(Env.getCtx())
|
||||||
|
+ "'"
|
||||||
|
+ " AND l.AD_Reference_ID=?";
|
||||||
|
try {
|
||||||
|
PreparedStatement pstmt = DB
|
||||||
|
.prepareStatement(SQL, null);
|
||||||
|
pstmt.setInt(1, AD_Reference_ID);
|
||||||
|
ResultSet rs = pstmt.executeQuery();
|
||||||
|
while (rs.next()) {
|
||||||
|
String value = rs.getString(1);
|
||||||
|
String name = rs.getString(2);
|
||||||
|
values.put(value, name);
|
||||||
|
}
|
||||||
|
rs.close();
|
||||||
|
pstmt.close();
|
||||||
|
} catch (SQLException e) {
|
||||||
|
log.log(Level.SEVERE, SQL, e);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Nothing to show or Record_ID
|
||||||
|
if (field.getValue() == null
|
||||||
|
|| field.getColumnName().equals("Record_ID"))
|
||||||
|
;
|
||||||
|
else if (values != null)
|
||||||
|
text = (String) values.get(field.getValue());
|
||||||
|
else if (m_lookup != null) {
|
||||||
|
NamePair pp = m_lookup.get(field.getValue());
|
||||||
|
if (pp != null)
|
||||||
|
text = pp.getName();
|
||||||
|
}
|
||||||
|
// Display it
|
||||||
|
} // setValue
|
||||||
|
|
||||||
|
JMenuItem item = new JMenuItem(text, icon);
|
||||||
|
item.setForeground(color);
|
||||||
|
item.setName(field.getColumnName());
|
||||||
|
popup.add(item);
|
||||||
|
item.addActionListener(new ActionListener() {
|
||||||
|
@Override
|
||||||
|
public void actionPerformed(ActionEvent e) {
|
||||||
|
JMenuItem menuItem = ((JMenuItem)e.getSource());
|
||||||
|
String columnName=menuItem.getName();
|
||||||
|
GridField callingField = m_curTab.getField(columnName);
|
||||||
|
//
|
||||||
|
setStatusLine(m_curTab.processCallout(callingField), true);
|
||||||
|
actionButtonCleanUp(menuItem.getName(),
|
||||||
|
callingField.getAD_Process_ID(), callingField.getHeader());
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
popup.show(aProcess.getButton(), -1, aProcess.getButton().getHeight());
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Ignore
|
* Ignore
|
||||||
*/
|
*/
|
||||||
|
@ -2469,9 +2641,16 @@ public final class APanel extends CPanel
|
||||||
* Start Button Process
|
* Start Button Process
|
||||||
* @param vButton button
|
* @param vButton button
|
||||||
*/
|
*/
|
||||||
private void actionButton (VButton vButton)
|
private void actionButton (VButton vButton){
|
||||||
{
|
|
||||||
log.info(vButton.toString());
|
log.info(vButton.toString());
|
||||||
|
String title = vButton.getDescription();
|
||||||
|
if (title == null || title.length() == 0)
|
||||||
|
title = vButton.getName();
|
||||||
|
actionButtonCleanUp(vButton.getColumnName(), vButton.getProcess_ID(), title);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void actionButtonCleanUp(String columnName, int processID, String title)
|
||||||
|
{
|
||||||
|
|
||||||
if (m_curTab.hasChangedCurrentTabAndParents()) {
|
if (m_curTab.hasChangedCurrentTabAndParents()) {
|
||||||
String msg = CLogger.retrieveErrorString("Please ReQuery Window");
|
String msg = CLogger.retrieveErrorString("Please ReQuery Window");
|
||||||
|
@ -2481,7 +2660,7 @@ public final class APanel extends CPanel
|
||||||
|
|
||||||
boolean startWOasking = false;
|
boolean startWOasking = false;
|
||||||
// boolean batch = false;
|
// boolean batch = false;
|
||||||
String col = vButton.getColumnName();
|
String col = columnName;
|
||||||
|
|
||||||
// Zoom
|
// Zoom
|
||||||
if (col.equals("Record_ID"))
|
if (col.equals("Record_ID"))
|
||||||
|
@ -2512,7 +2691,7 @@ public final class APanel extends CPanel
|
||||||
record_ID = Env.getContextAsInt (m_ctx, m_curWindowNo, "AD_Language_ID");
|
record_ID = Env.getContextAsInt (m_ctx, m_curWindowNo, "AD_Language_ID");
|
||||||
// Record_ID - Change Log ID
|
// Record_ID - Change Log ID
|
||||||
if (record_ID == -1
|
if (record_ID == -1
|
||||||
&& (vButton.getProcess_ID() == PROCESS_AD_CHANGELOG_UNDO || vButton.getProcess_ID() == PROCESS_AD_CHANGELOG_REDO))
|
&& (processID == PROCESS_AD_CHANGELOG_UNDO || processID == PROCESS_AD_CHANGELOG_REDO))
|
||||||
{
|
{
|
||||||
Integer id = (Integer)m_curTab.getValue("AD_ChangeLog_ID");
|
Integer id = (Integer)m_curTab.getValue("AD_ChangeLog_ID");
|
||||||
record_ID = id.intValue();
|
record_ID = id.intValue();
|
||||||
|
@ -2529,7 +2708,7 @@ public final class APanel extends CPanel
|
||||||
if (col.equals("DocAction"))
|
if (col.equals("DocAction"))
|
||||||
{
|
{
|
||||||
isProcessMandatory = true;
|
isProcessMandatory = true;
|
||||||
VDocAction vda = new VDocAction(m_curWindowNo, m_curTab, vButton, record_ID);
|
VDocAction vda = new VDocAction(m_curWindowNo, m_curTab, null, record_ID);
|
||||||
// Something to select from?
|
// Something to select from?
|
||||||
if (vda.getNumberOfOptions() == 0)
|
if (vda.getNumberOfOptions() == 0)
|
||||||
{
|
{
|
||||||
|
@ -2552,7 +2731,7 @@ public final class APanel extends CPanel
|
||||||
else if (col.equals("CreateFrom"))
|
else if (col.equals("CreateFrom"))
|
||||||
{
|
{
|
||||||
// Run form only if the button has no process defined - teo_sarca [ 1974354 ]
|
// Run form only if the button has no process defined - teo_sarca [ 1974354 ]
|
||||||
if (vButton.getProcess_ID() <= 0)
|
if (processID <= 0)
|
||||||
{
|
{
|
||||||
ICreateFrom cf = VCreateFromFactory.create(m_curTab);
|
ICreateFrom cf = VCreateFromFactory.create(m_curTab);
|
||||||
if(cf != null)
|
if(cf != null)
|
||||||
|
@ -2628,8 +2807,8 @@ public final class APanel extends CPanel
|
||||||
* or invoke user form
|
* or invoke user form
|
||||||
*/
|
*/
|
||||||
|
|
||||||
log.config("Process_ID=" + vButton.getProcess_ID() + ", Record_ID=" + record_ID);
|
log.config("Process_ID=" + processID + ", Record_ID=" + record_ID);
|
||||||
if (vButton.getProcess_ID() == 0)
|
if (processID == 0)
|
||||||
{
|
{
|
||||||
if (isProcessMandatory)
|
if (isProcessMandatory)
|
||||||
{
|
{
|
||||||
|
@ -2643,7 +2822,7 @@ public final class APanel extends CPanel
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// call form
|
// call form
|
||||||
MProcess pr = new MProcess(m_ctx, vButton.getProcess_ID(), null);
|
MProcess pr = new MProcess(m_ctx, processID, null);
|
||||||
int form_ID = pr.getAD_Form_ID();
|
int form_ID = pr.getAD_Form_ID();
|
||||||
if (form_ID != 0 )
|
if (form_ID != 0 )
|
||||||
{
|
{
|
||||||
|
@ -2653,10 +2832,7 @@ public final class APanel extends CPanel
|
||||||
return;
|
return;
|
||||||
|
|
||||||
FormFrame ff = new FormFrame(getGraphicsConfiguration());
|
FormFrame ff = new FormFrame(getGraphicsConfiguration());
|
||||||
String title = vButton.getDescription();
|
ProcessInfo pi = new ProcessInfo (title, processID, table_ID, record_ID);
|
||||||
if (title == null || title.length() == 0)
|
|
||||||
title = vButton.getName();
|
|
||||||
ProcessInfo pi = new ProcessInfo (title, vButton.getProcess_ID(), table_ID, record_ID);
|
|
||||||
pi.setAD_User_ID (Env.getAD_User_ID(m_ctx));
|
pi.setAD_User_ID (Env.getAD_User_ID(m_ctx));
|
||||||
pi.setAD_Client_ID (Env.getAD_Client_ID(m_ctx));
|
pi.setAD_Client_ID (Env.getAD_Client_ID(m_ctx));
|
||||||
ff.setProcessInfo(pi);
|
ff.setProcessInfo(pi);
|
||||||
|
@ -2667,7 +2843,7 @@ public final class APanel extends CPanel
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
ProcessModalDialog dialog = new ProcessModalDialog(m_ctx, AEnv.getWindow(m_curWindowNo), Env.getHeader(m_ctx, m_curWindowNo),
|
ProcessModalDialog dialog = new ProcessModalDialog(m_ctx, AEnv.getWindow(m_curWindowNo), Env.getHeader(m_ctx, m_curWindowNo),
|
||||||
this, m_curWindowNo, vButton.getProcess_ID(), table_ID,
|
this, m_curWindowNo, processID, table_ID,
|
||||||
record_ID, startWOasking);
|
record_ID, startWOasking);
|
||||||
if (dialog.isValidDialog())
|
if (dialog.isValidDialog())
|
||||||
{
|
{
|
||||||
|
|
|
@ -415,7 +415,12 @@ public class GridController extends CPanel
|
||||||
for (int i = 0; i < size; i++)
|
for (int i = 0; i < size; i++)
|
||||||
{
|
{
|
||||||
GridField mField = m_mTab.getField(i);
|
GridField mField = m_mTab.getField(i);
|
||||||
if (mField.isDisplayed())
|
if (mField.isDisplayed()
|
||||||
|
// IDEMPIERE-587 Swing: Toolbar Button to start Process from button fields
|
||||||
|
&& !(
|
||||||
|
mField.getDisplayType()==DisplayType.Button
|
||||||
|
&& mField.isToolbarButton())
|
||||||
|
)
|
||||||
{
|
{
|
||||||
VEditor vEditor = VEditorFactory.getEditor(m_mTab, mField, false);
|
VEditor vEditor = VEditorFactory.getEditor(m_mTab, mField, false);
|
||||||
if (vEditor == null)
|
if (vEditor == null)
|
||||||
|
|
|
@ -125,7 +125,7 @@ public class XLookup extends Lookup
|
||||||
* @return list of data
|
* @return list of data
|
||||||
*/
|
*/
|
||||||
public ArrayList<Object> getData (boolean mandatory,
|
public ArrayList<Object> getData (boolean mandatory,
|
||||||
boolean onlyValidated, boolean onlyActive, boolean temporary)
|
boolean onlyValidated, boolean onlyActive, boolean temporary, boolean shortlist) // IDEMPIERE 90
|
||||||
{
|
{
|
||||||
ArrayList<Object> list = new ArrayList<Object>(p_data);
|
ArrayList<Object> list = new ArrayList<Object>(p_data);
|
||||||
|
|
||||||
|
|
|
@ -243,7 +243,7 @@ public class VLocatorDialog extends CDialog
|
||||||
log.fine("Warehouses=" + fWarehouse.getItemCount());
|
log.fine("Warehouses=" + fWarehouse.getItemCount());
|
||||||
|
|
||||||
// Load existing Locators
|
// Load existing Locators
|
||||||
m_mLocator.fillComboBox(m_mandatory, true, true, false);
|
m_mLocator.fillComboBox(m_mandatory, true, true, false, false); // IDEMPIERE 90
|
||||||
log.fine(m_mLocator.toString());
|
log.fine(m_mLocator.toString());
|
||||||
fLocator.setModel(m_mLocator);
|
fLocator.setModel(m_mLocator);
|
||||||
fLocator.setValue(m_M_Locator_ID);
|
fLocator.setValue(m_M_Locator_ID);
|
||||||
|
|
|
@ -40,6 +40,7 @@ import java.sql.ResultSet;
|
||||||
import java.sql.SQLException;
|
import java.sql.SQLException;
|
||||||
import java.util.logging.Level;
|
import java.util.logging.Level;
|
||||||
|
|
||||||
|
import javax.swing.AbstractAction;
|
||||||
import javax.swing.Action;
|
import javax.swing.Action;
|
||||||
import javax.swing.ActionMap;
|
import javax.swing.ActionMap;
|
||||||
import javax.swing.DefaultComboBoxModel;
|
import javax.swing.DefaultComboBoxModel;
|
||||||
|
@ -64,6 +65,7 @@ import org.compiere.model.MLookup;
|
||||||
import org.compiere.model.MLookupFactory;
|
import org.compiere.model.MLookupFactory;
|
||||||
import org.compiere.model.MQuery;
|
import org.compiere.model.MQuery;
|
||||||
import org.compiere.model.MRole;
|
import org.compiere.model.MRole;
|
||||||
|
import org.compiere.model.MTable;
|
||||||
import org.compiere.swing.CButton;
|
import org.compiere.swing.CButton;
|
||||||
import org.compiere.swing.CMenuItem;
|
import org.compiere.swing.CMenuItem;
|
||||||
import org.compiere.swing.CTextField;
|
import org.compiere.swing.CTextField;
|
||||||
|
@ -272,12 +274,45 @@ public class VLookup extends JComponent
|
||||||
else
|
else
|
||||||
m_button.setIcon(Env.getImageIcon("PickOpen10.gif"));
|
m_button.setIcon(Env.getImageIcon("PickOpen10.gif"));
|
||||||
|
|
||||||
|
// IDEMPIERE 90
|
||||||
|
boolean isShortListAvailable = false; // Short List available for this lookup
|
||||||
|
if (m_lookup != null && (m_lookup.getDisplayType() == DisplayType.TableDir || m_lookup.getDisplayType() == DisplayType.Table)) // only for Table & TableDir
|
||||||
|
{
|
||||||
|
String tableName_temp = m_lookup.getColumnName(); // Returns AD_Org.AD_Org_ID
|
||||||
|
int posPoint = tableName_temp.indexOf(".");
|
||||||
|
String tableName = tableName_temp.substring(0, posPoint);
|
||||||
|
MTable table = MTable.get(Env.getCtx(), tableName);
|
||||||
|
isShortListAvailable = (table.getColumnIndex("IsShortList") >= 0);
|
||||||
|
if (isShortListAvailable)
|
||||||
|
{
|
||||||
|
setComboShortList(true);
|
||||||
|
m_lookup.setShortList(true);
|
||||||
|
|
||||||
|
m_buttonSL.addActionListener(this);
|
||||||
|
m_buttonSL.addMouseListener(mouseAdapter);
|
||||||
|
m_buttonSL.setFocusable(false); // don't focus when tabbing
|
||||||
|
m_buttonSL.setMargin(new Insets(0, 0, 0, 0));
|
||||||
|
m_buttonSL.setIcon(Env.getImageIcon("LockX16.gif"));
|
||||||
|
m_buttonSL.setToolTipText(Msg.getMsg(Env.getCtx(), "ShortListShortListItems"));
|
||||||
|
ActionMap am = m_combo.getActionMap();
|
||||||
|
am.put("shortlist", new AbstractAction() {
|
||||||
|
@Override
|
||||||
|
public void actionPerformed(ActionEvent e) {
|
||||||
|
actionShortList();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
m_combo.getInputMap(WHEN_ANCESTOR_OF_FOCUSED_COMPONENT)
|
||||||
|
.put(KeyStroke.getKeyStroke(KeyEvent.VK_L, KeyEvent.CTRL_DOWN_MASK), "shortlist");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// IDEMPIERE 90
|
||||||
|
|
||||||
// *** VComboBox ***
|
// *** VComboBox ***
|
||||||
if (m_lookup != null && m_lookup.getDisplayType() != DisplayType.Search) // No Search
|
if (m_lookup != null && m_lookup.getDisplayType() != DisplayType.Search) // No Search
|
||||||
{
|
{
|
||||||
// Don't have to fill up combobox if it is readonly
|
// Don't have to fill up combobox if it is readonly
|
||||||
if (!isReadOnly && isUpdateable)
|
if (!isReadOnly && isUpdateable)
|
||||||
m_lookup.fillComboBox (isMandatory(), true, true, false);
|
m_lookup.fillComboBox (isMandatory(), true, true, false, isShortListAvailable); // IDEMPIERE 90
|
||||||
m_combo.setModel(m_lookup);
|
m_combo.setModel(m_lookup);
|
||||||
//
|
//
|
||||||
// AutoCompletion.enable(m_combo);
|
// AutoCompletion.enable(m_combo);
|
||||||
|
@ -342,6 +377,7 @@ public class VLookup extends JComponent
|
||||||
m_button = null;
|
m_button = null;
|
||||||
m_lookup = null;
|
m_lookup = null;
|
||||||
m_mField = null;
|
m_mField = null;
|
||||||
|
m_buttonSL = null; // IDEMPIERE 90
|
||||||
//
|
//
|
||||||
m_combo.getEditor().getEditorComponent().removeFocusListener(this);
|
m_combo.getEditor().getEditorComponent().removeFocusListener(this);
|
||||||
m_combo.getEditor().getEditorComponent().removeMouseListener(mouseAdapter);
|
m_combo.getEditor().getEditorComponent().removeMouseListener(mouseAdapter);
|
||||||
|
@ -394,6 +430,11 @@ public class VLookup extends JComponent
|
||||||
// Mouse Listener
|
// Mouse Listener
|
||||||
private VLookup_mouseAdapter mouseAdapter;
|
private VLookup_mouseAdapter mouseAdapter;
|
||||||
|
|
||||||
|
/** ShortList button IDEMPIERE 90 */
|
||||||
|
private CButton m_buttonSL = new CButton();
|
||||||
|
|
||||||
|
/** All items or only those of the short list ?*/
|
||||||
|
boolean onlyShortListItems = false;
|
||||||
|
|
||||||
// Field for Value Preference
|
// Field for Value Preference
|
||||||
private GridField m_mField = null;
|
private GridField m_mField = null;
|
||||||
|
@ -417,11 +458,13 @@ public class VLookup extends JComponent
|
||||||
m_text.setBorder(null);
|
m_text.setBorder(null);
|
||||||
Dimension bSize = new Dimension(size.height, size.height);
|
Dimension bSize = new Dimension(size.height, size.height);
|
||||||
m_button.setPreferredSize (bSize);
|
m_button.setPreferredSize (bSize);
|
||||||
|
m_buttonSL.setPreferredSize (bSize); // IDEMPIERE 90
|
||||||
}
|
}
|
||||||
|
|
||||||
// What to show
|
// What to show
|
||||||
this.remove(m_combo);
|
this.remove(m_combo);
|
||||||
this.remove(m_button);
|
this.remove(m_button);
|
||||||
|
this.remove(m_buttonSL); // IDEMPIERE 90
|
||||||
this.remove(m_text);
|
this.remove(m_text);
|
||||||
//
|
//
|
||||||
if (!isReadWrite()) // r/o - show text only
|
if (!isReadWrite()) // r/o - show text only
|
||||||
|
@ -437,6 +480,9 @@ public class VLookup extends JComponent
|
||||||
this.setBorder(null);
|
this.setBorder(null);
|
||||||
this.add(m_combo, BorderLayout.CENTER);
|
this.add(m_combo, BorderLayout.CENTER);
|
||||||
m_comboActive = true;
|
m_comboActive = true;
|
||||||
|
// IDEMPIERE 90
|
||||||
|
if (isComboShortList())
|
||||||
|
this.add(m_buttonSL, BorderLayout.EAST); // add a button for short list items <-> all items
|
||||||
}
|
}
|
||||||
else // Search or unstable - show text & button
|
else // Search or unstable - show text & button
|
||||||
{
|
{
|
||||||
|
@ -761,6 +807,8 @@ public class VLookup extends JComponent
|
||||||
actionBPartner(false);
|
actionBPartner(false);
|
||||||
else if (e.getSource() == m_location)
|
else if (e.getSource() == m_location)
|
||||||
actionLocation();
|
actionLocation();
|
||||||
|
else if (e.getSource() == m_buttonSL) // IDEMPIERE 90
|
||||||
|
actionShortList();
|
||||||
} // actionPerformed
|
} // actionPerformed
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -1463,7 +1511,7 @@ public class VLookup extends JComponent
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
m_lookup.refresh();
|
m_lookup.refresh();
|
||||||
m_lookup.fillComboBox(isMandatory(), true, true, false);
|
m_lookup.fillComboBox(isMandatory(), true, true, false, isComboShortList()); // IDEMPIERE 90
|
||||||
m_combo.setSelectedItem(obj);
|
m_combo.setSelectedItem(obj);
|
||||||
//m_combo.revalidate();
|
//m_combo.revalidate();
|
||||||
}
|
}
|
||||||
|
@ -1501,7 +1549,7 @@ public class VLookup extends JComponent
|
||||||
+ " - Start Count=" + m_combo.getItemCount() + ", Selected=" + obj);
|
+ " - Start Count=" + m_combo.getItemCount() + ", Selected=" + obj);
|
||||||
// log.fine( "VLookupHash=" + this.hashCode());
|
// log.fine( "VLookupHash=" + this.hashCode());
|
||||||
boolean popupVisible = m_combo.isPopupVisible();
|
boolean popupVisible = m_combo.isPopupVisible();
|
||||||
m_lookup.fillComboBox(isMandatory(), true, true, false); // only validated & active
|
m_lookup.fillComboBox(isMandatory(), true, true, false, isComboShortList()); // only validated & active + IDEMPIERE 90
|
||||||
if (popupVisible)
|
if (popupVisible)
|
||||||
{
|
{
|
||||||
//refresh
|
//refresh
|
||||||
|
@ -1525,6 +1573,7 @@ public class VLookup extends JComponent
|
||||||
{
|
{
|
||||||
if (e.isTemporary()
|
if (e.isTemporary()
|
||||||
|| m_lookup == null
|
|| m_lookup == null
|
||||||
|
|| !m_buttonSL.isEnabled() // IDEMPIERE 90
|
||||||
|| !m_button.isEnabled() ) // set by actionButton
|
|| !m_button.isEnabled() ) // set by actionButton
|
||||||
return;
|
return;
|
||||||
// Text Lost focus
|
// Text Lost focus
|
||||||
|
@ -1642,5 +1691,36 @@ public class VLookup extends JComponent
|
||||||
m_stopediting = stopediting;
|
m_stopediting = stopediting;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// IDEMPIERE 90
|
||||||
|
private void actionShortList ()
|
||||||
|
{
|
||||||
|
if (onlyShortListItems)
|
||||||
|
{
|
||||||
|
onlyShortListItems = false;
|
||||||
|
m_lookup.setShortList(true);
|
||||||
|
refresh();
|
||||||
|
m_lookup.fillComboBox(isMandatory(), true, true, false, isComboShortList());
|
||||||
|
m_buttonSL.setIcon(Env.getImageIcon("LockX16.gif"));
|
||||||
|
m_buttonSL.setToolTipText(Msg.getMsg(Env.getCtx(), "ShortListOnlyShortListItems"));
|
||||||
|
}else{
|
||||||
|
onlyShortListItems = true;
|
||||||
|
m_lookup.setShortList(false);
|
||||||
|
m_buttonSL.setIcon(Env.getImageIcon("Lock16.gif"));
|
||||||
|
m_buttonSL.setToolTipText(Msg.getMsg(Env.getCtx(), "ShortListAllItems"));
|
||||||
|
}
|
||||||
|
|
||||||
|
actionRefresh();
|
||||||
|
} // actionShortList
|
||||||
|
|
||||||
|
public void setComboShortList (boolean shortList)
|
||||||
|
{
|
||||||
|
m_combo.setShortListSearch(shortList);
|
||||||
|
} // setComboShortList
|
||||||
|
|
||||||
|
public boolean isComboShortList()
|
||||||
|
{
|
||||||
|
return m_combo.isShortListSearch();
|
||||||
|
} // isComboShortList
|
||||||
|
// IDEMPIERE 90
|
||||||
|
|
||||||
} // VLookup
|
} // VLookup
|
|
@ -104,7 +104,7 @@ public class VPaymentEditor extends JComponent implements VEditor, ActionListene
|
||||||
{
|
{
|
||||||
// Don't have to fill up combobox if it is readonly
|
// Don't have to fill up combobox if it is readonly
|
||||||
if (!isReadOnly && isUpdateable)
|
if (!isReadOnly && isUpdateable)
|
||||||
m_lookup.fillComboBox (isMandatory(), true, true, false);
|
m_lookup.fillComboBox (isMandatory(), true, true, false, false); // IDEMPIERE 90
|
||||||
m_combo.setModel(m_lookup);
|
m_combo.setModel(m_lookup);
|
||||||
//
|
//
|
||||||
// AutoCompletion.enable(m_combo);
|
// AutoCompletion.enable(m_combo);
|
||||||
|
@ -472,7 +472,7 @@ public class VPaymentEditor extends JComponent implements VEditor, ActionListene
|
||||||
+ " - Start Count=" + m_combo.getItemCount() + ", Selected=" + obj);
|
+ " - Start Count=" + m_combo.getItemCount() + ", Selected=" + obj);
|
||||||
// log.fine( "VLookupHash=" + this.hashCode());
|
// log.fine( "VLookupHash=" + this.hashCode());
|
||||||
boolean popupVisible = m_combo.isPopupVisible();
|
boolean popupVisible = m_combo.isPopupVisible();
|
||||||
m_lookup.fillComboBox(isMandatory(), true, true, false); // only validated & active
|
m_lookup.fillComboBox(isMandatory(), true, true, false, false); // only validated & active + IDEMPIERE 90
|
||||||
if (popupVisible)
|
if (popupVisible)
|
||||||
{
|
{
|
||||||
//refresh
|
//refresh
|
||||||
|
|
|
@ -250,7 +250,7 @@ public class PosPayment extends CDialog implements PosKeyListener, VetoableChang
|
||||||
// Payment type selection
|
// Payment type selection
|
||||||
int AD_Column_ID = COLUMN_C_PAYMENT_V_TENDERTYPE; //C_Payment_v.TenderType
|
int AD_Column_ID = COLUMN_C_PAYMENT_V_TENDERTYPE; //C_Payment_v.TenderType
|
||||||
MLookup lookup = MLookupFactory.get(Env.getCtx(), 0, 0, AD_Column_ID, DisplayType.List);
|
MLookup lookup = MLookupFactory.get(Env.getCtx(), 0, 0, AD_Column_ID, DisplayType.List);
|
||||||
ArrayList<Object> types = lookup.getData(true, false, true, true);
|
ArrayList<Object> types = lookup.getData(true, false, true, true, false); // IDEMPIERE 90
|
||||||
|
|
||||||
DefaultComboBoxModel typeModel = new DefaultComboBoxModel(types.toArray());
|
DefaultComboBoxModel typeModel = new DefaultComboBoxModel(types.toArray());
|
||||||
tenderTypePick.setModel(typeModel);
|
tenderTypePick.setModel(typeModel);
|
||||||
|
|
|
@ -986,4 +986,21 @@ public class CComboBox extends JComboBox
|
||||||
}
|
}
|
||||||
} // ReducibleKeyListener
|
} // ReducibleKeyListener
|
||||||
|
|
||||||
|
// IDEMPIERE 90
|
||||||
|
/** show only short list items or all ? */
|
||||||
|
private boolean m_ShortListSearch = false;
|
||||||
|
|
||||||
|
/** set the editor to return only short list items */
|
||||||
|
public void setShortListSearch (boolean shortList)
|
||||||
|
{
|
||||||
|
m_ShortListSearch = shortList;
|
||||||
|
} // setShortListSearch
|
||||||
|
|
||||||
|
/** does the search should return only short list items ? */
|
||||||
|
public boolean isShortListSearch()
|
||||||
|
{
|
||||||
|
return m_ShortListSearch;
|
||||||
|
} // isShortListSearch
|
||||||
|
|
||||||
|
// IDEMPIERE 90
|
||||||
} // CComboBox
|
} // CComboBox
|
||||||
|
|
|
@ -51,6 +51,7 @@ import org.compiere.util.Language;
|
||||||
import org.zkforge.keylistener.Keylistener;
|
import org.zkforge.keylistener.Keylistener;
|
||||||
import org.zkoss.web.Attributes;
|
import org.zkoss.web.Attributes;
|
||||||
import org.zkoss.web.servlet.Servlets;
|
import org.zkoss.web.servlet.Servlets;
|
||||||
|
import org.zkoss.zk.au.out.AuScript;
|
||||||
import org.zkoss.zk.ui.Component;
|
import org.zkoss.zk.ui.Component;
|
||||||
import org.zkoss.zk.ui.Executions;
|
import org.zkoss.zk.ui.Executions;
|
||||||
import org.zkoss.zk.ui.Page;
|
import org.zkoss.zk.ui.Page;
|
||||||
|
@ -67,6 +68,7 @@ import org.zkoss.zk.ui.sys.ExecutionCtrl;
|
||||||
import org.zkoss.zk.ui.sys.ExecutionsCtrl;
|
import org.zkoss.zk.ui.sys.ExecutionsCtrl;
|
||||||
import org.zkoss.zk.ui.sys.SessionCtrl;
|
import org.zkoss.zk.ui.sys.SessionCtrl;
|
||||||
import org.zkoss.zk.ui.sys.Visualizer;
|
import org.zkoss.zk.ui.sys.Visualizer;
|
||||||
|
import org.zkoss.zk.ui.util.Clients;
|
||||||
import org.zkoss.zul.Window;
|
import org.zkoss.zul.Window;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -344,6 +346,8 @@ public class AdempiereWebUI extends Window implements EventListener<Event>, IWeb
|
||||||
keyListener.setPage(this.getPage());
|
keyListener.setPage(this.getPage());
|
||||||
keyListener.setCtrlKeys("@a@c@d@e@f@h@n@o@p@r@s@t@z@x@#left@#right@#up@#down@#home@#end#enter");
|
keyListener.setCtrlKeys("@a@c@d@e@f@h@n@o@p@r@s@t@z@x@#left@#right@#up@#down@#home@#end#enter");
|
||||||
keyListener.setAutoBlur(false);
|
keyListener.setAutoBlur(false);
|
||||||
|
|
||||||
|
Clients.response(new AuScript("zAu.cmd0.clearBusy()"));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -407,16 +407,16 @@ public final class AEnv
|
||||||
|
|
||||||
} // canAccessInfo
|
} // canAccessInfo
|
||||||
|
|
||||||
public static void actionRefresh(Lookup lookup, Object value, boolean mandatory)
|
public static void actionRefresh(Lookup lookup, Object value, boolean mandatory, boolean shortList) // IDEMPIERE 90
|
||||||
{
|
{
|
||||||
if (lookup == null)
|
if (lookup == null)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
lookup.refresh();
|
lookup.refresh();
|
||||||
if (lookup.isValidated())
|
if (lookup.isValidated())
|
||||||
lookup.fillComboBox(mandatory, false, false, false);
|
lookup.fillComboBox(mandatory, false, false, false, shortList); // IDEMPIERE 90
|
||||||
else
|
else
|
||||||
lookup.fillComboBox(mandatory, true, false, false);
|
lookup.fillComboBox(mandatory, true, false, false, shortList); // IDEMPIERE 90
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
|
|
|
@ -183,30 +183,33 @@ public class WAllocation extends Allocation
|
||||||
Rows rows = null;
|
Rows rows = null;
|
||||||
Row row = null;
|
Row row = null;
|
||||||
|
|
||||||
parameterLayout.setWidth("800px");
|
parameterLayout.setWidth("80%");
|
||||||
rows = parameterLayout.newRows();
|
rows = parameterLayout.newRows();
|
||||||
row = rows.newRow();
|
row = rows.newRow();
|
||||||
row.appendChild(bpartnerLabel.rightAlign());
|
row.appendCellChild(bpartnerLabel.rightAlign());
|
||||||
row.appendChild(bpartnerSearch.getComponent());
|
bpartnerSearch.getComponent().setHflex("true");
|
||||||
row.appendChild(dateLabel.rightAlign());
|
row.appendCellChild(bpartnerSearch.getComponent(),1);
|
||||||
row.appendChild(dateField.getComponent());
|
row.appendCellChild(dateLabel.rightAlign());
|
||||||
row.appendChild(organizationLabel.rightAlign());
|
row.appendCellChild(dateField.getComponent());
|
||||||
row.appendChild(organizationPick.getComponent());
|
row.appendCellChild(organizationLabel.rightAlign());
|
||||||
|
organizationPick.getComponent().setHflex("true");
|
||||||
|
row.appendCellChild(organizationPick.getComponent(),1);
|
||||||
|
|
||||||
row = rows.newRow();
|
row = rows.newRow();
|
||||||
row.appendCellChild(currencyLabel.rightAlign(),1);
|
row.appendCellChild(currencyLabel.rightAlign(),1);
|
||||||
|
currencyPick.getComponent().setHflex("true");
|
||||||
row.appendCellChild(currencyPick.getComponent(),1);
|
row.appendCellChild(currencyPick.getComponent(),1);
|
||||||
row.appendCellChild(multiCurrency,2);
|
row.appendCellChild(multiCurrency,2);
|
||||||
row.appendCellChild(new Space(),1);
|
row.appendCellChild(new Space(),1);
|
||||||
row.appendCellChild(new Space(),1);
|
row.appendCellChild(new Space(),1);
|
||||||
|
|
||||||
row = rows.newRow();
|
row = rows.newRow();
|
||||||
row.appendChild(new Space());
|
row.appendCellChild(new Space());
|
||||||
row.appendChild(autoWriteOff);
|
row.appendCellChild(autoWriteOff);
|
||||||
row.appendChild(new Space());
|
row.appendCellChild(new Space());
|
||||||
row.appendChild(new Space());
|
row.appendCellChild(new Space());
|
||||||
row.appendChild(new Space());
|
row.appendCellChild(new Space());
|
||||||
row.appendChild(new Space());
|
row.appendCellChild(new Space());
|
||||||
|
|
||||||
South south = new South();
|
South south = new South();
|
||||||
south.setStyle("border: none");
|
south.setStyle("border: none");
|
||||||
|
@ -217,14 +220,15 @@ public class WAllocation extends Allocation
|
||||||
allocationLayout.setWidth("600px");
|
allocationLayout.setWidth("600px");
|
||||||
rows = allocationLayout.newRows();
|
rows = allocationLayout.newRows();
|
||||||
row = rows.newRow();
|
row = rows.newRow();
|
||||||
row.appendChild(differenceLabel.rightAlign());
|
row.appendCellChild(differenceLabel.rightAlign());
|
||||||
row.appendChild(allocCurrencyLabel.rightAlign());
|
row.appendCellChild(allocCurrencyLabel.rightAlign());
|
||||||
row.appendChild(differenceField);
|
differenceField.setHflex("true");
|
||||||
row.appendChild(new Space());
|
row.appendCellChild(differenceField);
|
||||||
row.appendChild(chargeLabel.rightAlign());
|
row.appendCellChild(chargeLabel.rightAlign());
|
||||||
row.appendChild(chargePick.getComponent());
|
chargePick.getComponent().setHflex("true");
|
||||||
row.appendChild(new Space());
|
row.appendCellChild(chargePick.getComponent(),2);
|
||||||
row.appendChild(allocateButton);
|
allocateButton.setHflex("true");
|
||||||
|
row.appendCellChild(allocateButton);
|
||||||
|
|
||||||
paymentPanel.appendChild(paymentLayout);
|
paymentPanel.appendChild(paymentLayout);
|
||||||
paymentPanel.setWidth("100%");
|
paymentPanel.setWidth("100%");
|
||||||
|
|
|
@ -99,21 +99,25 @@ public class WInOutGen extends InOutGen implements IFormController, EventListene
|
||||||
lBPartner.setText(Msg.translate(Env.getCtx(), "C_BPartner_ID"));
|
lBPartner.setText(Msg.translate(Env.getCtx(), "C_BPartner_ID"));
|
||||||
|
|
||||||
Row row = form.getParameterPanel().newRows().newRow();
|
Row row = form.getParameterPanel().newRows().newRow();
|
||||||
row.appendChild(lWarehouse.rightAlign());
|
row.appendCellChild(lWarehouse.rightAlign());
|
||||||
row.appendChild(fWarehouse.getComponent());
|
fWarehouse.getComponent().setHflex("true");
|
||||||
row.appendChild(new Space());
|
row.appendCellChild(fWarehouse.getComponent());
|
||||||
row.appendChild(lBPartner.rightAlign());
|
row.appendCellChild(new Space());
|
||||||
row.appendChild(fBPartner.getComponent());
|
row.appendCellChild(lBPartner.rightAlign());
|
||||||
row.appendChild(new Space());
|
fBPartner.getComponent().setHflex("true");
|
||||||
|
row.appendCellChild(fBPartner.getComponent());
|
||||||
|
row.appendCellChild(new Space());
|
||||||
|
|
||||||
row = new Row();
|
row = new Row();
|
||||||
form.getParameterPanel().getRows().appendChild(row);
|
form.getParameterPanel().getRows().appendChild(row);
|
||||||
row.appendChild(lDocType.rightAlign());
|
row.appendCellChild(lDocType.rightAlign());
|
||||||
row.appendChild(cmbDocType);
|
cmbDocType.setHflex("true");
|
||||||
row.appendChild(new Space());
|
row.appendCellChild(cmbDocType);
|
||||||
row.appendChild(lDocAction.rightAlign());
|
row.appendCellChild(new Space());
|
||||||
row.appendChild(docAction.getComponent());
|
row.appendCellChild(lDocAction.rightAlign());
|
||||||
row.appendChild(new Space());
|
docAction.getComponent().setHflex("true");
|
||||||
|
row.appendCellChild(docAction.getComponent());
|
||||||
|
row.appendCellChild(new Space());
|
||||||
} // jbInit
|
} // jbInit
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -99,21 +99,25 @@ public class WInvoiceGen extends InvoiceGen implements IFormController, EventLis
|
||||||
lBPartner.setText(Msg.translate(Env.getCtx(), "C_BPartner_ID"));
|
lBPartner.setText(Msg.translate(Env.getCtx(), "C_BPartner_ID"));
|
||||||
|
|
||||||
Row row = form.getParameterPanel().newRows().newRow();
|
Row row = form.getParameterPanel().newRows().newRow();
|
||||||
row.appendChild(lOrg.rightAlign());
|
row.appendCellChild(lOrg.rightAlign());
|
||||||
row.appendChild(fOrg.getComponent());
|
fOrg.getComponent().setHflex("true");
|
||||||
row.appendChild(new Space());
|
row.appendCellChild(fOrg.getComponent());
|
||||||
row.appendChild(lBPartner.rightAlign());
|
row.appendCellChild(new Space());
|
||||||
row.appendChild(fBPartner.getComponent());
|
row.appendCellChild(lBPartner.rightAlign());
|
||||||
row.appendChild(new Space());
|
fBPartner.getComponent().setHflex("true");
|
||||||
|
row.appendCellChild(fBPartner.getComponent());
|
||||||
|
row.appendCellChild(new Space());
|
||||||
|
|
||||||
row = new Row();
|
row = new Row();
|
||||||
form.getParameterPanel().getRows().appendChild(row);
|
form.getParameterPanel().getRows().appendChild(row);
|
||||||
row.appendChild(lDocType.rightAlign());
|
row.appendCellChild(lDocType.rightAlign());
|
||||||
row.appendChild(cmbDocType);
|
cmbDocType.setHflex("true");
|
||||||
row.appendChild(new Space());
|
row.appendCellChild(cmbDocType);
|
||||||
row.appendChild(lDocAction.rightAlign());
|
row.appendCellChild(new Space());
|
||||||
row.appendChild(docAction.getComponent());
|
row.appendCellChild(lDocAction.rightAlign());
|
||||||
row.appendChild(new Space());
|
docAction.getComponent().setHflex("true");
|
||||||
|
row.appendCellChild(docAction.getComponent());
|
||||||
|
row.appendCellChild(new Space());
|
||||||
} // jbInit
|
} // jbInit
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -142,20 +142,24 @@ public class WTrxMaterial extends TrxMaterial
|
||||||
|
|
||||||
Rows rows = parameterLayout.newRows();
|
Rows rows = parameterLayout.newRows();
|
||||||
Row row = rows.newRow();
|
Row row = rows.newRow();
|
||||||
row.appendChild(orgLabel.rightAlign());
|
row.appendCellChild(orgLabel.rightAlign());
|
||||||
row.appendChild(orgField.getComponent());
|
orgField.getComponent().setHflex("true");
|
||||||
row.appendChild(mtypeLabel.rightAlign());
|
row.appendCellChild(orgField.getComponent());
|
||||||
row.appendChild(mtypeField.getComponent());
|
row.appendCellChild(mtypeLabel.rightAlign());
|
||||||
row.appendChild(dateFLabel.rightAlign());
|
mtypeField.getComponent().setHflex("true");
|
||||||
row.appendChild(dateFField.getComponent());
|
row.appendCellChild(mtypeField.getComponent());
|
||||||
|
row.appendCellChild(dateFLabel.rightAlign());
|
||||||
|
row.appendCellChild(dateFField.getComponent());
|
||||||
|
|
||||||
row = rows.newRow();
|
row = rows.newRow();
|
||||||
row.appendChild(locatorLabel.rightAlign());
|
row.appendCellChild(locatorLabel.rightAlign());
|
||||||
row.appendChild(locatorField.getComponent());
|
locatorField.getComponent().setHflex("true");
|
||||||
row.appendChild(productLabel.rightAlign());
|
row.appendCellChild(locatorField.getComponent());
|
||||||
row.appendChild(productField.getComponent());
|
row.appendCellChild(productLabel.rightAlign());
|
||||||
row.appendChild(dateTLabel.rightAlign());
|
productField.getComponent().setHflex("true");
|
||||||
row.appendChild(dateTField.getComponent());
|
row.appendCellChild(productField.getComponent());
|
||||||
|
row.appendCellChild(dateTLabel.rightAlign());
|
||||||
|
row.appendCellChild(dateTField.getComponent());
|
||||||
//
|
//
|
||||||
southPanel.appendChild(confirmPanel);
|
southPanel.appendChild(confirmPanel);
|
||||||
southPanel.appendChild(new Separator());
|
southPanel.appendChild(new Separator());
|
||||||
|
|
|
@ -14,12 +14,18 @@
|
||||||
package org.adempiere.webui.editor;
|
package org.adempiere.webui.editor;
|
||||||
|
|
||||||
|
|
||||||
|
import org.adempiere.webui.LayoutUtils;
|
||||||
|
import org.adempiere.webui.adwindow.ADWindow;
|
||||||
|
import org.adempiere.webui.adwindow.ADWindowContent;
|
||||||
|
import org.adempiere.webui.apps.AEnv;
|
||||||
import org.adempiere.webui.component.Button;
|
import org.adempiere.webui.component.Button;
|
||||||
|
import org.adempiere.webui.event.DialogEvents;
|
||||||
import org.adempiere.webui.event.ValueChangeEvent;
|
import org.adempiere.webui.event.ValueChangeEvent;
|
||||||
import org.adempiere.webui.window.WMediaDialog;
|
import org.adempiere.webui.window.WMediaDialog;
|
||||||
import org.compiere.model.GridField;
|
import org.compiere.model.GridField;
|
||||||
import org.compiere.util.CLogger;
|
import org.compiere.util.CLogger;
|
||||||
import org.zkoss.zk.ui.event.Event;
|
import org.zkoss.zk.ui.event.Event;
|
||||||
|
import org.zkoss.zk.ui.event.EventListener;
|
||||||
import org.zkoss.zk.ui.event.Events;
|
import org.zkoss.zk.ui.event.Events;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -34,6 +40,8 @@ public class WBinaryEditor extends WEditor
|
||||||
|
|
||||||
private boolean m_mandatory;
|
private boolean m_mandatory;
|
||||||
private Object m_data;
|
private Object m_data;
|
||||||
|
|
||||||
|
private ADWindow adwindow;
|
||||||
|
|
||||||
public WBinaryEditor(GridField gridField)
|
public WBinaryEditor(GridField gridField)
|
||||||
{
|
{
|
||||||
|
@ -124,20 +132,40 @@ public class WBinaryEditor extends WEditor
|
||||||
{
|
{
|
||||||
if (Events.ON_CLICK.equals(event.getName()))
|
if (Events.ON_CLICK.equals(event.getName()))
|
||||||
{
|
{
|
||||||
WMediaDialog dialog = new WMediaDialog(gridField.getHeader(), m_data);
|
final WMediaDialog dialog = new WMediaDialog(gridField.getHeader(), m_data);
|
||||||
if (!dialog.isCancel() && dialog.isChange())
|
dialog.addEventListener(DialogEvents.ON_WINDOW_CLOSE, new EventListener<Event>() {
|
||||||
{
|
|
||||||
Object oldValue = m_data;
|
@Override
|
||||||
Object newValue = dialog.getData();
|
public void onEvent(Event event) throws Exception {
|
||||||
if (oldValue != null && newValue != null && oldValue.equals(newValue)) {
|
if (adwindow != null)
|
||||||
return;
|
{
|
||||||
}
|
adwindow.getADWindowContent().hideBusyMask();
|
||||||
if (oldValue == null && newValue == null) {
|
adwindow = null;
|
||||||
return;
|
}
|
||||||
}
|
if (!dialog.isCancel() && dialog.isChange())
|
||||||
ValueChangeEvent changeEvent = new ValueChangeEvent(this, this.getColumnName(), oldValue, newValue);
|
{
|
||||||
super.fireValueChange(changeEvent);
|
Object oldValue = m_data;
|
||||||
setValue(newValue);
|
Object newValue = dialog.getData();
|
||||||
|
if (oldValue != null && newValue != null && oldValue.equals(newValue)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (oldValue == null && newValue == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
ValueChangeEvent changeEvent = new ValueChangeEvent(WBinaryEditor.this, getColumnName(), oldValue, newValue);
|
||||||
|
fireValueChange(changeEvent);
|
||||||
|
setValue(newValue);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
adwindow = ADWindow.findADWindow(getComponent());
|
||||||
|
if (adwindow != null) {
|
||||||
|
ADWindowContent content = adwindow.getADWindowContent();
|
||||||
|
content.showBusyMask();
|
||||||
|
content.getComponent().getParent().appendChild(dialog);
|
||||||
|
LayoutUtils.openOverlappedWindow(content.getComponent().getParent(), dialog, "middle_center");
|
||||||
|
} else {
|
||||||
|
AEnv.showWindow(dialog);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -36,6 +36,7 @@ import org.compiere.model.GridField;
|
||||||
import org.compiere.model.Lookup;
|
import org.compiere.model.Lookup;
|
||||||
import org.compiere.model.MBPartnerLocation;
|
import org.compiere.model.MBPartnerLocation;
|
||||||
import org.compiere.model.MLocation;
|
import org.compiere.model.MLocation;
|
||||||
|
import org.compiere.model.MTable;
|
||||||
import org.compiere.util.CLogger;
|
import org.compiere.util.CLogger;
|
||||||
import org.compiere.util.DisplayType;
|
import org.compiere.util.DisplayType;
|
||||||
import org.compiere.util.Env;
|
import org.compiere.util.Env;
|
||||||
|
@ -47,6 +48,7 @@ import org.zkoss.zk.ui.event.Event;
|
||||||
import org.zkoss.zk.ui.event.EventListener;
|
import org.zkoss.zk.ui.event.EventListener;
|
||||||
import org.zkoss.zk.ui.event.Events;
|
import org.zkoss.zk.ui.event.Events;
|
||||||
import org.zkoss.zul.Comboitem;
|
import org.zkoss.zul.Comboitem;
|
||||||
|
import org.zkoss.zul.Menuitem;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
|
@ -69,7 +71,10 @@ ContextMenuListener, IZoomableEditor
|
||||||
|
|
||||||
private Lookup lookup;
|
private Lookup lookup;
|
||||||
private Object oldValue;
|
private Object oldValue;
|
||||||
|
|
||||||
|
public static final String SHORT_LIST_EVENT = "SHORT_LIST"; // IDEMPIERE 90
|
||||||
|
protected boolean onlyShortListItems; // IDEMPIERE 90
|
||||||
|
|
||||||
public WTableDirEditor(GridField gridField)
|
public WTableDirEditor(GridField gridField)
|
||||||
{
|
{
|
||||||
super(new Combobox(), gridField);
|
super(new Combobox(), gridField);
|
||||||
|
@ -159,6 +164,34 @@ ContextMenuListener, IZoomableEditor
|
||||||
popupMenu = new WEditorPopupMenu(zoom, true, isShowPreference(), false, false, false, lookup);
|
popupMenu = new WEditorPopupMenu(zoom, true, isShowPreference(), false, false, false, lookup);
|
||||||
}
|
}
|
||||||
addChangeLogMenu(popupMenu);
|
addChangeLogMenu(popupMenu);
|
||||||
|
|
||||||
|
// IDEMPIERE 90
|
||||||
|
boolean isShortListAvailable = false; // Short List available for this lookup
|
||||||
|
if (lookup != null && (lookup.getDisplayType() == DisplayType.TableDir || lookup.getDisplayType() == DisplayType.Table)) // only for Table & TableDir
|
||||||
|
{
|
||||||
|
String tableName_temp = lookup.getColumnName(); // Returns AD_Org.AD_Org_ID
|
||||||
|
int posPoint = tableName_temp.indexOf(".");
|
||||||
|
String tableName = tableName_temp.substring(0, posPoint);
|
||||||
|
MTable table = MTable.get(Env.getCtx(), tableName);
|
||||||
|
isShortListAvailable = (table.getColumnIndex("IsShortList") >= 0);
|
||||||
|
if (isShortListAvailable)
|
||||||
|
{
|
||||||
|
onlyShortListItems=true;
|
||||||
|
lookup.setShortList(true);
|
||||||
|
getLabel().setText(">" + getGridField().getHeader() + "<");
|
||||||
|
actionRefresh();
|
||||||
|
|
||||||
|
// add in popup menu
|
||||||
|
Menuitem searchMode;
|
||||||
|
searchMode = new Menuitem();
|
||||||
|
searchMode.setAttribute(WEditorPopupMenu.EVENT_ATTRIBUTE, SHORT_LIST_EVENT);
|
||||||
|
searchMode.setLabel(Msg.getMsg(Env.getCtx(), "ShortListSwitchSearchMode"));
|
||||||
|
searchMode.setImage("/images/Lock16.png");
|
||||||
|
searchMode.addEventListener(Events.ON_CLICK, popupMenu);
|
||||||
|
popupMenu.appendChild(searchMode);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// IDEMPIERE 90
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -493,6 +526,25 @@ ContextMenuListener, IZoomableEditor
|
||||||
{
|
{
|
||||||
actionLocation();
|
actionLocation();
|
||||||
}
|
}
|
||||||
|
// IDEMPIERE 90
|
||||||
|
else if (SHORT_LIST_EVENT.equals(evt.getContextEvent()))
|
||||||
|
{
|
||||||
|
String champ = getGridField().getHeader();
|
||||||
|
|
||||||
|
if(onlyShortListItems)
|
||||||
|
{
|
||||||
|
onlyShortListItems=false;
|
||||||
|
lookup.setShortList(false);
|
||||||
|
actionRefresh();
|
||||||
|
getLabel().setText(champ);
|
||||||
|
}else{
|
||||||
|
onlyShortListItems=true;
|
||||||
|
lookup.setShortList(true);
|
||||||
|
actionRefresh();
|
||||||
|
getLabel().setText(">" + champ + "<");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// IDEMPIERE 90
|
||||||
}
|
}
|
||||||
|
|
||||||
public void propertyChange(PropertyChangeEvent evt)
|
public void propertyChange(PropertyChangeEvent evt)
|
||||||
|
|
|
@ -31,6 +31,7 @@ import java.util.Locale;
|
||||||
import java.util.Properties;
|
import java.util.Properties;
|
||||||
import java.util.logging.Level;
|
import java.util.logging.Level;
|
||||||
|
|
||||||
|
import org.adempiere.util.LogAuthFailure;
|
||||||
import org.adempiere.webui.LayoutUtils;
|
import org.adempiere.webui.LayoutUtils;
|
||||||
import org.adempiere.webui.apps.AEnv;
|
import org.adempiere.webui.apps.AEnv;
|
||||||
import org.adempiere.webui.component.Button;
|
import org.adempiere.webui.component.Button;
|
||||||
|
@ -100,6 +101,8 @@ public class LoginPanel extends Window implements EventListener<Event>
|
||||||
*/
|
*/
|
||||||
private static final long serialVersionUID = -3181808670168474967L;
|
private static final long serialVersionUID = -3181808670168474967L;
|
||||||
|
|
||||||
|
private static LogAuthFailure logAuthFailure = new LogAuthFailure();
|
||||||
|
|
||||||
private static final String ON_LOAD_TOKEN = "onLoadToken";
|
private static final String ON_LOAD_TOKEN = "onLoadToken";
|
||||||
private static CLogger logger = CLogger.getCLogger(LoginPanel.class);
|
private static CLogger logger = CLogger.getCLogger(LoginPanel.class);
|
||||||
|
|
||||||
|
@ -240,6 +243,8 @@ public class LoginPanel extends Window implements EventListener<Event>
|
||||||
div.setSclass(ITheme.LOGIN_BOX_FOOTER_CLASS);
|
div.setSclass(ITheme.LOGIN_BOX_FOOTER_CLASS);
|
||||||
ConfirmPanel pnlButtons = new ConfirmPanel(false, false, false, false, false, false, true);
|
ConfirmPanel pnlButtons = new ConfirmPanel(false, false, false, false, false, false, true);
|
||||||
pnlButtons.addActionListener(this);
|
pnlButtons.addActionListener(this);
|
||||||
|
Button okBtn = pnlButtons.getButton(ConfirmPanel.A_OK);
|
||||||
|
okBtn.setWidgetListener("onClick", "zAu.cmd0.showBusy(null)");
|
||||||
|
|
||||||
Button helpButton = pnlButtons.createButton(ConfirmPanel.A_HELP);
|
Button helpButton = pnlButtons.createButton(ConfirmPanel.A_HELP);
|
||||||
helpButton.addEventListener(Events.ON_CLICK, this);
|
helpButton.addEventListener(Events.ON_CLICK, this);
|
||||||
|
@ -522,13 +527,21 @@ public class LoginPanel extends Window implements EventListener<Event>
|
||||||
Session currSess = Executions.getCurrent().getDesktop().getSession();
|
Session currSess = Executions.getCurrent().getDesktop().getSession();
|
||||||
|
|
||||||
KeyNamePair clientsKNPairs[] = login.getClients(userId, userPassword);
|
KeyNamePair clientsKNPairs[] = login.getClients(userId, userPassword);
|
||||||
|
|
||||||
if (clientsKNPairs == null || clientsKNPairs.length == 0)
|
if (clientsKNPairs == null || clientsKNPairs.length == 0)
|
||||||
{
|
{
|
||||||
String loginErrMsg = login.getLoginErrMsg();
|
String loginErrMsg = login.getLoginErrMsg();
|
||||||
if (loginErrMsg != null && loginErrMsg.length() > 0)
|
if (Util.isEmpty(loginErrMsg))
|
||||||
throw new WrongValueException(loginErrMsg);
|
loginErrMsg = Msg.getMsg(ctx,"FailedLogin", true);
|
||||||
else
|
|
||||||
throw new WrongValueException(Msg.getMsg(ctx,"FailedLogin", true));
|
// IDEMPIERE-617
|
||||||
|
String x_Forward_IP = Executions.getCurrent().getHeader("X-Forwarded-For");
|
||||||
|
if (x_Forward_IP == null) {
|
||||||
|
x_Forward_IP = currSess.getRemoteAddr();
|
||||||
|
}
|
||||||
|
logAuthFailure.log(x_Forward_IP, "/webui", userId, loginErrMsg);
|
||||||
|
|
||||||
|
throw new WrongValueException(loginErrMsg);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
|
@ -51,6 +51,7 @@ import org.zkoss.zhtml.Table;
|
||||||
import org.zkoss.zhtml.Td;
|
import org.zkoss.zhtml.Td;
|
||||||
import org.zkoss.zhtml.Tr;
|
import org.zkoss.zhtml.Tr;
|
||||||
import org.zkoss.zk.au.out.AuFocus;
|
import org.zkoss.zk.au.out.AuFocus;
|
||||||
|
import org.zkoss.zk.au.out.AuScript;
|
||||||
import org.zkoss.zk.ui.WrongValueException;
|
import org.zkoss.zk.ui.WrongValueException;
|
||||||
import org.zkoss.zk.ui.event.Deferrable;
|
import org.zkoss.zk.ui.event.Deferrable;
|
||||||
import org.zkoss.zk.ui.event.Event;
|
import org.zkoss.zk.ui.event.Event;
|
||||||
|
@ -136,6 +137,7 @@ public class RolePanel extends Window implements EventListener<Event>, Deferrabl
|
||||||
|
|
||||||
private void init()
|
private void init()
|
||||||
{
|
{
|
||||||
|
Clients.response(new AuScript("zAu.cmd0.clearBusy()"));
|
||||||
Div div = new Div();
|
Div div = new Div();
|
||||||
div.setSclass(ITheme.LOGIN_BOX_HEADER_CLASS);
|
div.setSclass(ITheme.LOGIN_BOX_HEADER_CLASS);
|
||||||
Label label = new Label("Login");
|
Label label = new Label("Login");
|
||||||
|
@ -225,6 +227,9 @@ public class RolePanel extends Window implements EventListener<Event>, Deferrabl
|
||||||
div.setSclass(ITheme.LOGIN_BOX_FOOTER_CLASS);
|
div.setSclass(ITheme.LOGIN_BOX_FOOTER_CLASS);
|
||||||
ConfirmPanel pnlButtons = new ConfirmPanel(true, false, false, false, false, false, true);
|
ConfirmPanel pnlButtons = new ConfirmPanel(true, false, false, false, false, false, true);
|
||||||
pnlButtons.addActionListener(this);
|
pnlButtons.addActionListener(this);
|
||||||
|
Button okBtn = pnlButtons.getButton(ConfirmPanel.A_OK);
|
||||||
|
okBtn.setWidgetListener("onClick", "zAu.cmd0.showBusy(null)");
|
||||||
|
|
||||||
LayoutUtils.addSclass(ITheme.LOGIN_BOX_FOOTER_PANEL_CLASS, pnlButtons);
|
LayoutUtils.addSclass(ITheme.LOGIN_BOX_FOOTER_PANEL_CLASS, pnlButtons);
|
||||||
pnlButtons.setWidth(null);
|
pnlButtons.setWidth(null);
|
||||||
pnlButtons.getButton(ConfirmPanel.A_OK).setSclass(ITheme.LOGIN_BUTTON_CLASS);
|
pnlButtons.getButton(ConfirmPanel.A_OK).setSclass(ITheme.LOGIN_BUTTON_CLASS);
|
||||||
|
|
|
@ -229,12 +229,12 @@ public class AboutWindow extends Window implements EventListener<Event> {
|
||||||
levelListBox.setEnabled(true);
|
levelListBox.setEnabled(true);
|
||||||
levelListBox.setTooltiptext("Set trace level. Warning: this will effect all session not just the current session");
|
levelListBox.setTooltiptext("Set trace level. Warning: this will effect all session not just the current session");
|
||||||
levelLabel.setTooltiptext("Set trace level. Warning: this will effect all session not just the current session");
|
levelLabel.setTooltiptext("Set trace level. Warning: this will effect all session not just the current session");
|
||||||
btnAdempiereLog = new Button("Adempiere Log");
|
btnAdempiereLog = new Button("iDempiere Log");
|
||||||
btnAdempiereLog.setTooltiptext("Download adempiere log file from server");
|
btnAdempiereLog.setTooltiptext("Download iDempiere log file from server");
|
||||||
btnAdempiereLog.addEventListener(Events.ON_CLICK, this);
|
btnAdempiereLog.addEventListener(Events.ON_CLICK, this);
|
||||||
|
|
||||||
btnServerLog = new Button("JBoss Log");
|
btnServerLog = new Button("Server Log");
|
||||||
btnServerLog.setTooltiptext("Download JBoss console log file from server");
|
btnServerLog.setTooltiptext("Download iDempiere server log file");
|
||||||
btnServerLog.addEventListener(Events.ON_CLICK, this);
|
btnServerLog.addEventListener(Events.ON_CLICK, this);
|
||||||
|
|
||||||
hbox.appendChild(new Space());
|
hbox.appendChild(new Space());
|
||||||
|
|
|
@ -73,6 +73,7 @@ public class LoginWindow extends FWindow implements EventListener<Event>
|
||||||
init();
|
init();
|
||||||
// add listener on 'ENTER' key for the login window
|
// add listener on 'ENTER' key for the login window
|
||||||
addEventListener(Events.ON_OK,this);
|
addEventListener(Events.ON_OK,this);
|
||||||
|
setWidgetListener("onOK", "zAu.cmd0.showBusy(null)");
|
||||||
}
|
}
|
||||||
|
|
||||||
private void init()
|
private void init()
|
||||||
|
@ -135,11 +136,13 @@ public class LoginWindow extends FWindow implements EventListener<Event>
|
||||||
{
|
{
|
||||||
rolePanel.validateRoles();
|
rolePanel.validateRoles();
|
||||||
}
|
}
|
||||||
|
else
|
||||||
LoginPanel loginPanel = (LoginPanel)this.getFellowIfAny("loginPanel");
|
|
||||||
if (loginPanel != null)
|
|
||||||
{
|
{
|
||||||
loginPanel.validateLogin();
|
LoginPanel loginPanel = (LoginPanel)this.getFellowIfAny("loginPanel");
|
||||||
|
if (loginPanel != null)
|
||||||
|
{
|
||||||
|
loginPanel.validateLogin();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -328,7 +328,7 @@ public class WLocatorDialog extends Window implements EventListener<Event>
|
||||||
|
|
||||||
// Load existing Locators
|
// Load existing Locators
|
||||||
|
|
||||||
m_mLocator.fillComboBox(m_mandatory, true, true, false);
|
m_mLocator.fillComboBox(m_mandatory, true, true, false, false); // IDEMPIERE 90
|
||||||
|
|
||||||
log.fine(m_mLocator.toString());
|
log.fine(m_mLocator.toString());
|
||||||
|
|
||||||
|
|
|
@ -21,11 +21,10 @@ import java.sql.Clob;
|
||||||
import java.sql.SQLException;
|
import java.sql.SQLException;
|
||||||
import java.util.logging.Level;
|
import java.util.logging.Level;
|
||||||
|
|
||||||
import org.adempiere.webui.AdempiereWebUI;
|
|
||||||
import org.adempiere.webui.apps.AEnv;
|
|
||||||
import org.adempiere.webui.component.Button;
|
import org.adempiere.webui.component.Button;
|
||||||
import org.adempiere.webui.component.Panel;
|
import org.adempiere.webui.component.Panel;
|
||||||
import org.adempiere.webui.component.Window;
|
import org.adempiere.webui.component.Window;
|
||||||
|
import org.adempiere.webui.component.ZkCssHelper;
|
||||||
import org.compiere.util.CLogger;
|
import org.compiere.util.CLogger;
|
||||||
import org.compiere.util.Env;
|
import org.compiere.util.Env;
|
||||||
import org.compiere.util.Msg;
|
import org.compiere.util.Msg;
|
||||||
|
@ -40,7 +39,6 @@ import org.zkoss.zul.Center;
|
||||||
import org.zkoss.zul.North;
|
import org.zkoss.zul.North;
|
||||||
import org.zkoss.zul.South;
|
import org.zkoss.zul.South;
|
||||||
import org.zkoss.zul.Filedownload;
|
import org.zkoss.zul.Filedownload;
|
||||||
import org.zkoss.zul.Fileupload;
|
|
||||||
import org.zkoss.zul.Hbox;
|
import org.zkoss.zul.Hbox;
|
||||||
import org.zkoss.zul.Iframe;
|
import org.zkoss.zul.Iframe;
|
||||||
|
|
||||||
|
@ -102,14 +100,6 @@ public class WMediaDialog extends Window implements EventListener<Event>
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
log.log(Level.SEVERE, "", ex);
|
log.log(Level.SEVERE, "", ex);
|
||||||
}
|
|
||||||
|
|
||||||
try
|
|
||||||
{
|
|
||||||
AEnv.showWindow(this);
|
|
||||||
}
|
|
||||||
catch (Exception e)
|
|
||||||
{
|
|
||||||
}
|
}
|
||||||
} // WAttachment
|
} // WAttachment
|
||||||
|
|
||||||
|
@ -132,7 +122,7 @@ public class WMediaDialog extends Window implements EventListener<Event>
|
||||||
void staticInit() throws Exception
|
void staticInit() throws Exception
|
||||||
{
|
{
|
||||||
this.setWidth("500px");
|
this.setWidth("500px");
|
||||||
this.setHeight("600px");
|
this.setHeight("500px");
|
||||||
this.setClosable(true);
|
this.setClosable(true);
|
||||||
this.setBorder("normal");
|
this.setBorder("normal");
|
||||||
this.appendChild(mainPanel);
|
this.appendChild(mainPanel);
|
||||||
|
@ -159,13 +149,15 @@ public class WMediaDialog extends Window implements EventListener<Event>
|
||||||
|
|
||||||
bLoad.setImage("/images/Import24.png");
|
bLoad.setImage("/images/Import24.png");
|
||||||
bLoad.setTooltiptext(Msg.getMsg(Env.getCtx(), "Load"));
|
bLoad.setTooltiptext(Msg.getMsg(Env.getCtx(), "Load"));
|
||||||
bLoad.addEventListener(Events.ON_CLICK, this);
|
bLoad.addEventListener(Events.ON_UPLOAD, this);
|
||||||
|
bLoad.setUpload("true");
|
||||||
|
|
||||||
bDelete.setImage("/images/Delete24.png");
|
bDelete.setImage("/images/Delete24.png");
|
||||||
bDelete.setTooltiptext(Msg.getMsg(Env.getCtx(), "Delete"));
|
bDelete.setTooltiptext(Msg.getMsg(Env.getCtx(), "Delete"));
|
||||||
bDelete.addEventListener(Events.ON_CLICK, this);
|
bDelete.addEventListener(Events.ON_CLICK, this);
|
||||||
|
|
||||||
previewPanel.appendChild(preview);
|
previewPanel.appendChild(preview);
|
||||||
|
ZkCssHelper.appendStyle(previewPanel, "margin-top: 10px; margin-bottom: 10px;");
|
||||||
preview.setHeight("100%");
|
preview.setHeight("100%");
|
||||||
preview.setWidth("100%");
|
preview.setWidth("100%");
|
||||||
|
|
||||||
|
@ -188,9 +180,7 @@ public class WMediaDialog extends Window implements EventListener<Event>
|
||||||
bCancel.addEventListener(Events.ON_CLICK, this);
|
bCancel.addEventListener(Events.ON_CLICK, this);
|
||||||
|
|
||||||
confirmPanel.appendChild(bOk);
|
confirmPanel.appendChild(bOk);
|
||||||
confirmPanel.appendChild(bCancel);
|
confirmPanel.appendChild(bCancel);
|
||||||
|
|
||||||
addEventListener(Events.ON_UPLOAD, this);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -301,11 +291,6 @@ public class WMediaDialog extends Window implements EventListener<Event>
|
||||||
displayData();
|
displayData();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Load Attachment
|
|
||||||
|
|
||||||
else if (e.getTarget() == bLoad)
|
|
||||||
loadFile();
|
|
||||||
|
|
||||||
// Open Attachment
|
// Open Attachment
|
||||||
|
|
||||||
else if (e.getTarget() == bSave)
|
else if (e.getTarget() == bSave)
|
||||||
|
@ -319,17 +304,6 @@ public class WMediaDialog extends Window implements EventListener<Event>
|
||||||
}
|
}
|
||||||
} // onEvent
|
} // onEvent
|
||||||
|
|
||||||
/**************************************************************************
|
|
||||||
* Load file
|
|
||||||
*/
|
|
||||||
|
|
||||||
private void loadFile()
|
|
||||||
{
|
|
||||||
Media media = Fileupload.get();
|
|
||||||
if (AdempiereWebUI.isEventThreadEnabled())
|
|
||||||
processUploadMedia(media);
|
|
||||||
} // getFileName
|
|
||||||
|
|
||||||
private void processUploadMedia(Media media) {
|
private void processUploadMedia(Media media) {
|
||||||
if (media == null)
|
if (media == null)
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -96,8 +96,6 @@ zkforge.KeyListener = zk.$extends(zul.Widget, {
|
||||||
}
|
}
|
||||||
|
|
||||||
evt.preventDefault();
|
evt.preventDefault();
|
||||||
evt.stopImmediatePropagation();
|
|
||||||
evt.stop();
|
|
||||||
|
|
||||||
zAu.send(new zk.Event(zk.Widget.$(this), 'onCtrlKey', {keyCode: keycode, ctrlKey: evt.ctrlKey, shiftKey: evt.shiftKey, altKey: evt.altKey}, {toServer: true}));
|
zAu.send(new zk.Event(zk.Widget.$(this), 'onCtrlKey', {keyCode: keycode, ctrlKey: evt.ctrlKey, shiftKey: evt.shiftKey, altKey: evt.altKey}, {toServer: true}));
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
<?page title="Adempiere" contentType="text/html;charset=UTF-8" automaticTimeout="false" ?>
|
<?page title="iDempiere" contentType="text/html;charset=UTF-8" automaticTimeout="false" ?>
|
||||||
<zk>
|
<zk>
|
||||||
<zscript>
|
<zscript>
|
||||||
<![CDATA[
|
<![CDATA[
|
||||||
|
|
|
@ -19,12 +19,12 @@ public class ADLookup {
|
||||||
protected static CLogger log = CLogger.getCLogger(ADLookup.class);
|
protected static CLogger log = CLogger.getCLogger(ADLookup.class);
|
||||||
|
|
||||||
|
|
||||||
public static void fillLookupValues( LookupValues lvs, Lookup lookup, boolean isMandatory, boolean isReadOnly )
|
public static void fillLookupValues( LookupValues lvs, Lookup lookup, boolean isMandatory, boolean isReadOnly, boolean isShortList) // IDEMPIERE 90
|
||||||
{
|
{
|
||||||
|
|
||||||
if(lookup.getSize() == 0)
|
if(lookup.getSize() == 0)
|
||||||
lookup.refresh();
|
lookup.refresh();
|
||||||
Object[] list = lookup.getData(isMandatory, true, !isReadOnly, false).toArray();
|
Object[] list = lookup.getData(isMandatory, true, !isReadOnly, false, isShortList).toArray(); // IDEMPIERE 90
|
||||||
|
|
||||||
for (int i=0; i<list.length; i++)
|
for (int i=0; i<list.length; i++)
|
||||||
{
|
{
|
||||||
|
|
|
@ -966,7 +966,7 @@ public class ModelADServiceImpl extends AbstractService implements ModelADServic
|
||||||
}
|
}
|
||||||
if (lookup.getSize() == 0)
|
if (lookup.getSize() == 0)
|
||||||
lookup.refresh();
|
lookup.refresh();
|
||||||
Object[] list = lookup.getData(true, true, true, false).toArray();
|
Object[] list = lookup.getData(true, true, true, false,false).toArray(); // IDEMPIERE 90
|
||||||
|
|
||||||
for (Object pair : list) {
|
for (Object pair : list) {
|
||||||
if (pair instanceof KeyNamePair) {
|
if (pair instanceof KeyNamePair) {
|
||||||
|
|
|
@ -137,7 +137,7 @@ public class Process {
|
||||||
LookupValues lvs = p.addNewLookup();
|
LookupValues lvs = p.addNewLookup();
|
||||||
Lookup lookup = para.getLookup();
|
Lookup lookup = para.getLookup();
|
||||||
try {
|
try {
|
||||||
ADLookup.fillLookupValues( lvs, lookup, para.isMandatory(), false /*isReadOnly*/ );
|
ADLookup.fillLookupValues( lvs, lookup, para.isMandatory(), false /*isReadOnly*/, false ); // IDEMPIERE 90
|
||||||
} catch (Exception ex) {
|
} catch (Exception ex) {
|
||||||
System.out.println("getProcessParams exception: " +ex.getMessage());
|
System.out.println("getProcessParams exception: " +ex.getMessage());
|
||||||
ex.printStackTrace();
|
ex.printStackTrace();
|
||||||
|
|
Loading…
Reference in New Issue