Merge release-7.1 into master
This commit is contained in:
commit
55dc83de87
|
|
@ -0,0 +1,10 @@
|
||||||
|
SET SQLBLANKLINES ON
|
||||||
|
SET DEFINE OFF
|
||||||
|
|
||||||
|
-- IDEMPIERE-4152 - Payment Allocation : notify user when date changes
|
||||||
|
-- 2020-01-21 02:03:32
|
||||||
|
INSERT INTO AD_Message (MsgType,MsgText,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,AD_Message_ID,Value,EntityType,AD_Message_UU) VALUES ('I','Allocation date updated',0,0,'Y',TO_DATE('2020-01-21 14:03:32','YYYY-MM-DD HH24:MI:SS'),100,TO_DATE('2020-01-21 14:03:32','YYYY-MM-DD HH24:MI:SS'),100,200592,'AllocationDateUpdated','D','c5cb7231-9ccc-4219-aaab-46ac3de8a372')
|
||||||
|
;
|
||||||
|
|
||||||
|
SELECT register_migration_script('202001211400_IDEMPIERE-4152.sql') FROM dual
|
||||||
|
;
|
||||||
|
|
@ -0,0 +1,4 @@
|
||||||
|
-- placeholder - just for postgresql
|
||||||
|
SELECT register_migration_script('202001211654_IDEMPIERE-4143.sql') FROM dual
|
||||||
|
;
|
||||||
|
|
||||||
|
|
@ -0,0 +1,7 @@
|
||||||
|
-- IDEMPIERE-4152 - Payment Allocation : notify user when date changes
|
||||||
|
-- 2020-01-21 02:03:32
|
||||||
|
INSERT INTO AD_Message (MsgType,MsgText,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,AD_Message_ID,Value,EntityType,AD_Message_UU) VALUES ('I','Allocation date updated',0,0,'Y',TO_TIMESTAMP('2020-01-21 14:03:32','YYYY-MM-DD HH24:MI:SS'),100,TO_TIMESTAMP('2020-01-21 14:03:32','YYYY-MM-DD HH24:MI:SS'),100,200592,'AllocationDateUpdated','D','c5cb7231-9ccc-4219-aaab-46ac3de8a372')
|
||||||
|
;
|
||||||
|
|
||||||
|
SELECT register_migration_script('202001211400_IDEMPIERE-4152.sql') FROM dual
|
||||||
|
;
|
||||||
|
|
@ -0,0 +1,4 @@
|
||||||
|
ALTER FUNCTION documentNo(numeric) OWNER TO adempiere;
|
||||||
|
SELECT register_migration_script('202001211654_IDEMPIERE-4143.sql') FROM dual
|
||||||
|
;
|
||||||
|
|
||||||
|
|
@ -549,7 +549,8 @@ public class Doc_MatchPO extends Doc
|
||||||
if (m_oLine.getC_Currency_ID() != as.getC_Currency_ID())
|
if (m_oLine.getC_Currency_ID() != as.getC_Currency_ID())
|
||||||
{
|
{
|
||||||
MOrder order = m_oLine.getParent();
|
MOrder order = m_oLine.getParent();
|
||||||
if(MAcctSchema.COSTINGMETHOD_AveragePO.equals(as.getCostingMethod()))
|
MProduct product = new MProduct(getCtx(), m_oLine.getM_Product_ID(), getTrxName());
|
||||||
|
if(MAcctSchema.COSTINGMETHOD_AveragePO.equals(product.getCostingMethod(as)))
|
||||||
{
|
{
|
||||||
orderCost = mPO[i].getM_InOutLine().getC_OrderLine().getPriceActual();
|
orderCost = mPO[i].getM_InOutLine().getC_OrderLine().getPriceActual();
|
||||||
Timestamp dateAcct = mPO[i].getM_InOutLine().getM_InOut().getDateAcct();
|
Timestamp dateAcct = mPO[i].getM_InOutLine().getM_InOut().getDateAcct();
|
||||||
|
|
|
||||||
|
|
@ -63,6 +63,7 @@ public class MColumn extends X_AD_Column
|
||||||
* Get MColumn from Cache
|
* Get MColumn from Cache
|
||||||
* @param ctx context
|
* @param ctx context
|
||||||
* @param AD_Column_ID id
|
* @param AD_Column_ID id
|
||||||
|
* @param trxName trx
|
||||||
* @return MColumn
|
* @return MColumn
|
||||||
*/
|
*/
|
||||||
public static MColumn get(Properties ctx, int AD_Column_ID, String trxName)
|
public static MColumn get(Properties ctx, int AD_Column_ID, String trxName)
|
||||||
|
|
@ -807,11 +808,11 @@ public class MColumn extends X_AD_Column
|
||||||
if (DisplayType.TableDir == refid || (DisplayType.Search == refid && getAD_Reference_Value_ID() == 0)) {
|
if (DisplayType.TableDir == refid || (DisplayType.Search == refid && getAD_Reference_Value_ID() == 0)) {
|
||||||
foreignTable = getColumnName().substring(0, getColumnName().length()-3);
|
foreignTable = getColumnName().substring(0, getColumnName().length()-3);
|
||||||
} else if (DisplayType.Table == refid || DisplayType.Search == refid) {
|
} else if (DisplayType.Table == refid || DisplayType.Search == refid) {
|
||||||
MReference ref = MReference.get(getCtx(), getAD_Reference_Value_ID());
|
MReference ref = MReference.get(getCtx(), getAD_Reference_Value_ID(), get_TrxName());
|
||||||
if (MReference.VALIDATIONTYPE_TableValidation.equals(ref.getValidationType())) {
|
if (MReference.VALIDATIONTYPE_TableValidation.equals(ref.getValidationType())) {
|
||||||
int cnt = DB.getSQLValueEx(get_TrxName(), "SELECT COUNT(*) FROM AD_Ref_Table WHERE AD_Reference_ID=?", getAD_Reference_Value_ID());
|
int cnt = DB.getSQLValueEx(get_TrxName(), "SELECT COUNT(*) FROM AD_Ref_Table WHERE AD_Reference_ID=?", getAD_Reference_Value_ID());
|
||||||
if (cnt == 1) {
|
if (cnt == 1) {
|
||||||
MRefTable rt = MRefTable.get(getCtx(), getAD_Reference_Value_ID());
|
MRefTable rt = MRefTable.get(getCtx(), getAD_Reference_Value_ID(), get_TrxName());
|
||||||
if (rt != null)
|
if (rt != null)
|
||||||
foreignTable = rt.getAD_Table().getTableName();
|
foreignTable = rt.getAD_Table().getTableName();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -297,9 +297,9 @@ public class MProcessPara extends X_AD_Process_Para
|
||||||
|| (DisplayType.Search == getAD_Reference_ID() && getAD_Reference_Value_ID() == 0)) {
|
|| (DisplayType.Search == getAD_Reference_ID() && getAD_Reference_Value_ID() == 0)) {
|
||||||
foreignTable = getColumnName().substring(0, getColumnName().length()-3);
|
foreignTable = getColumnName().substring(0, getColumnName().length()-3);
|
||||||
} else if (DisplayType.Table == getAD_Reference_ID() || DisplayType.Search == getAD_Reference_ID()) {
|
} else if (DisplayType.Table == getAD_Reference_ID() || DisplayType.Search == getAD_Reference_ID()) {
|
||||||
MReference ref = MReference.get(getCtx(), getAD_Reference_Value_ID());
|
MReference ref = MReference.get(getCtx(), getAD_Reference_Value_ID(), get_TrxName());
|
||||||
if (MReference.VALIDATIONTYPE_TableValidation.equals(ref.getValidationType())) {
|
if (MReference.VALIDATIONTYPE_TableValidation.equals(ref.getValidationType())) {
|
||||||
MRefTable rt = MRefTable.get(getCtx(), getAD_Reference_Value_ID());
|
MRefTable rt = MRefTable.get(getCtx(), getAD_Reference_Value_ID(), get_TrxName());
|
||||||
if (rt != null)
|
if (rt != null)
|
||||||
foreignTable = rt.getAD_Table().getTableName();
|
foreignTable = rt.getAD_Table().getTableName();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -27,7 +27,7 @@ public class MRefTable extends X_AD_Ref_Table
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
private static final long serialVersionUID = -699466856436251075L;
|
private static final long serialVersionUID = -3595900192339578282L;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Standard Constructor
|
* Standard Constructor
|
||||||
|
|
@ -68,19 +68,27 @@ public class MRefTable extends X_AD_Ref_Table
|
||||||
/** Ref Table Cache */
|
/** Ref Table Cache */
|
||||||
private static CCache<Integer,MRefTable> s_cache = new CCache<Integer,MRefTable>(Table_Name, 20);
|
private static CCache<Integer,MRefTable> s_cache = new CCache<Integer,MRefTable>(Table_Name, 20);
|
||||||
|
|
||||||
|
public static MRefTable get (Properties ctx, int AD_Reference_ID)
|
||||||
|
{
|
||||||
|
return get (ctx, AD_Reference_ID, null);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get from Cache
|
* Get from Cache
|
||||||
* @param ctx context
|
* @param ctx context
|
||||||
* @param AD_Reference_ID id
|
* @param AD_Reference_ID id
|
||||||
|
* @param trxName trx
|
||||||
* @return category
|
* @return category
|
||||||
*/
|
*/
|
||||||
public static MRefTable get (Properties ctx, int AD_Reference_ID)
|
public static MRefTable get (Properties ctx, int AD_Reference_ID, String trxName)
|
||||||
{
|
{
|
||||||
Integer ii = Integer.valueOf(AD_Reference_ID);
|
Integer ii = Integer.valueOf(AD_Reference_ID);
|
||||||
MRefTable retValue = (MRefTable)s_cache.get(ii);
|
MRefTable retValue = (MRefTable)s_cache.get(ii);
|
||||||
if (retValue != null)
|
if (retValue != null) {
|
||||||
|
retValue.set_TrxName(trxName);
|
||||||
return retValue;
|
return retValue;
|
||||||
retValue = new MRefTable (ctx, AD_Reference_ID, null);
|
}
|
||||||
|
retValue = new MRefTable (ctx, AD_Reference_ID, trxName);
|
||||||
if (retValue.get_ID () != 0)
|
if (retValue.get_ID () != 0)
|
||||||
s_cache.put (AD_Reference_ID, retValue);
|
s_cache.put (AD_Reference_ID, retValue);
|
||||||
return retValue;
|
return retValue;
|
||||||
|
|
|
||||||
|
|
@ -33,7 +33,7 @@ public class MReference extends X_AD_Reference {
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
private static final long serialVersionUID = 119105464164520763L;
|
private static final long serialVersionUID = 343092563490562893L;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Standard Constructor
|
* Standard Constructor
|
||||||
|
|
@ -61,19 +61,27 @@ public class MReference extends X_AD_Reference {
|
||||||
/** Reference Cache */
|
/** Reference Cache */
|
||||||
private static CCache<Integer,MReference> s_cache = new CCache<Integer,MReference>(Table_Name, 20);
|
private static CCache<Integer,MReference> s_cache = new CCache<Integer,MReference>(Table_Name, 20);
|
||||||
|
|
||||||
|
public static MReference get (Properties ctx, int AD_Reference_ID)
|
||||||
|
{
|
||||||
|
return get(ctx, AD_Reference_ID, null);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get from Cache
|
* Get from Cache
|
||||||
* @param ctx context
|
* @param ctx context
|
||||||
* @param AD_Reference_ID id
|
* @param AD_Reference_ID id
|
||||||
|
* @param trxName trx
|
||||||
* @return category
|
* @return category
|
||||||
*/
|
*/
|
||||||
public static MReference get (Properties ctx, int AD_Reference_ID)
|
public static MReference get (Properties ctx, int AD_Reference_ID, String trxName)
|
||||||
{
|
{
|
||||||
Integer ii = Integer.valueOf(AD_Reference_ID);
|
Integer ii = Integer.valueOf(AD_Reference_ID);
|
||||||
MReference retValue = (MReference)s_cache.get(ii);
|
MReference retValue = (MReference)s_cache.get(ii);
|
||||||
if (retValue != null)
|
if (retValue != null) {
|
||||||
|
retValue.set_TrxName(trxName);
|
||||||
return retValue;
|
return retValue;
|
||||||
retValue = new MReference (ctx, AD_Reference_ID, null);
|
}
|
||||||
|
retValue = new MReference (ctx, AD_Reference_ID, trxName);
|
||||||
if (retValue.get_ID () != 0)
|
if (retValue.get_ID () != 0)
|
||||||
s_cache.put (AD_Reference_ID, retValue);
|
s_cache.put (AD_Reference_ID, retValue);
|
||||||
return retValue;
|
return retValue;
|
||||||
|
|
|
||||||
|
|
@ -9,6 +9,9 @@ import java.util.Properties;
|
||||||
|
|
||||||
import org.compiere.util.CCache;
|
import org.compiere.util.CCache;
|
||||||
import org.compiere.util.Env;
|
import org.compiere.util.Env;
|
||||||
|
import org.compiere.util.Evaluatee;
|
||||||
|
import org.compiere.util.Evaluator;
|
||||||
|
import org.compiere.util.Util;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author hengsin
|
* @author hengsin
|
||||||
|
|
@ -18,7 +21,7 @@ public class MStyle extends X_AD_Style {
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
private static final long serialVersionUID = 4988653330824933725L;
|
private static final long serialVersionUID = 712675285511854305L;
|
||||||
|
|
||||||
/** Cache */
|
/** Cache */
|
||||||
private static CCache<Integer,MStyle> s_cache = new CCache<Integer,MStyle>(Table_Name, 30, 60);
|
private static CCache<Integer,MStyle> s_cache = new CCache<Integer,MStyle>(Table_Name, 30, 60);
|
||||||
|
|
@ -55,4 +58,28 @@ public class MStyle extends X_AD_Style {
|
||||||
}
|
}
|
||||||
return m_lines;
|
return m_lines;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String buildStyle(String defaultTheme, Evaluatee evaluatee) {
|
||||||
|
X_AD_StyleLine[] lines = getStyleLines();
|
||||||
|
StringBuilder styleBuilder = new StringBuilder();
|
||||||
|
for (X_AD_StyleLine line : lines)
|
||||||
|
{
|
||||||
|
String inlineStyle = line.getInlineStyle().trim();
|
||||||
|
String displayLogic = line.getDisplayLogic();
|
||||||
|
String theme = line.getTheme();
|
||||||
|
if (!Util.isEmpty(theme)) {
|
||||||
|
if (!theme.equals(defaultTheme))
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if (!Util.isEmpty(displayLogic))
|
||||||
|
{
|
||||||
|
if (!Evaluator.evaluateLogic(evaluatee, displayLogic))
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if (styleBuilder.length() > 0 && !(styleBuilder.charAt(styleBuilder.length()-1)==';'))
|
||||||
|
styleBuilder.append("; ");
|
||||||
|
styleBuilder.append(inlineStyle);
|
||||||
|
}
|
||||||
|
return styleBuilder.toString();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -20,6 +20,8 @@ the License.
|
||||||
package fi.jawsy.jawwa.zk.atmosphere;
|
package fi.jawsy.jawwa.zk.atmosphere;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
import java.util.concurrent.atomic.AtomicReference;
|
import java.util.concurrent.atomic.AtomicReference;
|
||||||
|
|
||||||
import org.atmosphere.cpr.AtmosphereResource;
|
import org.atmosphere.cpr.AtmosphereResource;
|
||||||
|
|
@ -58,6 +60,7 @@ public class AtmosphereServerPush implements ServerPush {
|
||||||
private ThreadInfo _active;
|
private ThreadInfo _active;
|
||||||
private ExecutionCarryOver _carryOver;
|
private ExecutionCarryOver _carryOver;
|
||||||
private final Object _mutex = new Object();
|
private final Object _mutex = new Object();
|
||||||
|
private List<Schedule<Event>> schedules = new ArrayList<>();
|
||||||
|
|
||||||
public AtmosphereServerPush() {
|
public AtmosphereServerPush() {
|
||||||
String timeoutString = Library.getProperty("fi.jawsy.jawwa.zk.atmosphere.timeout");
|
String timeoutString = Library.getProperty("fi.jawsy.jawwa.zk.atmosphere.timeout");
|
||||||
|
|
@ -155,19 +158,42 @@ public class AtmosphereServerPush implements ServerPush {
|
||||||
return _active != null && _active.nActive > 0;
|
return _active != null && _active.nActive > 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@SuppressWarnings("unchecked")
|
||||||
|
@Override
|
||||||
public void onPiggyback() {
|
public void onPiggyback() {
|
||||||
|
Schedule<Event>[] pendings = null;
|
||||||
|
synchronized (schedules) {
|
||||||
|
if (!schedules.isEmpty()) {
|
||||||
|
pendings = schedules.toArray(new Schedule[0]);
|
||||||
|
schedules = new ArrayList<>();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (pendings != null && pendings.length > 0) {
|
||||||
|
for(Schedule<Event> p : pendings) {
|
||||||
|
p.scheduler.schedule(p.task, p.event);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@SuppressWarnings({ "unchecked", "rawtypes" })
|
||||||
|
@Override
|
||||||
public <T extends Event> void schedule(EventListener<T> task, T event,
|
public <T extends Event> void schedule(EventListener<T> task, T event,
|
||||||
Scheduler<T> scheduler) {
|
Scheduler<T> scheduler) {
|
||||||
scheduler.schedule(task, event);
|
if (Executions.getCurrent() == null) {
|
||||||
try {
|
//save for schedule at on piggyback event
|
||||||
commitResponse();
|
synchronized (schedules) {
|
||||||
} catch (IOException e) {
|
schedules.add(new Schedule(task, event, scheduler));
|
||||||
log.error(e.getLocalizedMessage(), e);
|
}
|
||||||
}
|
try {
|
||||||
|
commitResponse();
|
||||||
|
} catch (IOException e) {
|
||||||
|
log.error(e.getMessage(), e);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
//in event listener thread, can schedule immediately
|
||||||
|
scheduler.schedule(task, event);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
@ -238,4 +264,16 @@ public class AtmosphereServerPush implements ServerPush {
|
||||||
@Override
|
@Override
|
||||||
public void resume() {
|
public void resume() {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private class Schedule<T extends Event> {
|
||||||
|
private EventListener<T> task;
|
||||||
|
private T event;
|
||||||
|
private Scheduler<T> scheduler;
|
||||||
|
|
||||||
|
private Schedule(EventListener<T> task, T event, Scheduler<T> scheduler) {
|
||||||
|
this.task = task;
|
||||||
|
this.event = event;
|
||||||
|
this.scheduler = scheduler;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -523,9 +523,12 @@ public class AdempiereWebUI extends Window implements EventListener<Event>, IWeb
|
||||||
Env.setContext(properties, Env.LANGUAGE, Env.getContext(Env.getCtx(), Env.LANGUAGE));
|
Env.setContext(properties, Env.LANGUAGE, Env.getContext(Env.getCtx(), Env.LANGUAGE));
|
||||||
Env.setContext(properties, AEnv.LOCALE, Env.getContext(Env.getCtx(), AEnv.LOCALE));
|
Env.setContext(properties, AEnv.LOCALE, Env.getContext(Env.getCtx(), AEnv.LOCALE));
|
||||||
|
|
||||||
Locale locale = (Locale) Executions.getCurrent().getDesktop().getSession().getAttribute(Attributes.PREFERRED_LOCALE);
|
Desktop desktop = Executions.getCurrent().getDesktop();
|
||||||
|
Locale locale = (Locale) desktop.getSession().getAttribute(Attributes.PREFERRED_LOCALE);
|
||||||
HttpServletRequest httpRequest = (HttpServletRequest) Executions.getCurrent().getNativeRequest();
|
HttpServletRequest httpRequest = (HttpServletRequest) Executions.getCurrent().getNativeRequest();
|
||||||
|
|
||||||
|
if (desktop.isServerPushEnabled())
|
||||||
|
desktop.enableServerPush(false);
|
||||||
Session session = logout0();
|
Session session = logout0();
|
||||||
|
|
||||||
//clear context and invalidate session
|
//clear context and invalidate session
|
||||||
|
|
|
||||||
|
|
@ -57,6 +57,7 @@ import org.adempiere.webui.editor.WebEditorFactory;
|
||||||
import org.adempiere.webui.event.ContextMenuListener;
|
import org.adempiere.webui.event.ContextMenuListener;
|
||||||
import org.adempiere.webui.panel.HelpController;
|
import org.adempiere.webui.panel.HelpController;
|
||||||
import org.adempiere.webui.session.SessionManager;
|
import org.adempiere.webui.session.SessionManager;
|
||||||
|
import org.adempiere.webui.theme.ThemeManager;
|
||||||
import org.adempiere.webui.util.GridTabDataBinder;
|
import org.adempiere.webui.util.GridTabDataBinder;
|
||||||
import org.adempiere.webui.util.TreeUtils;
|
import org.adempiere.webui.util.TreeUtils;
|
||||||
import org.adempiere.webui.util.ZKUpdateUtil;
|
import org.adempiere.webui.util.ZKUpdateUtil;
|
||||||
|
|
@ -71,6 +72,7 @@ import org.compiere.model.I_AD_Preference;
|
||||||
import org.compiere.model.MColumn;
|
import org.compiere.model.MColumn;
|
||||||
import org.compiere.model.MPreference;
|
import org.compiere.model.MPreference;
|
||||||
import org.compiere.model.MRole;
|
import org.compiere.model.MRole;
|
||||||
|
import org.compiere.model.MStyle;
|
||||||
import org.compiere.model.MSysConfig;
|
import org.compiere.model.MSysConfig;
|
||||||
import org.compiere.model.MTab;
|
import org.compiere.model.MTab;
|
||||||
import org.compiere.model.MTable;
|
import org.compiere.model.MTable;
|
||||||
|
|
@ -736,6 +738,25 @@ DataStatusListener, IADTabpanel, IdSpace, IFieldEditorContainer
|
||||||
Label label = new Label(field.getHeader());
|
Label label = new Label(field.getHeader());
|
||||||
Div div = new Div();
|
Div div = new Div();
|
||||||
div.setSclass("form-label-heading");
|
div.setSclass("form-label-heading");
|
||||||
|
if (field.getAD_FieldStyle_ID() > 0) {
|
||||||
|
MStyle style = MStyle.get(Env.getCtx(), field.getAD_FieldStyle_ID());
|
||||||
|
String cssStyle = style.buildStyle(ThemeManager.getTheme(), new Evaluatee() {
|
||||||
|
@Override
|
||||||
|
public String get_ValueAsString(String variableName) {
|
||||||
|
return field.get_ValueAsString(variableName);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
if (cssStyle != null && cssStyle.startsWith(MStyle.SCLASS_PREFIX)) {
|
||||||
|
String sclass = cssStyle.substring(MStyle.SCLASS_PREFIX.length());
|
||||||
|
div.setSclass(sclass);
|
||||||
|
} else if (style != null && cssStyle.startsWith(MStyle.ZCLASS_PREFIX)) {
|
||||||
|
String zclass = cssStyle.substring(MStyle.ZCLASS_PREFIX.length());
|
||||||
|
div.setZclass(zclass);
|
||||||
|
} else {
|
||||||
|
div.setStyle(cssStyle);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
row.appendCellChild(createSpacer());
|
row.appendCellChild(createSpacer());
|
||||||
div.appendChild(label);
|
div.appendChild(label);
|
||||||
row.appendCellChild(div);
|
row.appendCellChild(div);
|
||||||
|
|
|
||||||
|
|
@ -44,10 +44,8 @@ import org.compiere.model.GridField;
|
||||||
import org.compiere.model.GridTab;
|
import org.compiere.model.GridTab;
|
||||||
import org.compiere.model.MStyle;
|
import org.compiere.model.MStyle;
|
||||||
import org.compiere.model.MSysConfig;
|
import org.compiere.model.MSysConfig;
|
||||||
import org.compiere.model.X_AD_StyleLine;
|
|
||||||
import org.compiere.util.DisplayType;
|
import org.compiere.util.DisplayType;
|
||||||
import org.compiere.util.Env;
|
import org.compiere.util.Env;
|
||||||
import org.compiere.util.Evaluator;
|
|
||||||
import org.compiere.util.Msg;
|
import org.compiere.util.Msg;
|
||||||
import org.compiere.util.Util;
|
import org.compiere.util.Util;
|
||||||
import org.zkoss.zk.au.out.AuScript;
|
import org.zkoss.zk.au.out.AuScript;
|
||||||
|
|
@ -279,27 +277,7 @@ public class GridTabRowRenderer implements RowRenderer<Object[]>, RowRendererExt
|
||||||
|
|
||||||
GridRowCtx gridRowCtx = new GridRowCtx(Env.getCtx(), gridTab, rowIndex);
|
GridRowCtx gridRowCtx = new GridRowCtx(Env.getCtx(), gridTab, rowIndex);
|
||||||
MStyle style = MStyle.get(Env.getCtx(), AD_Style_ID);
|
MStyle style = MStyle.get(Env.getCtx(), AD_Style_ID);
|
||||||
X_AD_StyleLine[] lines = style.getStyleLines();
|
setComponentStyle(component, style.buildStyle(ThemeManager.getTheme(), gridRowCtx));
|
||||||
StringBuilder styleBuilder = new StringBuilder();
|
|
||||||
for (X_AD_StyleLine line : lines)
|
|
||||||
{
|
|
||||||
String inlineStyle = line.getInlineStyle().trim();
|
|
||||||
String displayLogic = line.getDisplayLogic();
|
|
||||||
String theme = line.getTheme();
|
|
||||||
if (!Util.isEmpty(theme)) {
|
|
||||||
if (!ThemeManager.getTheme().equals(theme))
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
if (!Util.isEmpty(displayLogic))
|
|
||||||
{
|
|
||||||
if (!Evaluator.evaluateLogic(gridRowCtx, displayLogic))
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
if (styleBuilder.length() > 0 && !(styleBuilder.charAt(styleBuilder.length()-1)==';'))
|
|
||||||
styleBuilder.append("; ");
|
|
||||||
styleBuilder.append(inlineStyle);
|
|
||||||
}
|
|
||||||
setComponentStyle(component, styleBuilder.toString());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void setComponentStyle(HtmlBasedComponent component, String style) {
|
protected void setComponentStyle(HtmlBasedComponent component, String style) {
|
||||||
|
|
|
||||||
|
|
@ -66,6 +66,7 @@ import org.compiere.util.TrxRunnable;
|
||||||
import org.compiere.util.Util;
|
import org.compiere.util.Util;
|
||||||
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.EventListener;
|
||||||
|
import org.zkoss.zk.ui.util.Clients;
|
||||||
import org.zkoss.zul.Borderlayout;
|
import org.zkoss.zul.Borderlayout;
|
||||||
import org.zkoss.zul.Center;
|
import org.zkoss.zul.Center;
|
||||||
import org.zkoss.zul.Div;
|
import org.zkoss.zul.Div;
|
||||||
|
|
@ -703,10 +704,15 @@ public class WAllocation extends Allocation
|
||||||
|
|
||||||
paymentInfo.setText(calculatePayment(paymentTable, multiCurrency.isSelected()));
|
paymentInfo.setText(calculatePayment(paymentTable, multiCurrency.isSelected()));
|
||||||
invoiceInfo.setText(calculateInvoice(invoiceTable, multiCurrency.isSelected()));
|
invoiceInfo.setText(calculateInvoice(invoiceTable, multiCurrency.isSelected()));
|
||||||
|
|
||||||
// Set AllocationDate
|
// Set AllocationDate
|
||||||
if (allocDate != null)
|
if (allocDate != null) {
|
||||||
dateField.setValue(allocDate);
|
if (! allocDate.equals(dateField.getValue())) {
|
||||||
|
Clients.showNotification(Msg.getMsg(Env.getCtx(), "AllocationDateUpdated"), Clients.NOTIFICATION_TYPE_INFO, dateField.getComponent(), "start_before", -1, false);
|
||||||
|
dateField.setValue(allocDate);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Set Allocation Currency
|
// Set Allocation Currency
|
||||||
allocCurrencyLabel.setText(currencyPick.getDisplay());
|
allocCurrencyLabel.setText(currencyPick.getDisplay());
|
||||||
// Difference
|
// Difference
|
||||||
|
|
|
||||||
|
|
@ -34,12 +34,9 @@ import org.compiere.minigrid.IDColumn;
|
||||||
import org.compiere.model.GridField;
|
import org.compiere.model.GridField;
|
||||||
import org.compiere.model.MInfoColumn;
|
import org.compiere.model.MInfoColumn;
|
||||||
import org.compiere.model.MStyle;
|
import org.compiere.model.MStyle;
|
||||||
import org.compiere.model.X_AD_StyleLine;
|
|
||||||
import org.compiere.util.Env;
|
import org.compiere.util.Env;
|
||||||
import org.compiere.util.Evaluatee;
|
import org.compiere.util.Evaluatee;
|
||||||
import org.compiere.util.Evaluator;
|
|
||||||
import org.compiere.util.KeyNamePair;
|
import org.compiere.util.KeyNamePair;
|
||||||
import org.compiere.util.Util;
|
|
||||||
import org.zkoss.zul.Listcell;
|
import org.zkoss.zul.Listcell;
|
||||||
|
|
||||||
public class WInfoWindowListItemRenderer extends WListItemRenderer
|
public class WInfoWindowListItemRenderer extends WListItemRenderer
|
||||||
|
|
@ -130,52 +127,28 @@ public class WInfoWindowListItemRenderer extends WListItemRenderer
|
||||||
if (gridField.getAD_FieldStyle_ID() > 0)
|
if (gridField.getAD_FieldStyle_ID() > 0)
|
||||||
{
|
{
|
||||||
MStyle style = MStyle.get(Env.getCtx(), gridField.getAD_FieldStyle_ID());
|
MStyle style = MStyle.get(Env.getCtx(), gridField.getAD_FieldStyle_ID());
|
||||||
X_AD_StyleLine[] lines = style.getStyleLines();
|
|
||||||
StringBuilder styleBuilder = new StringBuilder();
|
|
||||||
for (X_AD_StyleLine line : lines)
|
|
||||||
{
|
|
||||||
String inlineStyle = line.getInlineStyle().trim();
|
|
||||||
String displayLogic = line.getDisplayLogic();
|
|
||||||
String theme = line.getTheme();
|
|
||||||
if (!Util.isEmpty(theme)) {
|
|
||||||
if (!ThemeManager.getTheme().equals(theme))
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
if (!Util.isEmpty(displayLogic))
|
|
||||||
{
|
|
||||||
Evaluatee ev = new Evaluatee() {
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String get_ValueAsString(String variableName) {
|
|
||||||
String value = null;
|
|
||||||
|
|
||||||
int idx = 0;
|
|
||||||
for (MInfoColumn ic : gridDisplayedInfoColumns)
|
|
||||||
{
|
|
||||||
if (ic != null && ic.getColumnName().equals(variableName))
|
|
||||||
{
|
|
||||||
value = String.valueOf(table.getValueAt(rowIndex, idx));
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
idx++;
|
|
||||||
}
|
|
||||||
|
|
||||||
return value;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
if (!Evaluator.evaluateLogic(ev, displayLogic))
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (styleBuilder.length() > 0 && !(styleBuilder.charAt(styleBuilder.length()-1)==';'))
|
|
||||||
styleBuilder.append("; ");
|
|
||||||
styleBuilder.append(inlineStyle);
|
|
||||||
}
|
|
||||||
|
|
||||||
//devCoffee #5960
|
//devCoffee #5960
|
||||||
String styleStr = styleBuilder.toString();
|
String styleStr = style.buildStyle(ThemeManager.getTheme(), new Evaluatee() {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String get_ValueAsString(String variableName) {
|
||||||
|
String value = null;
|
||||||
|
|
||||||
|
int idx = 0;
|
||||||
|
for (MInfoColumn ic : gridDisplayedInfoColumns)
|
||||||
|
{
|
||||||
|
if (ic != null && ic.getColumnName().equals(variableName))
|
||||||
|
{
|
||||||
|
value = String.valueOf(table.getValueAt(rowIndex, idx));
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
idx++;
|
||||||
|
}
|
||||||
|
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
});
|
||||||
if (styleStr != null && styleStr.startsWith(MStyle.SCLASS_PREFIX)) {
|
if (styleStr != null && styleStr.startsWith(MStyle.SCLASS_PREFIX)) {
|
||||||
String sclass = styleStr.substring(MStyle.SCLASS_PREFIX.length());
|
String sclass = styleStr.substring(MStyle.SCLASS_PREFIX.length());
|
||||||
listcell.setSclass(sclass);
|
listcell.setSclass(sclass);
|
||||||
|
|
|
||||||
|
|
@ -44,11 +44,9 @@ import org.compiere.model.GridField;
|
||||||
import org.compiere.model.GridTab;
|
import org.compiere.model.GridTab;
|
||||||
import org.compiere.model.MRole;
|
import org.compiere.model.MRole;
|
||||||
import org.compiere.model.MStyle;
|
import org.compiere.model.MStyle;
|
||||||
import org.compiere.model.X_AD_StyleLine;
|
|
||||||
import org.compiere.util.DisplayType;
|
import org.compiere.util.DisplayType;
|
||||||
import org.compiere.util.Env;
|
import org.compiere.util.Env;
|
||||||
import org.compiere.util.Evaluatee;
|
import org.compiere.util.Evaluatee;
|
||||||
import org.compiere.util.Evaluator;
|
|
||||||
import org.compiere.util.Msg;
|
import org.compiere.util.Msg;
|
||||||
import org.compiere.util.Util;
|
import org.compiere.util.Util;
|
||||||
import org.zkoss.zk.ui.Component;
|
import org.zkoss.zk.ui.Component;
|
||||||
|
|
@ -647,27 +645,7 @@ public abstract class WEditor implements EventListener<Event>, PropertyChangeLis
|
||||||
|
|
||||||
protected String buildStyle(int AD_Style_ID) {
|
protected String buildStyle(int AD_Style_ID) {
|
||||||
MStyle style = MStyle.get(Env.getCtx(), AD_Style_ID);
|
MStyle style = MStyle.get(Env.getCtx(), AD_Style_ID);
|
||||||
X_AD_StyleLine[] lines = style.getStyleLines();
|
return style.buildStyle(ThemeManager.getTheme(), getStyleEvaluatee());
|
||||||
StringBuilder styleBuilder = new StringBuilder();
|
|
||||||
for (X_AD_StyleLine line : lines)
|
|
||||||
{
|
|
||||||
String inlineStyle = line.getInlineStyle().trim();
|
|
||||||
String displayLogic = line.getDisplayLogic();
|
|
||||||
String theme = line.getTheme();
|
|
||||||
if (!Util.isEmpty(theme)) {
|
|
||||||
if (!ThemeManager.getTheme().equals(theme))
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
if (!Util.isEmpty(displayLogic))
|
|
||||||
{
|
|
||||||
if (!Evaluator.evaluateLogic(getStyleEvaluatee(), displayLogic))
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
if (styleBuilder.length() > 0 && !(styleBuilder.charAt(styleBuilder.length()-1)==';'))
|
|
||||||
styleBuilder.append("; ");
|
|
||||||
styleBuilder.append(inlineStyle);
|
|
||||||
}
|
|
||||||
return styleBuilder.toString();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -57,14 +57,14 @@
|
||||||
polling - org.zkoss.zkex.ui.impl.PollingServerPush
|
polling - org.zkoss.zkex.ui.impl.PollingServerPush
|
||||||
comet - org.zkoss.zkmax.ui.comet.CometServerPush ( enterprise edition only )
|
comet - org.zkoss.zkmax.ui.comet.CometServerPush ( enterprise edition only )
|
||||||
-->
|
-->
|
||||||
<!-- device-config>
|
|
||||||
<device-type>ajax</device-type>
|
|
||||||
<server-push-class>fi.jawsy.jawwa.zk.atmosphere.AtmosphereServerPush</server-push-class>
|
|
||||||
</device-config -->
|
|
||||||
<device-config>
|
<device-config>
|
||||||
<device-type>ajax</device-type>
|
<device-type>ajax</device-type>
|
||||||
<server-push-class>org.idempiere.ui.zk.websocket.WebSocketServerPush</server-push-class>
|
<server-push-class>fi.jawsy.jawwa.zk.atmosphere.AtmosphereServerPush</server-push-class>
|
||||||
</device-config>
|
</device-config>
|
||||||
|
<!-- device-config>
|
||||||
|
<device-type>ajax</device-type>
|
||||||
|
<server-push-class>org.idempiere.ui.zk.websocket.WebSocketServerPush</server-push-class>
|
||||||
|
</device-config -->
|
||||||
|
|
||||||
<!-- true for better performance and lower resource usage -->
|
<!-- true for better performance and lower resource usage -->
|
||||||
<system-config>
|
<system-config>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue