From e79b532d95aecad93c9e297c15b1e88431490cf3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lorenzo=20Tilve=20=C3=81lvaro?= Date: Mon, 26 Nov 2012 09:44:04 +0100 Subject: [PATCH] Added onClick listener to project names on company view to enter into the planning This is done using the entry point /planner/index.zul;order=order-code which also helps browser history management to enable bookmarking, refreshing or use the back button. The link to the taks from the project view is not added due to an interaction it has with the system to prevent from leaving the current URL, which would need to be written with anchors to avoid this interaction. FEA: ItEr77S03Community --- .../main/java/org/zkoss/ganttz/LeftTasksTreeRow.java | 12 ++++++++++++ .../src/main/webapp/common/css/libreplan_zk.css | 4 ++++ 2 files changed, 16 insertions(+) diff --git a/ganttzk/src/main/java/org/zkoss/ganttz/LeftTasksTreeRow.java b/ganttzk/src/main/java/org/zkoss/ganttz/LeftTasksTreeRow.java index b0dec0e58..29fac422c 100644 --- a/ganttzk/src/main/java/org/zkoss/ganttz/LeftTasksTreeRow.java +++ b/ganttzk/src/main/java/org/zkoss/ganttz/LeftTasksTreeRow.java @@ -41,8 +41,11 @@ import org.zkoss.ganttz.data.Task; import org.zkoss.ganttz.util.ComponentsFinder; import org.zkoss.util.Locales; import org.zkoss.zk.ui.Component; +import org.zkoss.zk.ui.Execution; +import org.zkoss.zk.ui.Executions; import org.zkoss.zk.ui.event.Event; import org.zkoss.zk.ui.event.EventListener; +import org.zkoss.zk.ui.event.Events; import org.zkoss.zk.ui.event.KeyEvent; import org.zkoss.zk.ui.util.GenericForwardComposer; import org.zkoss.zul.Datebox; @@ -421,6 +424,15 @@ public class LeftTasksTreeRow extends GenericForwardComposer { } else { nameLabel.setValue(task.getName()); nameLabel.setTooltiptext(task.getName()); + nameLabel.setSclass("clickable-rows"); + nameLabel.addEventListener(Events.ON_CLICK, new EventListener() { + @Override + public void onEvent(Event arg0) throws Exception { + Executions.getCurrent().sendRedirect( + "/planner/index.zul;order=" + + task.getProjectCode()); + } + }); startDateLabel.setValue(asString(task.getBeginDate() .toDayRoundedDate())); endDateLabel.setValue(asString(task.getEndDate() diff --git a/libreplan-webapp/src/main/webapp/common/css/libreplan_zk.css b/libreplan-webapp/src/main/webapp/common/css/libreplan_zk.css index f3128fbdf..e502bfc65 100644 --- a/libreplan-webapp/src/main/webapp/common/css/libreplan_zk.css +++ b/libreplan-webapp/src/main/webapp/common/css/libreplan_zk.css @@ -1326,6 +1326,10 @@ overflow: visible; cursor: pointer; } +.clickable-rows:hover { + text-decoration: underline; +} + .clickable-rows tr.z-row:hover .z-row-cnt { color: #000000; }