IDEMPIERE-2970 Display URL in the Record info panel

This commit is contained in:
Carlos Ruiz 2017-11-06 13:48:16 +01:00
parent 9185abf47c
commit f005a63d38
3 changed files with 45 additions and 2 deletions

View File

@ -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
;

View File

@ -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
;

View File

@ -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<Event>
/**
*
*/
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<Event>
private Vector<Vector<String>> m_data = new Vector<Vector<String>>();
/** 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<Event>
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<Event>
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);
}
}