diff --git a/migration/i5.1/oracle/201512121402_IDEMPIERE-2970.sql b/migration/i5.1/oracle/201512121402_IDEMPIERE-2970.sql new file mode 100644 index 0000000000..babd7de579 --- /dev/null +++ b/migration/i5.1/oracle/201512121402_IDEMPIERE-2970.sql @@ -0,0 +1,15 @@ +SET SQLBLANKLINES ON +SET DEFINE OFF + +-- IDEMPIERE-2970 Display URL in the Record info panel +-- Dec 12, 2015 2:00:57 PM COT +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','Permalink',0,0,'Y',TO_DATE('2015-12-12 14:00:57','YYYY-MM-DD HH24:MI:SS'),100,TO_DATE('2015-12-12 14:00:57','YYYY-MM-DD HH24:MI:SS'),100,200369,'Permalink','D','df044d1d-59d8-4d56-85ef-66c459cf45ea') +; + +-- Dec 12, 2015 2:02:04 PM COT +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','Right click and copy link for a permanent link to this record.',0,0,'Y',TO_DATE('2015-12-12 14:02:03','YYYY-MM-DD HH24:MI:SS'),100,TO_DATE('2015-12-12 14:02:03','YYYY-MM-DD HH24:MI:SS'),100,200370,'Permalink_tooltip','D','cec80265-768c-495c-be62-1a321d356c3c') +; + +SELECT register_migration_script('201512121402_IDEMPIERE-2970.sql') FROM dual +; + diff --git a/migration/i5.1/postgresql/201512121402_IDEMPIERE-2970.sql b/migration/i5.1/postgresql/201512121402_IDEMPIERE-2970.sql new file mode 100644 index 0000000000..51bcdade7a --- /dev/null +++ b/migration/i5.1/postgresql/201512121402_IDEMPIERE-2970.sql @@ -0,0 +1,12 @@ +-- IDEMPIERE-2970 Display URL in the Record info panel +-- Dec 12, 2015 2:00:57 PM COT +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','Permalink',0,0,'Y',TO_TIMESTAMP('2015-12-12 14:00:57','YYYY-MM-DD HH24:MI:SS'),100,TO_TIMESTAMP('2015-12-12 14:00:57','YYYY-MM-DD HH24:MI:SS'),100,200369,'Permalink','D','df044d1d-59d8-4d56-85ef-66c459cf45ea') +; + +-- Dec 12, 2015 2:02:04 PM COT +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','Right click and copy link for a permanent link to this record.',0,0,'Y',TO_TIMESTAMP('2015-12-12 14:02:03','YYYY-MM-DD HH24:MI:SS'),100,TO_TIMESTAMP('2015-12-12 14:02:03','YYYY-MM-DD HH24:MI:SS'),100,200370,'Permalink_tooltip','D','cec80265-768c-495c-be62-1a321d356c3c') +; + +SELECT register_migration_script('201512121402_IDEMPIERE-2970.sql') FROM dual +; + diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/window/WRecordInfo.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/window/WRecordInfo.java index e9f4f96459..f0452474c7 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/window/WRecordInfo.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/window/WRecordInfo.java @@ -57,9 +57,11 @@ import org.zkoss.zhtml.Text; import org.zkoss.zk.ui.event.Event; import org.zkoss.zk.ui.event.EventListener; import org.zkoss.zk.ui.event.Events; +import org.zkoss.zul.A; import org.zkoss.zul.Borderlayout; import org.zkoss.zul.Center; import org.zkoss.zul.Div; +import org.zkoss.zul.Hbox; import org.zkoss.zul.Listhead; import org.zkoss.zul.Listheader; import org.zkoss.zul.North; @@ -83,7 +85,7 @@ public class WRecordInfo extends Window implements EventListener /** * */ - private static final long serialVersionUID = -8325604065202356483L; + private static final long serialVersionUID = -7436682051825360216L; /** * Record Info @@ -135,6 +137,8 @@ public class WRecordInfo extends Window implements EventListener private Vector> m_data = new Vector>(); /** Info */ private StringBuffer m_info = new StringBuffer(); + /** Permalink */ + private A m_permalink = new A(); /** Date Time Format */ private SimpleDateFormat m_dateTimeFormat = DisplayType.getDateFormat @@ -196,7 +200,17 @@ public class WRecordInfo extends Window implements EventListener South south = new South(); south.setSclass("dialog-footer"); south.setParent(layout); - south.appendChild(confirmPanel); + // + m_permalink.setTarget("_blank"); + m_permalink.setLabel(Msg.getMsg(Env.getCtx(), "Permalink")); + m_permalink.setTooltiptext(Msg.getMsg(Env.getCtx(), "Permalink_tooltip")); + Hbox hbox = new Hbox(); + hbox.setWidth("100%"); + south.appendChild(hbox); + ZKUpdateUtil.setHflex(m_permalink, "true"); + hbox.appendChild(m_permalink); + ZKUpdateUtil.setHflex(confirmPanel, "true"); + hbox.appendChild(confirmPanel); confirmPanel.addActionListener(Events.ON_CLICK, this); } // jbInit @@ -251,6 +265,8 @@ public class WRecordInfo extends Window implements EventListener String uuid = po.get_ValueAsString(uuidcol); if (!Util.isEmpty(uuid)) m_info.append("\n ").append(uuidcol).append("=").append(uuid); + m_permalink.setHref(AEnv.getZoomUrlTableID(po)); + m_permalink.setVisible(po.get_KeyColumns().length == 1); } }