From c656bd52ada7ccc078c8ccae992d450794337291 Mon Sep 17 00:00:00 2001 From: hieplq Date: Thu, 29 May 2014 16:35:05 -0500 Subject: [PATCH] IDEMPIERE-1334:Run one or more processes from Info Window fix comment of carlos --- .../oracle/201405291604_IDEMPIERE-1334.sql | 68 ++++++++++++++++++ .../201405291604_IDEMPIERE-1334.sql | 63 ++++++++++++++++ .../org/compiere/model/I_AD_InfoProcess.java | 39 ---------- .../org/compiere/model/X_AD_InfoProcess.java | 54 +------------- .../org/adempiere/webui/info/InfoWindow.java | 43 +++++++---- .../org/adempiere/webui/panel/InfoPanel.java | 8 +-- .../theme/default/images/ProcessMenu16.png | Bin 0 -> 880 bytes .../theme/default/images/ProcessMenu24.png | Bin 0 -> 1525 bytes 8 files changed, 165 insertions(+), 110 deletions(-) create mode 100644 migration/i2.0z/oracle/201405291604_IDEMPIERE-1334.sql create mode 100644 migration/i2.0z/postgresql/201405291604_IDEMPIERE-1334.sql create mode 100644 org.adempiere.ui.zk/theme/default/images/ProcessMenu16.png create mode 100644 org.adempiere.ui.zk/theme/default/images/ProcessMenu24.png diff --git a/migration/i2.0z/oracle/201405291604_IDEMPIERE-1334.sql b/migration/i2.0z/oracle/201405291604_IDEMPIERE-1334.sql new file mode 100644 index 0000000000..8df2a1eeb2 --- /dev/null +++ b/migration/i2.0z/oracle/201405291604_IDEMPIERE-1334.sql @@ -0,0 +1,68 @@ +SET SQLBLANKLINES ON +SET DEFINE OFF + +-- May 29, 2014 6:19:41 AM ICT +-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator +DELETE FROM AD_Field_Trl WHERE AD_Field_ID=203032 +; + +-- May 29, 2014 6:19:41 AM ICT +DELETE FROM AD_Field WHERE AD_Field_ID=203032 +; + +-- May 29, 2014 6:19:52 AM ICT +DELETE FROM AD_Field_Trl WHERE AD_Field_ID=203033 +; + +-- May 29, 2014 6:19:52 AM ICT +DELETE FROM AD_Field WHERE AD_Field_ID=203033 +; + +-- May 29, 2014 6:19:52 AM ICT +DELETE FROM AD_Field_Trl WHERE AD_Field_ID=203034 +; + +-- May 29, 2014 6:19:52 AM ICT +DELETE FROM AD_Field WHERE AD_Field_ID=203034 +; + +-- May 29, 2014 6:20:37 AM ICT +DELETE FROM AD_Column_Trl WHERE AD_Column_ID=211251 +; + +-- May 29, 2014 6:20:37 AM ICT +DELETE FROM AD_Column WHERE AD_Column_ID=211251 +; + +-- May 29, 2014 6:20:38 AM ICT +DELETE FROM AD_Column_Trl WHERE AD_Column_ID=211256 +; + +-- May 29, 2014 6:20:38 AM ICT +DELETE FROM AD_Column WHERE AD_Column_ID=211256 +; + +-- May 29, 2014 6:20:38 AM ICT +DELETE FROM AD_Column_Trl WHERE AD_Column_ID=211250 +; + +-- May 29, 2014 6:20:38 AM ICT +DELETE FROM AD_Column WHERE AD_Column_ID=211250 +; + +ALTER TABLE ad_infoprocess DROP COLUMN name +; + +ALTER TABLE ad_infoprocess DROP COLUMN description +; + +ALTER TABLE ad_infoprocess DROP COLUMN help +; + +-- May 29, 2014 6:21:41 AM ICT +INSERT INTO AD_Message (MsgType,MsgText,AD_Message_ID,EntityType,AD_Message_UU,Value,IsActive,Updated,CreatedBy,UpdatedBy,AD_Client_ID,AD_Org_ID,Created) VALUES ('M','Process Menu',200275,'D','c7cb8357-7a1f-46ab-9957-cda58431adfd','ProcessMenu','Y',TO_DATE('2014-05-29 06:21:35','YYYY-MM-DD HH24:MI:SS'),100,100,0,0,TO_DATE('2014-05-29 06:21:35','YYYY-MM-DD HH24:MI:SS')) +; + + +SELECT register_migration_script('201405291604_IDEMPIERE-1334.sql') FROM dual +; diff --git a/migration/i2.0z/postgresql/201405291604_IDEMPIERE-1334.sql b/migration/i2.0z/postgresql/201405291604_IDEMPIERE-1334.sql new file mode 100644 index 0000000000..8e6fb2c8b5 --- /dev/null +++ b/migration/i2.0z/postgresql/201405291604_IDEMPIERE-1334.sql @@ -0,0 +1,63 @@ +-- May 29, 2014 6:19:41 AM ICT +-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator +DELETE FROM AD_Field_Trl WHERE AD_Field_ID=203032 +; + +-- May 29, 2014 6:19:41 AM ICT +DELETE FROM AD_Field WHERE AD_Field_ID=203032 +; + +-- May 29, 2014 6:19:52 AM ICT +DELETE FROM AD_Field_Trl WHERE AD_Field_ID=203033 +; + +-- May 29, 2014 6:19:52 AM ICT +DELETE FROM AD_Field WHERE AD_Field_ID=203033 +; + +-- May 29, 2014 6:19:52 AM ICT +DELETE FROM AD_Field_Trl WHERE AD_Field_ID=203034 +; + +-- May 29, 2014 6:19:52 AM ICT +DELETE FROM AD_Field WHERE AD_Field_ID=203034 +; + +-- May 29, 2014 6:20:37 AM ICT +DELETE FROM AD_Column_Trl WHERE AD_Column_ID=211251 +; + +-- May 29, 2014 6:20:37 AM ICT +DELETE FROM AD_Column WHERE AD_Column_ID=211251 +; + +-- May 29, 2014 6:20:38 AM ICT +DELETE FROM AD_Column_Trl WHERE AD_Column_ID=211256 +; + +-- May 29, 2014 6:20:38 AM ICT +DELETE FROM AD_Column WHERE AD_Column_ID=211256 +; + +-- May 29, 2014 6:20:38 AM ICT +DELETE FROM AD_Column_Trl WHERE AD_Column_ID=211250 +; + +-- May 29, 2014 6:20:38 AM ICT +DELETE FROM AD_Column WHERE AD_Column_ID=211250 +; + +ALTER TABLE ad_infoprocess DROP COLUMN name +; + +ALTER TABLE ad_infoprocess DROP COLUMN description +; + +ALTER TABLE ad_infoprocess DROP COLUMN help +; + +-- May 29, 2014 6:21:41 AM ICT +INSERT INTO AD_Message (MsgType,MsgText,AD_Message_ID,EntityType,AD_Message_UU,Value,IsActive,Updated,CreatedBy,UpdatedBy,AD_Client_ID,AD_Org_ID,Created) VALUES ('M','Process Menu',200275,'D','c7cb8357-7a1f-46ab-9957-cda58431adfd','ProcessMenu','Y',TO_TIMESTAMP('2014-05-29 06:21:35','YYYY-MM-DD HH24:MI:SS'),100,100,0,0,TO_TIMESTAMP('2014-05-29 06:21:35','YYYY-MM-DD HH24:MI:SS')) +; +SELECT register_migration_script('201405291604_IDEMPIERE-1334.sql') FROM dual +; diff --git a/org.adempiere.base/src/org/compiere/model/I_AD_InfoProcess.java b/org.adempiere.base/src/org/compiere/model/I_AD_InfoProcess.java index 5447ba5e7e..8b4aeb384d 100644 --- a/org.adempiere.base/src/org/compiere/model/I_AD_InfoProcess.java +++ b/org.adempiere.base/src/org/compiere/model/I_AD_InfoProcess.java @@ -126,32 +126,6 @@ public interface I_AD_InfoProcess */ public int getCreatedBy(); - /** Column name Description */ - public static final String COLUMNNAME_Description = "Description"; - - /** Set Description. - * Optional short description of the record - */ - public void setDescription (String Description); - - /** Get Description. - * Optional short description of the record - */ - public String getDescription(); - - /** Column name Help */ - public static final String COLUMNNAME_Help = "Help"; - - /** Set Comment/Help. - * Comment or Hint - */ - public void setHelp (String Help); - - /** Get Comment/Help. - * Comment or Hint - */ - public String getHelp(); - /** Column name ImageURL */ public static final String COLUMNNAME_ImageURL = "ImageURL"; @@ -191,19 +165,6 @@ public interface I_AD_InfoProcess */ public String getLayoutType(); - /** Column name Name */ - public static final String COLUMNNAME_Name = "Name"; - - /** Set Name. - * Alphanumeric identifier of the entity - */ - public void setName (String Name); - - /** Get Name. - * Alphanumeric identifier of the entity - */ - public String getName(); - /** Column name SeqNo */ public static final String COLUMNNAME_SeqNo = "SeqNo"; diff --git a/org.adempiere.base/src/org/compiere/model/X_AD_InfoProcess.java b/org.adempiere.base/src/org/compiere/model/X_AD_InfoProcess.java index cae0406839..5e55528c03 100644 --- a/org.adempiere.base/src/org/compiere/model/X_AD_InfoProcess.java +++ b/org.adempiere.base/src/org/compiere/model/X_AD_InfoProcess.java @@ -29,7 +29,7 @@ public class X_AD_InfoProcess extends PO implements I_AD_InfoProcess, I_Persiste /** * */ - private static final long serialVersionUID = 20140528L; + private static final long serialVersionUID = 20140529L; /** Standard Constructor */ public X_AD_InfoProcess (Properties ctx, int AD_InfoProcess_ID, String trxName) @@ -42,7 +42,6 @@ public class X_AD_InfoProcess extends PO implements I_AD_InfoProcess, I_Persiste setAD_Process_ID (0); setLayoutType (null); // B - setName (null); setSeqNo (0); // @SQL=SELECT NVL(MAX(SeqNo),0)+10 AS DefaultValue FROM AD_InfoProcess WHERE AD_InfoWindow_ID=@AD_InfoWindow_ID@ } */ @@ -166,40 +165,6 @@ public class X_AD_InfoProcess extends PO implements I_AD_InfoProcess, I_Persiste return ii.intValue(); } - /** Set Description. - @param Description - Optional short description of the record - */ - public void setDescription (String Description) - { - set_Value (COLUMNNAME_Description, Description); - } - - /** Get Description. - @return Optional short description of the record - */ - public String getDescription () - { - return (String)get_Value(COLUMNNAME_Description); - } - - /** Set Comment/Help. - @param Help - Comment or Hint - */ - public void setHelp (String Help) - { - set_Value (COLUMNNAME_Help, Help); - } - - /** Get Comment/Help. - @return Comment or Hint - */ - public String getHelp () - { - return (String)get_Value(COLUMNNAME_Help); - } - /** Set Image URL. @param ImageURL URL of image @@ -243,23 +208,6 @@ public class X_AD_InfoProcess extends PO implements I_AD_InfoProcess, I_Persiste return (String)get_Value(COLUMNNAME_LayoutType); } - /** Set Name. - @param Name - Alphanumeric identifier of the entity - */ - public void setName (String Name) - { - set_Value (COLUMNNAME_Name, Name); - } - - /** Get Name. - @return Alphanumeric identifier of the entity - */ - public String getName () - { - return (String)get_Value(COLUMNNAME_Name); - } - /** Set Sequence. @param SeqNo Method of ordering records; lowest number comes first diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/info/InfoWindow.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/info/InfoWindow.java index adda53069c..07835bbf7b 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/info/InfoWindow.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/info/InfoWindow.java @@ -56,6 +56,7 @@ import org.compiere.model.MInfoColumn; import org.compiere.model.MInfoWindow; import org.compiere.model.MLookupFactory; import org.compiere.model.MLookupInfo; +import org.compiere.model.MProcess; import org.compiere.model.MRole; import org.compiere.model.MTable; import org.compiere.model.X_AD_InfoColumn; @@ -165,8 +166,14 @@ public class InfoWindow extends InfoPanel implements ValueChangeListener, EventL infoContext = new Properties(Env.getCtx()); p_loadedOK = loadInfoDefinition(); + // make process button only in windown mode + if (!m_lookup){ // IDEMPIERE-1334 - initInfoProcess(); + boolean haveProcess = initInfoProcess(); + // when have a process, force multi select mode + if (haveProcess) + p_multipleSelection = true; + } loadInfoRelatedTabs(); if (loadedOK()) { @@ -188,10 +195,11 @@ public class InfoWindow extends InfoPanel implements ValueChangeListener, EventL * IDEMPIERE-1334 * load info process info * layout each info process as button or dropdown item + * @return true when have process, false when no process */ - protected void initInfoProcess() { + protected boolean initInfoProcess() { if (infoWindow == null){ - return; + return false; } MInfoProcess [] infoProcessList = infoWindow.getInfoProcess(false); @@ -199,18 +207,22 @@ public class InfoWindow extends InfoPanel implements ValueChangeListener, EventL // ** layout info process flow order (button list, drop down, dialog,...) // each layout type in a loop to ensure this order + // get info from process (name, help, des), set to name of button, item menu,... + MProcess process = null; + // make list process button for (MInfoProcess infoProcess : infoProcessList){ // just add info process have layout is button if (!MInfoProcess.LAYOUTTYPE_Button.equals(infoProcess.getLayoutType())){ continue; } - Button btProcess = confirmPanel.addProcessButton(infoProcess.getName(), infoProcess.getImageURL()); + process = MProcess.get(Env.getCtx(), infoProcess.getAD_Process_ID()); + Button btProcess = confirmPanel.addProcessButton(process.get_Translation(MProcess.COLUMNNAME_Name), infoProcess.getImageURL()); // save process_id, handle event will use btProcess.setAttribute(PROCESS_ID_KEY, new Integer(infoProcess.getAD_Process_ID())); btProcess.addEventListener(Events.ON_CLICK, this); // save info process to use in handle event - btProcess.setAttribute(ATT_INFO_PROCESS_KEY, infoProcess); + btProcess.setAttribute(ATT_INFO_PROCESS_KEY, process); // update tooltip hepl when focus btProcess.addEventListener(Events.ON_FOCUS, this); btProcessList.add(btProcess); @@ -231,8 +243,9 @@ public class InfoWindow extends InfoPanel implements ValueChangeListener, EventL // render item, use name to display cbbProcess.setItemRenderer(new ComboitemRenderer() { public void render(Comboitem item, MInfoProcess data, int index){ - item.setValue(data); - item.setLabel(data.getName()); + MProcess process = MProcess.get(Env.getCtx(), data.getAD_Process_ID()); + item.setValue(process); + item.setLabel(process.get_Translation(MProcess.COLUMNNAME_Name)); if (data.getImageURL() != null && data.getImageURL().trim().length() > 0){ item.setImage(ThemeManager.getThemeResource("images/" + data.getImageURL() + ".png")); } @@ -257,6 +270,8 @@ public class InfoWindow extends InfoPanel implements ValueChangeListener, EventL continue; } + process = MProcess.get(Env.getCtx(), infoProcess.getAD_Process_ID()); + // init popup menu if (ipMenu == null){ ipMenu = new Menupopup(); @@ -264,13 +279,13 @@ public class InfoWindow extends InfoPanel implements ValueChangeListener, EventL confirmPanel.appendChild(ipMenu); // init button to show menu - btMenuProcess = confirmPanel.addProcessButton(Msg.getMsg(Env.getCtx(), ConfirmPanel.A_PROCESS), null); + btMenuProcess = confirmPanel.addProcessButton("ProcessMenu", null); btMenuProcess.setPopup("ipMenu, before_start"); } // make menu item for each info process Menuitem ipMenuItem = new Menuitem(); - ipMenuItem.setLabel(infoProcess.getName()); + ipMenuItem.setLabel(process.get_Translation(MProcess.COLUMNNAME_Name)); if (infoProcess.getImageURL() != null && infoProcess.getImageURL().trim().length() > 0){ ipMenuItem.setImage(ThemeManager.getThemeResource("images/" + infoProcess.getImageURL() + ".png")); } @@ -279,6 +294,7 @@ public class InfoWindow extends InfoPanel implements ValueChangeListener, EventL ipMenu.appendChild(ipMenuItem); } + return infoProcessList.length > 0; } private void processQueryValue() { @@ -1175,8 +1191,8 @@ public class InfoWindow extends InfoPanel implements ValueChangeListener, EventL if (event.getName().equals(Events.ON_FOCUS) && event.getTarget() != null && event.getTarget().getAttribute(ATT_INFO_PROCESS_KEY) != null){ - MInfoProcess ipOfBt = (MInfoProcess)event.getTarget().getAttribute(ATT_INFO_PROCESS_KEY); - SessionManager.getAppDesktop().updateHelpTooltip(ipOfBt.getName(), ipOfBt.getDescription(), ipOfBt.getHelp(), null); + MProcess process = (MProcess)event.getTarget().getAttribute(ATT_INFO_PROCESS_KEY); + SessionManager.getAppDesktop().updateHelpTooltip(process.get_Translation(MProcess.COLUMNNAME_Name), process.get_Translation(MProcess.COLUMNNAME_Description), process.get_Translation(MProcess.COLUMNNAME_Help), null); } else if (event.getName().equals(Events.ON_FOCUS)) { for (WEditor editor : editors) @@ -1191,8 +1207,9 @@ public class InfoWindow extends InfoPanel implements ValueChangeListener, EventL // update help panel when change select item in combobox process Comboitem selectedItem = cbbProcess.getSelectedItem(); if (selectedItem != null && selectedItem.getValue() != null){ - MInfoProcess selectedValue = (MInfoProcess)selectedItem.getValue(); - SessionManager.getAppDesktop().updateHelpTooltip(selectedValue.getName(), selectedValue.getDescription(), selectedValue.getHelp(), null); + MProcess selectedValue = (MProcess)selectedItem.getValue(); + + SessionManager.getAppDesktop().updateHelpTooltip(selectedValue.get_Translation(MProcess.COLUMNNAME_Name), selectedValue.get_Translation(MProcess.COLUMNNAME_Description), selectedValue.get_Translation(MProcess.COLUMNNAME_Help), null); } } diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/InfoPanel.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/InfoPanel.java index 85429c7633..9036c0081c 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/InfoPanel.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/InfoPanel.java @@ -32,8 +32,6 @@ import java.util.List; import java.util.Map; import java.util.Vector; import java.util.logging.Level; - -import org.adempiere.model.MInfoProcess; import org.adempiere.webui.AdempiereWebUI; import org.adempiere.webui.apps.AEnv; import org.adempiere.webui.apps.BusyDialog; @@ -136,7 +134,7 @@ public abstract class InfoPanel extends Window implements EventListener, /** Window Width */ static final int INFO_WIDTH = 800; - private boolean m_lookup; + protected boolean m_lookup; /************************************************** * Detail Constructor @@ -1168,8 +1166,8 @@ public abstract class InfoPanel extends Window implements EventListener, return; } - MInfoProcess selectedInfoProcess = (MInfoProcess)cbbSelectedItem.getValue(); - preRunProcess(selectedInfoProcess.getAD_Process_ID()); + MProcess selectedProcess = (MProcess)cbbSelectedItem.getValue(); + preRunProcess(selectedProcess.getAD_Process_ID()); } else if (btProcessList.contains(event.getTarget())){ // click bt process in case display button list diff --git a/org.adempiere.ui.zk/theme/default/images/ProcessMenu16.png b/org.adempiere.ui.zk/theme/default/images/ProcessMenu16.png new file mode 100644 index 0000000000000000000000000000000000000000..7daf460cea0dac95116dd8dc09877230224a5fd7 GIT binary patch literal 880 zcmV-$1CRWPP)_5XcHCZy|WFV<$US$l8Tg56#e}0Ha{g+9)VBQo|x2@AezPQD13rR+#IW zCfwsSzIaIFl77tyoa)@EhYALora^CqAiHLu?95pyLD|bX`I%i(f|S78Tv%C2|GKt% zZZ!wDwhD?25cl>7&J4F7$Jg8?oW*K#vHcrEN#F{gfNnqoprq|5|1`;nv4;ce-HbYa!0pS*Z&b3sfe zin+SDb8^wD*#W2`o50sakslv&Ae6f^Hipx(UmT~Vx3?9NZ>hUUbEAO z#K_3V4qz`(i&A9*XPcr(XxNpvq~947%GIW~9r@_%e=7PeC%m?dt!OS6xw~5QXnRom zKt!X_Kp+s$kgdbkfez-F%U3fV!|?p ziHj(mIO24sn+BMI3=*@&j0Bv5qi!s0bnR+OHwW!I+qZrDzW2TNKF{%ww%BeX#*>_T z&pA2woAW*AJkN!zNZf;!jnG;@=YRP#F6NE4JEP-wycHe4^Y7-^4L#31R182-63UAq z;av?0VwVTjw!v?ISi%j>?s|1A&OZCc>50;mf|KZRrVn=ks)_chjklCPbN_pm-iNMD zrrfEu|4QrMwrtOE^u$s;S?na^aOqHSGFjICl)6O^BJm60eueO2zY|T2OEgicisF`_ zUPFg^*Z4T87qGMI#QOVeestSS4_ul(dG2EvBs@sP&F3^qKj`Gn12kxA)lr*he-;01 zi7E#CE~RYi3MMfM}R4l?%0FCjAv`2c==5We$sKCp)GUL_xEm{EWHPq_k!Bha%6 z9{)O(36EZ2^E_<%i6nM;U&2FF01Ae-J*n z#H5Wlw74SGn8|q^z8^YQfV-(OPMM8iXp_-<{*AmHY|sIJwa$h`uU(w29(i*BvU!m8 ztKj9wsB&F)3*5J4XnYqs^#v7)BO5q3|pjKHY48d4); zx+%8%FW2j_Z$8yGGVFG(fP1>xg|byaR6#8)*b=X7x#PC(149=IdS+-G5ZbmrO?~Sp zwvXq$C*RM+WyZH;{ZOW|1;#Qi{e|_-#wlq#EuZ?Ge0DYb;Ze2#zhUXgoU_Hz`0|af zxMgkIPM(_?&Ey@P%isIyQ&Y9CWeYg27botbkKR@zPaGL1h>S*|FXc&zu;EP-bKuO+ zsHiOFFpvTYKn>8exaUskb?TNh3@VO3IkLI^xzP^CjU{kn9*ziitt#e~cW1EH5QPPz zus~Ib_X`2o)CsE_=YVeiB&@rR9l-amU^DOEH@a5_{bqIDxVUbNisHDw{_tAq+W9s) zzn~@xC5i$(N8gMAyxKpf0AE;#So6`auPU>-0+9(&Yq2(lON^A~A{r3}1*{1%CM1YL zXUTP4mV&lgZnlP&`N|h04OA~UZQhU$`}L?bDkj2c0##LGL!!{fm`JUOuu*tw$$}dT zk>R3R2Gt^Jv1)ljEo;b1U(Rl~a{f)%(q@zKRii5>NuqDm87q>Lc zzVtDgcaH~*NWbU59qL|Y+wKE3jhqj00000NkvXXu0mjf7b^K^ literal 0 HcmV?d00001