diff --git a/migration/i7.1z/oracle/202010271430_IDEMPIERE-4510.sql b/migration/i7.1z/oracle/202010271430_IDEMPIERE-4510.sql new file mode 100644 index 0000000000..efa6ac4238 --- /dev/null +++ b/migration/i7.1z/oracle/202010271430_IDEMPIERE-4510.sql @@ -0,0 +1,11 @@ +SET SQLBLANKLINES ON +SET DEFINE OFF + +-- IDEMPIERE-4510 Search in the toolbar improvement to work out of the box +-- Oct 27, 2020, 2:30:55 PM CET +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','Select Query',0,0,'Y',TO_DATE('2020-10-27 18:53:07','YYYY-MM-DD HH24:MI:SS'),100,TO_DATE('2020-10-27 18:53:07','YYYY-MM-DD HH24:MI:SS'),100,200643,'SelectQuery','D','265f31ef-a92f-4898-bc38-5cbcd5d8523c') +; + + +SELECT register_migration_script('202010271430_IDEMPIERE-4510.sql') FROM dual +; diff --git a/migration/i7.1z/postgresql/202010271430_IDEMPIERE-4510.sql b/migration/i7.1z/postgresql/202010271430_IDEMPIERE-4510.sql new file mode 100644 index 0000000000..c500998945 --- /dev/null +++ b/migration/i7.1z/postgresql/202010271430_IDEMPIERE-4510.sql @@ -0,0 +1,8 @@ +-- IDEMPIERE-4510 Search in the toolbar improvement to work out of the box +-- Oct 27, 2020, 2:30:55 PM CET +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','Select Query',0,0,'Y',TO_TIMESTAMP('2020-10-27 18:53:07','YYYY-MM-DD HH24:MI:SS'),100,TO_TIMESTAMP('2020-10-27 18:53:07','YYYY-MM-DD HH24:MI:SS'),100,200643,'SelectQuery','D','265f31ef-a92f-4898-bc38-5cbcd5d8523c') +; + + +SELECT register_migration_script('202010271430_IDEMPIERE-4510.sql') FROM dual +; diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/ADWindowToolbar.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/ADWindowToolbar.java index bd1f618362..cc4cf4f919 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/ADWindowToolbar.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/ADWindowToolbar.java @@ -94,6 +94,9 @@ public class ADWindowToolbar extends FToolbar implements EventListener public static final String MNITMPREFIX = "Mnitm"; private static final CLogger log = CLogger.getCLogger(ADWindowToolbar.class); + + /** Search messages using translation */ + private String m_sNew; private Combobox fQueryName; private MUserQuery[] userQueries; @@ -200,9 +203,10 @@ public class ADWindowToolbar extends FToolbar implements EventListener this.appendChild(menupopup); //IDEMPIERE-4085 + m_sNew = "** ".concat(Msg.getMsg(Env.getCtx(), "New Query")).concat(" **"); fQueryName = new Combobox(); - fQueryName.setTooltiptext(Msg.getMsg(Env.getCtx(),"QueryName")); - fQueryName.setPlaceholder(Msg.getMsg(Env.getCtx(),"QueryName")); + fQueryName.setTooltiptext(Msg.getMsg(Env.getCtx(),"SelectQuery")); + fQueryName.setPlaceholder(Msg.getMsg(Env.getCtx(),"SelectQuery")); fQueryName.setId(BTNPREFIX + "SearchQuery"); fQueryName.addEventListener(Events.ON_SELECT, this); LayoutUtils.addSclass("toolbar-searchbox", fQueryName); @@ -533,10 +537,14 @@ public class ADWindowToolbar extends FToolbar implements EventListener if (index < 0) return; if (index == 0) // no query - refresh setSelectedUserQuery(null); + else if (m_sNew.equals(fQueryName.getValue())) { //On new send the Event to open the FindWindow + Events.sendEvent(Events.ON_CLICK, btnFind, null); + return; + } else setSelectedUserQuery(userQueries[index-1]); - doOnClick(event); + doOnClick(event); } } @@ -1226,6 +1234,7 @@ public class ADWindowToolbar extends FToolbar implements EventListener setSelectedUserQuery(AD_UserQuery_ID); } } + fQueryName.appendItem(m_sNew, 0); if (AD_UserQuery_ID <= 0 || fQueryName.getItemCount() <= 1 || fQueryName.getSelectedItem() == null) fQueryName.setSelectedIndex(0);