IDEMPIERE-1334:Run one or more processes from Info Window
fix comment of carlos
This commit is contained in:
parent
3d53cf43db
commit
c656bd52ad
|
@ -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
|
||||
;
|
|
@ -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
|
||||
;
|
|
@ -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";
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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<MInfoProcess>() {
|
||||
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);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -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<Event>,
|
|||
|
||||
/** 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<Event>,
|
|||
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
|
||||
|
|
Binary file not shown.
After Width: | Height: | Size: 880 B |
Binary file not shown.
After Width: | Height: | Size: 1.5 KiB |
Loading…
Reference in New Issue