Merge release-7.1 into master

This commit is contained in:
Carlos Ruiz 2020-04-18 18:44:51 +02:00
commit 43c8485b76
8 changed files with 50 additions and 9 deletions

View File

@ -2387,7 +2387,10 @@ public class GridTable extends AbstractTableModel
if (columnName.endsWith ("_ID"))
multiRowWHERE.append (tableName).append(".").append(columnName)
.append ("=").append (value);
else
else if (value instanceof Timestamp) {
multiRowWHERE.append (tableName).append(".").append(columnName)
.append ("=").append (DB.TO_DATE((Timestamp)value, false));
}else
multiRowWHERE.append (tableName).append(".").append(columnName)
.append ("=").append (DB.TO_STRING(value.toString()));
}

View File

@ -38,6 +38,7 @@ import org.adempiere.webui.desktop.FavouriteController;
import org.adempiere.webui.desktop.IDesktop;
import org.adempiere.webui.session.SessionContextListener;
import org.adempiere.webui.session.SessionManager;
import org.adempiere.webui.theme.ITheme;
import org.adempiere.webui.theme.ThemeManager;
import org.adempiere.webui.util.BrowserToken;
import org.adempiere.webui.util.UserPreference;
@ -525,6 +526,9 @@ public class AdempiereWebUI extends Window implements EventListener<Event>, IWeb
Env.setContext(properties, UserPreference.LANGUAGE_NAME, Env.getContext(Env.getCtx(), UserPreference.LANGUAGE_NAME));
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, ITheme.ZK_TOOLBAR_BUTTON_SIZE, Env.getContext(Env.getCtx(), ITheme.ZK_TOOLBAR_BUTTON_SIZE));
Env.setContext(properties, ITheme.USE_CSS_FOR_WINDOW_SIZE, Env.getContext(Env.getCtx(), ITheme.USE_CSS_FOR_WINDOW_SIZE));
Env.setContext(properties, ITheme.USE_FONT_ICON_FOR_IMAGE, Env.getContext(Env.getCtx(), ITheme.USE_FONT_ICON_FOR_IMAGE));
Desktop desktop = Executions.getCurrent().getDesktop();
Locale locale = (Locale) desktop.getSession().getAttribute(Attributes.PREFERRED_LOCALE);

View File

@ -38,6 +38,7 @@ import org.adempiere.webui.component.ToolBarButton;
import org.adempiere.webui.event.ToolbarListener;
import org.adempiere.webui.part.WindowContainer;
import org.adempiere.webui.session.SessionManager;
import org.adempiere.webui.theme.ITheme;
import org.adempiere.webui.theme.ThemeManager;
import org.adempiere.webui.util.ZKUpdateUtil;
import org.adempiere.webui.window.FDialog;
@ -365,7 +366,7 @@ public class ADWindowToolbar extends FToolbar implements EventListener<Event>
else
{
Executions.createComponents(ThemeManager.getPreference(), this, null);
String size = Env.getContext(Env.getCtx(), "#ZK_Toolbar_Button_Size");
String size = Env.getContext(Env.getCtx(), ITheme.ZK_TOOLBAR_BUTTON_SIZE);
String suffix = "24.png";
if (!Util.isEmpty(size))
{
@ -738,7 +739,7 @@ public class ADWindowToolbar extends FToolbar implements EventListener<Event>
}
else
{
String size = Env.getContext(Env.getCtx(), "#ZK_Toolbar_Button_Size");
String size = Env.getContext(Env.getCtx(), ITheme.ZK_TOOLBAR_BUTTON_SIZE);
String suffix = "24.png";
if (!Util.isEmpty(size))
{

View File

@ -28,6 +28,7 @@ import org.adempiere.webui.component.ToolBarButton;
import org.adempiere.webui.component.ZkCssHelper;
import org.adempiere.webui.event.ToolbarListener;
import org.adempiere.webui.session.SessionManager;
import org.adempiere.webui.theme.ITheme;
import org.adempiere.webui.theme.ThemeManager;
import org.adempiere.webui.util.ZKUpdateUtil;
import org.adempiere.webui.window.WRecordInfo;
@ -384,7 +385,7 @@ public class BreadCrumb extends Div implements EventListener<Event> {
btn.setName(BTNPREFIX+name);
btn.setId(name);
Executions.createComponents(ThemeManager.getPreference(), this, null);
String size = Env.getContext(Env.getCtx(), "#ZK_Toolbar_Button_Size");
String size = Env.getContext(Env.getCtx(), ITheme.ZK_TOOLBAR_BUTTON_SIZE);
String suffix = "24.png";
if (!Util.isEmpty(size))
{

View File

@ -54,4 +54,6 @@ public interface ITheme {
public static final String USE_CSS_FOR_WINDOW_SIZE = "#THEME_USE_CSS_FOR_WINDOW_SIZE";
public static final String USE_FONT_ICON_FOR_IMAGE = "#THEME_USE_FONT_ICON_FOR_IMAGE";
public static final String ZK_TOOLBAR_BUTTON_SIZE = "#ZK_Toolbar_Button_Size";
}

View File

@ -11,7 +11,7 @@
import org.adempiere.webui.theme.ITheme;
import org.compiere.model.MSysConfig;
Env.setContext(Env.getCtx(), "#ZK_Toolbar_Button_Size", "24");
Env.setContext(Env.getCtx(), ITheme.ZK_TOOLBAR_BUTTON_SIZE, "24");
/* Set the next variable if you want to control browser title in theme */
/* Env.setContext(Env.getCtx(), "#ZK_BROWSER_TITLE", "iDempiere"); */
Env.setContext(Env.getCtx(), ITheme.USE_CSS_FOR_WINDOW_SIZE, "Y");

View File

@ -539,9 +539,9 @@
</dependency-resolution>
<target>
<artifact>
<groupId>${project.groupId}</groupId>
<groupId>org.idempiere</groupId>
<artifactId>${idempiere.target}</artifactId>
<version>${project.version}</version>
<version>7.1.0-SNAPSHOT</version>
</artifact>
</target>

View File

@ -44,6 +44,8 @@ import javax.xml.ws.WebServiceContext;
import org.apache.commons.codec.binary.Base64;
import org.apache.cxf.jaxrs.ext.MessageContext;
import org.apache.xmlbeans.StringEnumAbstractBase.Table;
import org.apache.xmlbeans.XmlInt;
import org.apache.xmlbeans.impl.values.XmlValueOutOfRangeException;
import org.compiere.model.I_AD_Column;
import org.compiere.model.Lookup;
import org.compiere.model.MColumn;
@ -338,8 +340,16 @@ public class ModelADServiceImpl extends AbstractService implements ModelADServic
}
private int validateParameter(String parameterName, int i) {
return validateParameter(parameterName, i, null);
}
private int validateParameter(String parameterName, int i, String uuid) {
Integer io = Integer.valueOf(i);
String string = validateParameter(parameterName, io.toString());
// Use the UUID only if the returned string is empty to not override the constant value if any
if (string == null || string.equals("0"))
string = uuid;
if (string == null)
return -1;
if (string.equals(io.toString()))
@ -401,7 +411,15 @@ public class ModelADServiceImpl extends AbstractService implements ModelADServic
// Validate parameters
modelRunProcess.setADMenuID(validateParameter("AD_Menu_ID", modelRunProcess.getADMenuID()));
try {
modelRunProcess.setADProcessID(validateParameter("AD_Process_ID", modelRunProcess.getADProcessID()));
} catch(XmlValueOutOfRangeException e) { // Catch the exception when the Process ID is not an Integer
String processUU = getUUIDValue(modelRunProcess.xgetADProcessID());
if (processUU == null) {
throw e;
}
modelRunProcess.setADProcessID(validateParameter("AD_Process_ID", 0, processUU));
}
modelRunProcess.setADRecordID(validateParameter("AD_Record_ID", modelRunProcess.getADRecordID()));
modelRunProcess.setDocAction(validateParameter("DocAction", modelRunProcess.getDocAction()));
@ -423,6 +441,18 @@ public class ModelADServiceImpl extends AbstractService implements ModelADServic
}
}
private String getUUIDValue(XmlInt xmlInt) {
if (xmlInt != null) {
// String xml <...> blocks
String content = xmlInt.toString().replaceAll("<[^>]*>", "");
if (! Util.isEmpty(content, true) && ADLookup.isUUID(content))
return content;
}
//No UUID value
return null;
}
public WindowTabDataDocument getList(ModelGetListRequestDocument req) {
try {
getCompiereService().connect();
@ -1397,7 +1427,7 @@ public class ModelADServiceImpl extends AbstractService implements ModelADServic
new QName("queryData"));
int roleid = reqlogin.getRoleID();
MRole role = new MRole(ctx, roleid, null);
MRole role = MRole.get(ctx, roleid);
// start a trx
String trxName = localTrxName;