hg merge release-5.1 (merge release5.1 into default)

This commit is contained in:
Carlos Ruiz 2018-07-23 23:47:21 +02:00
commit 39e1727ebd
18 changed files with 334 additions and 22 deletions

View File

@ -1,10 +1,14 @@
create or replace function altercolumn(tablename name, columnname name, datatype name, CREATE OR REPLACE FUNCTION adempiere.altercolumn(tablename name, columnname name, datatype name, nullclause character varying, defaultclause character varying, namespace name)
nullclause varchar, defaultclause varchar) returns void as $$ RETURNS void
LANGUAGE plpgsql
AS $function$
declare declare
command text; command text;
viewtext text[]; viewtext text[];
viewname name[]; viewname name[];
dropviews name[]; dropviews name[];
perms text[];
privs text;
i int; i int;
j int; j int;
v record; v record;
@ -15,12 +19,14 @@ begin
if datatype is not null then if datatype is not null then
select pg_type.typname, format_type(pg_type.oid, pg_attribute.atttypmod) select pg_type.typname, format_type(pg_type.oid, pg_attribute.atttypmod)
into typename, sqltype into typename, sqltype
from pg_class, pg_attribute, pg_type from pg_class, pg_attribute, pg_type, pg_namespace
where relname = lower(tablename) where relname = lower(tablename)
and relkind = 'r' and relkind = 'r'
and pg_class.oid = pg_attribute.attrelid and pg_class.oid = pg_attribute.attrelid
and attname = lower(columnname) and attname = lower(columnname)
and atttypid = pg_type.oid; and atttypid = pg_type.oid
and pg_class.relnamespace = pg_namespace.oid
and pg_namespace.nspname = lower(namespace);
sqltype_short := sqltype; sqltype_short := sqltype;
if typename = 'numeric' then if typename = 'numeric' then
sqltype_short := replace(sqltype, ',0', ''); sqltype_short := replace(sqltype, ',0', '');
@ -34,7 +40,7 @@ begin
for v in for v in
with recursive depv(relname, viewoid, depth) as ( with recursive depv(relname, viewoid, depth) as (
select distinct a.relname, a.oid, 1 select distinct a.relname, a.oid, 1
from pg_class a, pg_depend b, pg_depend c, pg_class d, pg_attribute e from pg_class a, pg_depend b, pg_depend c, pg_class d, pg_attribute e, pg_namespace
where a.oid = b.refobjid where a.oid = b.refobjid
and b.objid = c.objid and b.objid = c.objid
and b.refobjid <> c.refobjid and b.refobjid <> c.refobjid
@ -46,6 +52,8 @@ begin
and e.attname = lower(columnname) and e.attname = lower(columnname)
and c.refobjsubid = e.attnum and c.refobjsubid = e.attnum
and a.relkind = 'v' and a.relkind = 'v'
and a.relnamespace = pg_namespace.oid
and pg_namespace.nspname = lower(namespace)
union all union all
select distinct dependee.relname, dependee.oid, depv.depth+1 select distinct dependee.relname, dependee.oid, depv.depth+1
from pg_depend from pg_depend
@ -54,9 +62,12 @@ begin
join pg_class as dependent on pg_depend.refobjid = dependent.oid join pg_class as dependent on pg_depend.refobjid = dependent.oid
join pg_attribute ON pg_depend.refobjid = pg_attribute.attrelid and pg_depend.refobjsubid = pg_attribute.attnum and pg_attribute.attnum > 0 join pg_attribute ON pg_depend.refobjid = pg_attribute.attrelid and pg_depend.refobjsubid = pg_attribute.attnum and pg_attribute.attnum > 0
join depv on dependent.relname = depv.relname join depv on dependent.relname = depv.relname
join pg_namespace on dependee.relnamespace = pg_namespace.oid
where pg_namespace.nspname = lower(namespace)
) )
select relname, viewoid, max(depth) from depv group by relname, viewoid order by 3 desc select relname, viewoid, max(depth) from depv group by relname, viewoid order by 3 desc
loop loop
raise notice 'view -> % %', v.relname, v.viewoid;
i := i + 1; i := i + 1;
viewtext[i] := pg_get_viewdef(v.viewoid); viewtext[i] := pg_get_viewdef(v.viewoid);
viewname[i] := v.relname; viewname[i] := v.relname;
@ -64,6 +75,11 @@ begin
if i > 0 then if i > 0 then
begin begin
for j in 1 .. i loop for j in 1 .. i loop
SELECT String_agg('grant ' || privilege_type || ' on ' || viewname[j] || ' to ' || grantee, '; ')
into privs
FROM information_schema.role_table_grants
WHERE table_name=viewname[j];
perms[j] := privs;
command := 'drop view ' || viewname[j]; command := 'drop view ' || viewname[j];
raise notice 'executing -> %', command; raise notice 'executing -> %', command;
execute command; execute command;
@ -91,6 +107,9 @@ begin
command := 'create or replace view ' || dropviews[j] || ' as ' || viewtext[j]; command := 'create or replace view ' || dropviews[j] || ' as ' || viewtext[j];
raise notice 'executing -> %', 'create view ' || dropviews[j]; raise notice 'executing -> %', 'create view ' || dropviews[j];
execute command; execute command;
command := perms[j];
raise notice 'executing -> %', 'grant ' || perms[j];
execute command;
end loop; end loop;
end if; end if;
end if; end if;
@ -122,7 +141,7 @@ begin
end if; end if;
end if; end if;
end; end;
$$ language plpgsql; $function$
/* /*
create table t_alter_column create table t_alter_column

View File

@ -0,0 +1,11 @@
SET SQLBLANKLINES ON
SET DEFINE OFF
-- Dec 23, 2013 1:36:38 PM COT
-- IDEMPIERE-1539
INSERT INTO AD_Ref_List (AD_Ref_List_ID,AD_Reference_ID,AD_Ref_List_UU,Name,Value,Created,CreatedBy,Updated,UpdatedBy,IsActive,EntityType,AD_Client_ID,AD_Org_ID) VALUES (200168,200061,'9562f4db-97a9-4df5-99d0-b2f5bc0e2b4c','Full Like','LIKE',TO_DATE('2013-12-23 13:36:48','YYYY-MM-DD HH24:MI:SS'),100,TO_DATE('2013-12-23 13:36:48','YYYY-MM-DD HH24:MI:SS'),100,'Y','D',0,0)
;
SELECT register_migration_script('201312231347_IDEMPIERE-1539.sql') FROM dual
;

View File

@ -0,0 +1,4 @@
-- just for postgresql
SELECT register_migration_script('201807111333_Ticket_AP2-357.sql') FROM dual
;

View File

@ -0,0 +1,18 @@
SET SQLBLANKLINES ON
SET DEFINE OFF
-- IDEMPIERE-3719 : Add display name when sending emails
-- Jul 16, 2018 3:27:06 PM CEST
UPDATE AD_Field SET IsDisplayed='Y', SeqNo=130, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, XPosition=4, IsToolbarButton=NULL,Updated=TO_DATE('2018-07-16 15:27:06','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=11175
;
-- Jul 16, 2018 3:27:06 PM CEST
UPDATE AD_Field SET SeqNo=140, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_DATE('2018-07-16 15:27:06','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=201884
;
-- Jul 16, 2018 3:27:06 PM CEST
UPDATE AD_Field SET SeqNo=150, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_DATE('2018-07-16 15:27:06','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=5226
;
SELECT register_migration_script('201807161530_IDEMPIERE-3746.sql') FROM dual
;

View File

@ -0,0 +1,19 @@
SET SQLBLANKLINES ON
SET DEFINE OFF
-- I do not forgot to set the DICTIONARY_ID_COMMENTS System Configurator
-- After a year , i get the answer for a very nice question from https://groups.google.com/d/msg/idempiere/gkrkQ7gEPBI/bw-C6JTdBQAJ
-- 2018-7-3 下午04时06分21秒
-- Update User reference of AD_Reference for System system . If using Table Direct , System cannt got other clients' user_id lead to null replace in preference window.
UPDATE AD_Column SET AD_Reference_ID=30, AD_Reference_Value_ID=200145, FKConstraintType=NULL,Updated=TO_DATE('2018-07-03 16:06:21','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=1471
;
-- 2018-7-3 下午04时06分38秒
-- Implementing a tab sqlwhere to filter some useless preference value in other clients and display all data for system.
UPDATE AD_Tab SET WhereClause='AD_Preference.CreatedBy IN (SELECT AD_User_ID FROM AD_User WHERE AD_Client_ID = @#AD_Client_ID@) OR @#AD_Client_ID@ = 0',Updated=TO_DATE('2018-07-03 16:06:38','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Tab_ID=156
;
SELECT register_migration_script('201807232033_IDEMPIERE-3737.sql') FROM dual
;

View File

@ -0,0 +1,8 @@
-- Dec 23, 2013 1:36:38 PM COT
-- IDEMPIERE-1539
INSERT INTO AD_Ref_List (AD_Ref_List_ID,AD_Reference_ID,AD_Ref_List_UU,Name,Value,Created,CreatedBy,Updated,UpdatedBy,IsActive,EntityType,AD_Client_ID,AD_Org_ID) VALUES (200168,200061,'9562f4db-97a9-4df5-99d0-b2f5bc0e2b4c','Full Like','LIKE',TO_TIMESTAMP('2013-12-23 13:36:48','YYYY-MM-DD HH24:MI:SS'),100,TO_TIMESTAMP('2013-12-23 13:36:48','YYYY-MM-DD HH24:MI:SS'),100,'Y','D',0,0)
;
SELECT register_migration_script('201312231347_IDEMPIERE-1539.sql') FROM dual
;

View File

@ -0,0 +1,148 @@
CREATE OR REPLACE FUNCTION adempiere.altercolumn(tablename name, columnname name, datatype name, nullclause character varying, defaultclause character varying, namespace name)
RETURNS void
LANGUAGE plpgsql
AS $function$
declare
command text;
viewtext text[];
viewname name[];
dropviews name[];
perms text[];
privs text;
i int;
j int;
v record;
sqltype text;
sqltype_short text;
typename name;
begin
if datatype is not null then
select pg_type.typname, format_type(pg_type.oid, pg_attribute.atttypmod)
into typename, sqltype
from pg_class, pg_attribute, pg_type, pg_namespace
where relname = lower(tablename)
and relkind = 'r'
and pg_class.oid = pg_attribute.attrelid
and attname = lower(columnname)
and atttypid = pg_type.oid
and pg_class.relnamespace = pg_namespace.oid
and pg_namespace.nspname = lower(namespace);
sqltype_short := sqltype;
if typename = 'numeric' then
sqltype_short := replace(sqltype, ',0', '');
elsif strpos(sqltype,'character varying') = 1 then
sqltype_short := replace(sqltype, 'character varying', 'varchar');
elsif sqltype = 'timestamp without time zone' then
sqltype_short := 'timestamp';
end if;
if lower(datatype) <> sqltype and lower(datatype) <> sqltype_short then
i := 0;
for v in
with recursive depv(relname, viewoid, depth) as (
select distinct a.relname, a.oid, 1
from pg_class a, pg_depend b, pg_depend c, pg_class d, pg_attribute e, pg_namespace
where a.oid = b.refobjid
and b.objid = c.objid
and b.refobjid <> c.refobjid
and b.deptype = 'n'
and c.refobjid = d.oid
and d.relname = lower(tablename)
and d.relkind = 'r'
and d.oid = e.attrelid
and e.attname = lower(columnname)
and c.refobjsubid = e.attnum
and a.relkind = 'v'
and a.relnamespace = pg_namespace.oid
and pg_namespace.nspname = lower(namespace)
union all
select distinct dependee.relname, dependee.oid, depv.depth+1
from pg_depend
join pg_rewrite on pg_depend.objid = pg_rewrite.oid
join pg_class as dependee on pg_rewrite.ev_class = dependee.oid
join pg_class as dependent on pg_depend.refobjid = dependent.oid
join pg_attribute ON pg_depend.refobjid = pg_attribute.attrelid and pg_depend.refobjsubid = pg_attribute.attnum and pg_attribute.attnum > 0
join depv on dependent.relname = depv.relname
join pg_namespace on dependee.relnamespace = pg_namespace.oid
where pg_namespace.nspname = lower(namespace)
)
select relname, viewoid, max(depth) from depv group by relname, viewoid order by 3 desc
loop
raise notice 'view -> % %', v.relname, v.viewoid;
i := i + 1;
viewtext[i] := pg_get_viewdef(v.viewoid);
viewname[i] := v.relname;
end loop;
if i > 0 then
begin
for j in 1 .. i loop
SELECT String_agg('grant ' || privilege_type || ' on ' || viewname[j] || ' to ' || grantee, '; ')
into privs
FROM information_schema.role_table_grants
WHERE table_name=viewname[j];
perms[j] := privs;
command := 'drop view ' || viewname[j];
raise notice 'executing -> %', command;
execute command;
dropviews[j] := viewname[j];
end loop;
exception
when others then
i := array_upper(dropviews, 1);
if i > 0 then
for j in reverse i .. 1 loop
command := 'create or replace view ' || dropviews[j] || ' as ' || viewtext[j];
raise notice 'executing -> %', 'create view ' || dropviews[j];
execute command;
end loop;
end if;
raise exception 'Failed to recreate dependent view. SQLERRM=%', SQLERRM;
end;
end if;
command := 'alter table ' || lower(tablename) || ' alter column ' || lower(columnname) || ' type ' || lower(datatype);
raise notice 'executing -> %', command;
execute command;
i := array_upper(dropviews, 1);
if i > 0 then
for j in reverse i .. 1 loop
command := 'create or replace view ' || dropviews[j] || ' as ' || viewtext[j];
raise notice 'executing -> %', 'create view ' || dropviews[j];
execute command;
command := perms[j];
raise notice 'executing -> %', 'grant ' || perms[j];
execute command;
end loop;
end if;
end if;
end if;
if defaultclause is not null then
if lower(defaultclause) = 'null' then
command := 'alter table ' || lower(tablename) || ' alter column ' || lower(columnname) || ' drop default ';
else
if defaultclause ~ '.*[(].*[)].*' or lower(defaultclause) = 'current_timestamp' then
command := 'alter table ' || lower(tablename) || ' alter column ' || lower(columnname) || ' set default ' || defaultclause;
else
command := 'alter table ' || lower(tablename) || ' alter column ' || lower(columnname) || ' set default ''' || defaultclause || '''';
end if;
end if;
raise notice 'executing -> %', command;
execute command;
end if;
if nullclause is not null then
if lower(nullclause) = 'not null' then
command := 'alter table ' || lower(tablename) || ' alter column ' || lower(columnname) || ' set not null';
raise notice 'executing -> %', command;
execute command;
elsif lower(nullclause) = 'null' then
command := 'alter table ' || lower(tablename) || ' alter column ' || lower(columnname) || ' drop not null';
raise notice 'executing -> %', command;
execute command;
end if;
end if;
end;
$function$
;
SELECT register_migration_script('201807111333_Ticket_AP2-357.sql') FROM dual
;

View File

@ -0,0 +1,15 @@
-- IDEMPIERE-3719 : Add display name when sending emails
-- Jul 16, 2018 3:27:06 PM CEST
UPDATE AD_Field SET IsDisplayed='Y', SeqNo=130, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, XPosition=4, IsToolbarButton=NULL,Updated=TO_TIMESTAMP('2018-07-16 15:27:06','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=11175
;
-- Jul 16, 2018 3:27:06 PM CEST
UPDATE AD_Field SET SeqNo=140, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_TIMESTAMP('2018-07-16 15:27:06','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=201884
;
-- Jul 16, 2018 3:27:06 PM CEST
UPDATE AD_Field SET SeqNo=150, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_TIMESTAMP('2018-07-16 15:27:06','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=5226
;
SELECT register_migration_script('201807161530_IDEMPIERE-3746.sql') FROM dual
;

View File

@ -0,0 +1,16 @@
-- I do not forgot to set the DICTIONARY_ID_COMMENTS System Configurator
-- After a year , i get the answer for a very nice question from https://groups.google.com/d/msg/idempiere/gkrkQ7gEPBI/bw-C6JTdBQAJ
-- Update User reference of AD_Reference for System system . If using Table Direct , System cannt got other clients' user_id lead to null replace in preference window.
-- 2018-7-3 下午04时06分21秒
UPDATE AD_Column SET AD_Reference_ID=30, AD_Reference_Value_ID=200145, FKConstraintType=NULL,Updated=TO_TIMESTAMP('2018-07-03 16:06:21','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=1471
;
-- Implementing a tab sqlwhere to filter some useless preference value in other clients and display all data for system.
-- 2018-7-3 下午04时06分38秒
UPDATE AD_Tab SET WhereClause='AD_Preference.CreatedBy IN (SELECT AD_User_ID FROM AD_User WHERE AD_Client_ID = @#AD_Client_ID@) OR @#AD_Client_ID@ = 0',Updated=TO_TIMESTAMP('2018-07-03 16:06:38','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Tab_ID=156
;
SELECT register_migration_script('201807232033_IDEMPIERE-3737.sql') FROM dual
;

View File

@ -387,7 +387,7 @@
unpack="false"/> unpack="false"/>
<plugin <plugin
id="org.apache.commons.collections4" id="org.apache.commons.commons-collections4"
download-size="0" download-size="0"
install-size="0" install-size="0"
version="0.0.0" version="0.0.0"

View File

@ -305,6 +305,38 @@ public class MLanguage extends X_AD_Language
return false; return false;
} }
} }
String tp = getTimePattern();
if (is_ValueChanged("TimePattern") && tp != null && tp.length() > 0)
{
if (tp.indexOf("HH") == -1 && tp.indexOf("hh") == -1)
{
log.saveError("Error", Msg.parseTranslation(getCtx(), "@Error@ @TimePattern@ - No Hour (HH/hh)"));
return false;
}
if (tp.indexOf("mm") == -1)
{
log.saveError("Error", Msg.parseTranslation(getCtx(), "@Error@ @TimePattern@ - No Minute (mm)"));
return false;
}
if (tp.indexOf("ss") == -1)
{
log.saveError("Error", Msg.parseTranslation(getCtx(), "@Error@ @TimePattern@ - No Second (ss)"));
return false;
}
m_dateFormat = (SimpleDateFormat)DateFormat.getTimeInstance
(DateFormat.SHORT, getLocale());
try
{
m_dateFormat.applyPattern(tp);
}
catch (Exception e)
{
log.saveError("Error", Msg.parseTranslation(getCtx(), "@Error@ @TimePattern@ - " + e.getMessage()));
m_dateFormat = null;
return false;
}
}
if (newRecord) if (newRecord)
setAD_Language_ID(); setAD_Language_ID();
return true; return true;

View File

@ -30,7 +30,7 @@ public class X_AD_InfoColumn extends PO implements I_AD_InfoColumn, I_Persistent
/** /**
* *
*/ */
private static final long serialVersionUID = 20180217L; private static final long serialVersionUID = 20180719L;
/** Standard Constructor */ /** Standard Constructor */
public X_AD_InfoColumn (Properties ctx, int AD_InfoColumn_ID, String trxName) public X_AD_InfoColumn (Properties ctx, int AD_InfoColumn_ID, String trxName)
@ -586,6 +586,8 @@ public class X_AD_InfoColumn extends PO implements I_AD_InfoColumn, I_Persistent
public static final String QUERYOPERATOR_LeEq = "<="; public static final String QUERYOPERATOR_LeEq = "<=";
/** != = != */ /** != = != */
public static final String QUERYOPERATOR_NotEq = "!="; public static final String QUERYOPERATOR_NotEq = "!=";
/** Full Like = LIKE */
public static final String QUERYOPERATOR_FullLike = "LIKE";
/** Set Query Operator. /** Set Query Operator.
@param QueryOperator @param QueryOperator
Operator for database query Operator for database query

View File

@ -65,6 +65,7 @@ import java.util.logging.Level;
import org.adempiere.base.IDisplayTypeFactory; import org.adempiere.base.IDisplayTypeFactory;
import org.adempiere.base.Service; import org.adempiere.base.Service;
import org.compiere.model.MLanguage;
/** /**
* System Display Types. * System Display Types.
@ -498,11 +499,20 @@ public final class DisplayType
} }
} }
if (displayType == DateTime) MLanguage lang = MLanguage.get(Env.getCtx(), myLanguage);
if (displayType == DateTime) {
if (!Util.isEmpty(lang.getDatePattern()) && !Util.isEmpty(lang.getTimePattern()))
return new SimpleDateFormat(lang.getDatePattern() + " " + lang.getTimePattern());
return myLanguage.getDateTimeFormat(); return myLanguage.getDateTimeFormat();
else if (displayType == Time) }
else if (displayType == Time) {
if (!Util.isEmpty(lang.getTimePattern()))
return new SimpleDateFormat(lang.getTimePattern());
return myLanguage.getTimeFormat(); return myLanguage.getTimeFormat();
else{ }
else {
List<IDisplayTypeFactory> factoryList = Service.locator().list(IDisplayTypeFactory.class).getServices(); List<IDisplayTypeFactory> factoryList = Service.locator().list(IDisplayTypeFactory.class).getServices();
for(IDisplayTypeFactory factory : factoryList){ for(IDisplayTypeFactory factory : factoryList){
SimpleDateFormat osgiFormat = factory.getDateFormat(displayType, myLanguage, pattern); SimpleDateFormat osgiFormat = factory.getDateFormat(displayType, myLanguage, pattern);
@ -511,7 +521,10 @@ public final class DisplayType
} }
} }
// else if (displayType == Date) // Date
if (!Util.isEmpty(lang.getDatePattern()))
return new SimpleDateFormat(lang.getDatePattern());
return myLanguage.getDateFormat(); // default return myLanguage.getDateFormat(); // default
} // getDateFormat } // getDateFormat

View File

@ -114,7 +114,7 @@ public class EmailSrv {
if (lsContentTypeRaw != null){ if (lsContentTypeRaw != null){
for (String contentType : lsContentTypeRaw){ for (String contentType : lsContentTypeRaw){
emailPartLogInfo.append (contentType); emailPartLogInfo.append (contentType);
emailPartLogInfo.append (msg.getHeader("; ")); emailPartLogInfo.append ("; ");
} }
} }
emailPartLogInfo.append ("\r\n"); emailPartLogInfo.append ("\r\n");

View File

@ -10,7 +10,7 @@
<rm:locator pattern="^org\.idempiere\.hazelcast\.service(\.source)?$" searchPathRef="workspace.project"/> <rm:locator pattern="^org\.idempiere\.hazelcast\.service(\.source)?$" searchPathRef="workspace.project"/>
<rm:locator pattern="^org\.apache\.poi(\.source)?$" searchPathRef="orbit"/> <rm:locator pattern="^org\.apache\.poi(\.source)?$" searchPathRef="orbit"/>
<rm:locator pattern="^org\.eclipse\.jdt\.core\.compiler\.batch(\.source)?$" searchPathRef="bundles.maven"/> <rm:locator pattern="^org\.eclipse\.jdt\.core\.compiler\.batch(\.source)?$" searchPathRef="bundles.maven"/>
<rm:locator pattern="^org\.apache\.commons\.collections4(\.source)?$" searchPathRef="bundles.maven"/> <rm:locator pattern="^org\.apache\.commons\.commons-collections4(\.source)?$" searchPathRef="bundles.maven"/>
<rm:locator pattern="^org\.apache\.commons\.configuration(\.source)?$" searchPathRef="bundles.maven"/> <rm:locator pattern="^org\.apache\.commons\.configuration(\.source)?$" searchPathRef="bundles.maven"/>
<rm:locator pattern="^org\.apache\.commons\.digester(\.source)?$" searchPathRef="bundles.maven"/> <rm:locator pattern="^org\.apache\.commons\.digester(\.source)?$" searchPathRef="bundles.maven"/>
<rm:locator pattern="^org\.mortbay\.jasper(\..+)?" searchPathRef="bundles.maven"/> <rm:locator pattern="^org\.mortbay\.jasper(\..+)?" searchPathRef="bundles.maven"/>
@ -186,7 +186,7 @@
<maven:entry groupId="com.ibm.icu" artifactId="icu4j" name="com.ibm.icu"/> <maven:entry groupId="com.ibm.icu" artifactId="icu4j" name="com.ibm.icu"/>
<maven:entry groupId="joda-time" artifactId="joda-time" name="joda-time"/> <maven:entry groupId="joda-time" artifactId="joda-time" name="joda-time"/>
<maven:entry groupId="commons-configuration" artifactId="commons-configuration" name="org.apache.commons.configuration"/> <maven:entry groupId="commons-configuration" artifactId="commons-configuration" name="org.apache.commons.configuration"/>
<maven:entry artifactId="commons-collections4" groupId="org.apache.commons" name="org.apache.commons.collections4"/> <maven:entry artifactId="commons-collections4" groupId="org.apache.commons" name="org.apache.commons.commons-collections4"/>
</maven:mappings> </maven:mappings>
</rm:provider> </rm:provider>
</rm:searchPath> </rm:searchPath>

View File

@ -297,7 +297,7 @@ public class WQuickEntry extends Window implements EventListener<Event>, ValueCh
} else { } else {
if (Record_ID > 0) { if (Record_ID > 0) {
String columnname = gridtab.getTableName() + "_ID"; String columnname = gridtab.getTableName() + "_ID";
id = Env.getContextAsInt(Env.getCtx(), parent_WindowNo, columnname); id = Env.getContextAsInt(Env.getCtx(), parent_WindowNo, columnname, true);
} }
} }
MQuery query = new MQuery(gridtab.getAD_Table_ID()); MQuery query = new MQuery(gridtab.getAD_Table_ID());

View File

@ -1005,14 +1005,17 @@ public class InfoWindow extends InfoPanel implements ValueChangeListener, EventL
if (value instanceof Boolean) { if (value instanceof Boolean) {
pstmt.setString(parameterIndex, ((Boolean) value).booleanValue() ? "Y" : "N"); pstmt.setString(parameterIndex, ((Boolean) value).booleanValue() ? "Y" : "N");
} else if (value instanceof String) { } else if (value instanceof String) {
StringBuilder valueStr = new StringBuilder(value.toString());
if (queryOperator.equals(X_AD_InfoColumn.QUERYOPERATOR_Like)) { if (queryOperator.equals(X_AD_InfoColumn.QUERYOPERATOR_Like)) {
StringBuilder valueStr = new StringBuilder(value.toString());
if (!valueStr.toString().endsWith("%")) if (!valueStr.toString().endsWith("%"))
valueStr.append("%"); valueStr.append("%");
pstmt.setString(parameterIndex, valueStr.toString()); } else if (queryOperator.equals(X_AD_InfoColumn.QUERYOPERATOR_FullLike)) {
} else { if (!valueStr.toString().startsWith("%"))
pstmt.setString(parameterIndex, (String)value); valueStr.insert(0, "%");
if (!valueStr.toString().endsWith("%"))
valueStr.append("%");
} }
pstmt.setString(parameterIndex, valueStr.toString());
} else { } else {
pstmt.setObject(parameterIndex, value); pstmt.setObject(parameterIndex, value);
} }

View File

@ -112,6 +112,7 @@ import org.zkoss.zul.Datebox;
import org.zkoss.zul.Div; import org.zkoss.zul.Div;
import org.zkoss.zul.Hbox; import org.zkoss.zul.Hbox;
import org.zkoss.zul.North; import org.zkoss.zul.North;
import org.zkoss.zul.Separator;
import org.zkoss.zul.South; import org.zkoss.zul.South;
import org.zkoss.zul.Space; import org.zkoss.zul.Space;
import org.zkoss.zul.Tab; import org.zkoss.zul.Tab;
@ -364,7 +365,6 @@ public class FindWindow extends Window implements EventListener<Event>, ValueCha
btnCancel.addEventListener(Events.ON_CLICK,this); btnCancel.addEventListener(Events.ON_CLICK,this);
Panel pnlButtonRight = new Panel(); Panel pnlButtonRight = new Panel();
pnlButtonRight.appendChild(btnClear);
pnlButtonRight.appendChild(btnOk); pnlButtonRight.appendChild(btnOk);
pnlButtonRight.appendChild(btnCancel); pnlButtonRight.appendChild(btnCancel);
pnlButtonRight.setStyle("text-align:right"); pnlButtonRight.setStyle("text-align:right");
@ -373,6 +373,10 @@ public class FindWindow extends Window implements EventListener<Event>, ValueCha
Panel pnlButtonLeft = new Panel(); Panel pnlButtonLeft = new Panel();
pnlButtonLeft.appendChild(btnNew); pnlButtonLeft.appendChild(btnNew);
Separator sep = new Separator("vertical");
sep.setWidth("2px");
pnlButtonLeft.appendChild(sep);
pnlButtonLeft.appendChild(btnClear);
ZKUpdateUtil.setHflex(pnlButtonLeft, "1"); ZKUpdateUtil.setHflex(pnlButtonLeft, "1");
Hbox hboxButton = new Hbox(); Hbox hboxButton = new Hbox();