diff --git a/migration/i1.0c-release/oracle/20130407174015_IDEMPIERE-632.sql b/migration/i1.0c-release/oracle/20130407174015_IDEMPIERE-632.sql new file mode 100644 index 0000000000..eecbd2079a --- /dev/null +++ b/migration/i1.0c-release/oracle/20130407174015_IDEMPIERE-632.sql @@ -0,0 +1,64 @@ +-- Jul 4, 2013 5:39:38 PM COT +-- Hide workflows deprecated +UPDATE AD_Workflow SET IsValid='N', IsActive='N',Updated=TO_DATE('2013-07-04 17:39:38','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Workflow_ID=50014 +; + +-- Jul 6, 2013 5:50:57 PM COT +UPDATE AD_Workflow SET IsValid='Y', IsActive='N',Updated=TO_DATE('2013-07-06 17:50:57','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Workflow_ID=119 +; + +-- Jul 6, 2013 5:51:01 PM COT +UPDATE AD_Workflow SET IsValid='Y', IsActive='N',Updated=TO_DATE('2013-07-06 17:51:01','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Workflow_ID=50009 +; + +-- Jul 6, 2013 5:51:11 PM COT +UPDATE AD_Workflow SET IsValid='Y', IsActive='N',Updated=TO_DATE('2013-07-06 17:51:11','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Workflow_ID=50011 +; + +-- Jul 6, 2013 5:51:31 PM COT +UPDATE AD_Workflow SET IsValid='Y', IsActive='N',Updated=TO_DATE('2013-07-06 17:51:31','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Workflow_ID=50008 +; + +-- Jul 6, 2013 5:51:39 PM COT +UPDATE AD_Workflow SET IsValid='Y', IsActive='N',Updated=TO_DATE('2013-07-06 17:51:39','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Workflow_ID=50013 +; + +-- Jul 6, 2013 5:52:09 PM COT +UPDATE AD_Workflow SET IsValid='Y', IsActive='N',Updated=TO_DATE('2013-07-06 17:52:09','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Workflow_ID=50002 +; + +-- Jul 6, 2013 5:52:16 PM COT +UPDATE AD_Workflow SET IsValid='Y', IsActive='N',Updated=TO_DATE('2013-07-06 17:52:16','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Workflow_ID=50005 +; + +-- Jul 6, 2013 5:52:28 PM COT +UPDATE AD_Workflow SET IsValid='N', IsActive='N',Updated=TO_DATE('2013-07-06 17:52:28','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Workflow_ID=50007 +; + +-- Jul 6, 2013 5:52:36 PM COT +UPDATE AD_Workflow SET IsValid='Y', IsActive='N',Updated=TO_DATE('2013-07-06 17:52:36','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Workflow_ID=50010 +; + +-- Jul 6, 2013 5:52:41 PM COT +UPDATE AD_Workflow SET IsValid='Y', IsActive='N',Updated=TO_DATE('2013-07-06 17:52:41','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Workflow_ID=50006 +; + +-- Jul 6, 2013 5:53:07 PM COT +UPDATE AD_Workflow SET IsValid='Y', IsActive='N',Updated=TO_DATE('2013-07-06 17:53:07','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Workflow_ID=50000 +; + +-- Jul 6, 2013 5:53:11 PM COT +UPDATE AD_Workflow SET IsValid='Y', IsActive='N',Updated=TO_DATE('2013-07-06 17:53:11','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Workflow_ID=50001 +; + +-- Jul 6, 2013 5:53:14 PM COT +UPDATE AD_Workflow SET IsValid='Y', IsActive='N',Updated=TO_DATE('2013-07-06 17:53:14','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Workflow_ID=50004 +; + +-- Jul 6, 2013 5:53:27 PM COT +UPDATE AD_Workflow SET IsValid='N', IsActive='N',Updated=TO_DATE('2013-07-06 17:53:27','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Workflow_ID=50003 +; + +SELECT register_migration_script('20130407174015_IDEMPIERE-632.sql') FROM dual +; + diff --git a/migration/i1.0c-release/postgresql/20130407174015_IDEMPIERE-632.sql b/migration/i1.0c-release/postgresql/20130407174015_IDEMPIERE-632.sql new file mode 100644 index 0000000000..a9138c9c63 --- /dev/null +++ b/migration/i1.0c-release/postgresql/20130407174015_IDEMPIERE-632.sql @@ -0,0 +1,65 @@ +-- Jul 4, 2013 5:39:38 PM COT +-- Hide workflows deprecated +UPDATE AD_Workflow SET IsValid='N', IsActive='N',Updated=TO_TIMESTAMP('2013-07-04 17:39:38','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Workflow_ID=50014 +; + +-- Jul 6, 2013 5:50:57 PM COT +UPDATE AD_Workflow SET IsValid='Y', IsActive='N',Updated=TO_TIMESTAMP('2013-07-06 17:50:57','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Workflow_ID=119 +; + +-- Jul 6, 2013 5:51:01 PM COT +UPDATE AD_Workflow SET IsValid='Y', IsActive='N',Updated=TO_TIMESTAMP('2013-07-06 17:51:01','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Workflow_ID=50009 +; + +-- Jul 6, 2013 5:51:11 PM COT +UPDATE AD_Workflow SET IsValid='Y', IsActive='N',Updated=TO_TIMESTAMP('2013-07-06 17:51:11','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Workflow_ID=50011 +; + +-- Jul 6, 2013 5:51:31 PM COT +UPDATE AD_Workflow SET IsValid='Y', IsActive='N',Updated=TO_TIMESTAMP('2013-07-06 17:51:31','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Workflow_ID=50008 +; + +-- Jul 6, 2013 5:51:39 PM COT +UPDATE AD_Workflow SET IsValid='Y', IsActive='N',Updated=TO_TIMESTAMP('2013-07-06 17:51:39','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Workflow_ID=50013 +; + +-- Jul 6, 2013 5:52:09 PM COT +UPDATE AD_Workflow SET IsValid='Y', IsActive='N',Updated=TO_TIMESTAMP('2013-07-06 17:52:09','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Workflow_ID=50002 +; + +-- Jul 6, 2013 5:52:16 PM COT +UPDATE AD_Workflow SET IsValid='Y', IsActive='N',Updated=TO_TIMESTAMP('2013-07-06 17:52:16','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Workflow_ID=50005 +; + +-- Jul 6, 2013 5:52:28 PM COT +UPDATE AD_Workflow SET IsValid='N', IsActive='N',Updated=TO_TIMESTAMP('2013-07-06 17:52:28','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Workflow_ID=50007 +; + +-- Jul 6, 2013 5:52:36 PM COT +UPDATE AD_Workflow SET IsValid='Y', IsActive='N',Updated=TO_TIMESTAMP('2013-07-06 17:52:36','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Workflow_ID=50010 +; + +-- Jul 6, 2013 5:52:41 PM COT +UPDATE AD_Workflow SET IsValid='Y', IsActive='N',Updated=TO_TIMESTAMP('2013-07-06 17:52:41','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Workflow_ID=50006 +; + +-- Jul 6, 2013 5:53:07 PM COT +UPDATE AD_Workflow SET IsValid='Y', IsActive='N',Updated=TO_TIMESTAMP('2013-07-06 17:53:07','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Workflow_ID=50000 +; + +-- Jul 6, 2013 5:53:11 PM COT +UPDATE AD_Workflow SET IsValid='Y', IsActive='N',Updated=TO_TIMESTAMP('2013-07-06 17:53:11','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Workflow_ID=50001 +; + +-- Jul 6, 2013 5:53:14 PM COT +UPDATE AD_Workflow SET IsValid='Y', IsActive='N',Updated=TO_TIMESTAMP('2013-07-06 17:53:14','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Workflow_ID=50004 +; + +-- Jul 6, 2013 5:53:27 PM COT +UPDATE AD_Workflow SET IsValid='N', IsActive='N',Updated=TO_TIMESTAMP('2013-07-06 17:53:27','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Workflow_ID=50003 +; + +SELECT register_migration_script('20130407174015_IDEMPIERE-632.sql') FROM dual +; + + diff --git a/org.adempiere.base/src/org/compiere/model/ModelValidationEngine.java b/org.adempiere.base/src/org/compiere/model/ModelValidationEngine.java index 68fc8cdf45..e5986554e7 100644 --- a/org.adempiere.base/src/org/compiere/model/ModelValidationEngine.java +++ b/org.adempiere.base/src/org/compiere/model/ModelValidationEngine.java @@ -41,6 +41,7 @@ import org.compiere.acct.Fact; import org.compiere.util.CLogger; import org.compiere.util.Env; import org.compiere.util.KeyNamePair; +import org.compiere.util.Util; import org.osgi.service.event.Event; /** @@ -79,7 +80,7 @@ public class ModelValidationEngine /** Engine Singleton */ private static ModelValidationEngine s_engine = null; /* flag to indicate a missing model validation class */ - private static String missingModelValidationMessage = null; + private static String missingModelValidationMessage = ""; /************************************************************************** @@ -159,7 +160,7 @@ public class ModelValidationEngine if (validator == null) { - missingModelValidationMessage = missingModelValidationMessage + + missingModelValidationMessage = missingModelValidationMessage + " Missing class " + className + (client != null ? (" on client " + client.getName()) : " global") + '\n'; } else @@ -273,7 +274,7 @@ public class ModelValidationEngine if (AD_User_ID == 0 && AD_Role_ID == 0) ; // don't validate for user system on role system else - if (missingModelValidationMessage != null) { + if (! Util.isEmpty(missingModelValidationMessage)) { MSystem system = MSystem.get(Env.getCtx()); if (system.isFailOnMissingModelValidator()) return missingModelValidationMessage; diff --git a/org.adempiere.pipo/src/org/adempiere/pipo2/AbstractElementHandler.java b/org.adempiere.pipo/src/org/adempiere/pipo2/AbstractElementHandler.java index 11862d0340..30c7bab2ca 100644 --- a/org.adempiere.pipo/src/org/adempiere/pipo2/AbstractElementHandler.java +++ b/org.adempiere.pipo/src/org/adempiere/pipo2/AbstractElementHandler.java @@ -368,7 +368,7 @@ public abstract class AbstractElementHandler implements ElementHandler { */ protected boolean isProcessElement(Properties ctx, String entityType) { if ("D".equals(entityType) || "C".equals(entityType)) { - return "true".equalsIgnoreCase(getUpdateMode(ctx)); + return "Y".equalsIgnoreCase(getUpdateMode(ctx)); } else { return true; } diff --git a/org.adempiere.pipo/src/org/adempiere/pipo2/PackInHandler.java b/org.adempiere.pipo/src/org/adempiere/pipo2/PackInHandler.java index 1010ac81c9..500f64a986 100644 --- a/org.adempiere.pipo/src/org/adempiere/pipo2/PackInHandler.java +++ b/org.adempiere.pipo/src/org/adempiere/pipo2/PackInHandler.java @@ -191,9 +191,9 @@ public class PackInHandler extends DefaultHandler { packageInst.saveEx(); } - m_ctx.ctx.put("AD_Package_Imp_ID", String.valueOf(AD_Package_Imp_ID)); - m_ctx.ctx.put("UpdateMode", m_updateDictionary); - m_ctx.ctx.put("PackageDirectory", packageDirectory); + Env.setContext(m_ctx.ctx, "AD_Package_Imp_ID", String.valueOf(AD_Package_Imp_ID)); + Env.setContext(m_ctx.ctx, "UpdateMode", m_updateDictionary); + Env.setContext(m_ctx.ctx, "PackageDirectory", packageDirectory); m_ctx.packIn = packIn; } else { Element e = new Element(uri, localName, qName, new AttributesImpl(atts)); diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/apps/wf/WFEditor.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/apps/wf/WFEditor.java index 42bb4c74a4..2e768f1e36 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/apps/wf/WFEditor.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/apps/wf/WFEditor.java @@ -92,11 +92,17 @@ public class WFEditor extends ADForm { Borderlayout layout = new Borderlayout(); layout.setStyle("width: 100%; height: 100%; position: absolute;"); appendChild(layout); - - String sql = MRole.getDefault().addAccessSQL( - "SELECT AD_Workflow_ID, Name FROM AD_Workflow ORDER BY 2", + String sql; + boolean isBaseLanguage = Env.isBaseLanguage(Env.getCtx(), "AD_Workflow"); + if (isBaseLanguage) + sql = MRole.getDefault().addAccessSQL( + "SELECT AD_Workflow_ID, Name FROM AD_Workflow WHERE IsActive='Y' ORDER BY 2", "AD_Workflow", MRole.SQL_NOTQUALIFIED, MRole.SQL_RO); // all - KeyNamePair[] pp = DB.getKeyNamePairs(sql, true); + else + sql = MRole.getDefault().addAccessSQL( + "SELECT AD_Workflow.AD_Workflow_ID, AD_Workflow_Trl.Name FROM AD_Workflow INNER JOIN AD_Workflow_Trl ON (AD_Workflow.AD_Workflow_ID=AD_Workflow_Trl.AD_Workflow_ID) " + + " WHERE AD_Workflow.IsActive='Y' AND AD_Workflow_Trl.AD_Language='"+Env.getAD_Language(Env.getCtx())+"' ORDER BY 2","AD_Workflow", MRole.SQL_FULLYQUALIFIED, MRole.SQL_RO); // all + KeyNamePair[] pp = DB.getKeyNamePairs(sql, true); workflowList = ListboxFactory.newDropdownListbox(); for (KeyNamePair knp : pp) { @@ -378,7 +384,7 @@ public class WFEditor extends ADForm { addMenuItem(popupMenu, Msg.getMsg(Env.getCtx(), "Properties"), node, WFPopupItem.WFPOPUPITEM_PROPERTIES); // Delete node String title = Msg.getMsg(Env.getCtx(), "DeleteNode") + - ": " + node.getName(); + ": " + node.getName(true); addMenuItem(popupMenu, title, node, WFPopupItem.WFPOPUPITEM_DELETENODE); } MWFNode[] nodes = m_wf.getNodes(true, Env.getAD_Client_ID(Env.getCtx())); @@ -412,7 +418,7 @@ public class WFEditor extends ADForm { if (!found) { String title = Msg.getMsg(Env.getCtx(), "AddLine") - + ": " + node.getName() + " -> " + nn.getName(); + + ": " + node.getName(true) + " -> " + nn.getName(true); addMenuItem(popupMenu, title, node, nn.getAD_WF_Node_ID()); } } @@ -423,7 +429,7 @@ public class WFEditor extends ADForm { continue; MWFNode next = MWFNode.get(Env.getCtx(), line.getAD_WF_Next_ID()); String title = Msg.getMsg(Env.getCtx(), "DeleteLine") - + ": " + node.getName() + " -> " + next.getName(); + + ": " + node.getName(true) + " -> " + next.getName(true); addMenuItem(popupMenu, title, line); } popupMenu.setPage(target.getPage()); diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/WAttachment.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/WAttachment.java index 2a20ebc134..aaa992178e 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/WAttachment.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/WAttachment.java @@ -389,6 +389,7 @@ public class WAttachment extends Window implements EventListener { bSave.setEnabled(false); bDelete.setEnabled(false); + sizeLabel.setText(""); return false; } } @@ -453,7 +454,7 @@ public class WAttachment extends Window implements EventListener { String fileName = null; - if (cbContent.getItemCount() > index) + if (index>=0 && cbContent.getItemCount() > index) { ListItem listitem = cbContent.getItemAtIndex(index); fileName = (String)listitem.getValue(); @@ -663,8 +664,11 @@ public class WAttachment extends Window implements EventListener { if (result) { - if (m_attachment.deleteEntry(index)) + if (m_attachment.deleteEntry(index)) { cbContent.removeItemAt(index); + clearPreview(); + autoPreview (cbContent.getSelectedIndex(), true); + } m_change = true; } diff --git a/org.adempiere.ui/src/org/compiere/apps/wf/WFNodeWidget.java b/org.adempiere.ui/src/org/compiere/apps/wf/WFNodeWidget.java index 63e636aa7f..d40b2f9faa 100644 --- a/org.adempiere.ui/src/org/compiere/apps/wf/WFNodeWidget.java +++ b/org.adempiere.ui/src/org/compiere/apps/wf/WFNodeWidget.java @@ -76,7 +76,7 @@ public class WFNodeWidget extends Widget { } if (image != null) { imageWidget = new ImageWidget(scene, image); - imageWidget.setToolTipText(node.getName()); + imageWidget.setToolTipText(node.getName(true)); addChild(imageWidget); } } @@ -97,7 +97,7 @@ public class WFNodeWidget extends Widget { titleWidget.addChild (titleIcon); } - String titleText = node.getName(); + String titleText = node.getName(true); if (titleText.length() > 20) titleText = titleText.substring(0, 20) + "..."; LabelWidget titleTextWidget = new LabelWidget (scene, titleText);