diff --git a/AxonIvyPortal/portal/src/com/axonivy/portal/bean/NotificationBean.java b/AxonIvyPortal/portal/src/com/axonivy/portal/bean/NotificationBean.java index 9463e2596f2..13fea63e014 100644 --- a/AxonIvyPortal/portal/src/com/axonivy/portal/bean/NotificationBean.java +++ b/AxonIvyPortal/portal/src/com/axonivy/portal/bean/NotificationBean.java @@ -137,20 +137,23 @@ private boolean isWebChannelEnableByUser() { return false; } + public void startTask(NotificationDto dto) { + markAsRead(dto); + PortalNavigator.redirect(dto.getRunAction().getLink().getRelative()); + } + public void startTaskFromNotification(NotificationDto dto, boolean isWorkingTask, ITask task) { if (isWorkingTask && task.getState() != TaskState.DONE) { PrimeFaces.current().executeScript(String.format("checkWarningLogForTaskStart('%s', '%s')", dto.getId(), task.getId())); return; } - markAsRead(dto); - PortalNavigator.redirect(dto.getRunAction().getLink().getRelative()); + startTask(dto); } public void startTaskFromNotiId() { String notificationId = FacesContext.getCurrentInstance().getExternalContext().getRequestParameterMap().get("notificationId"); NotificationDto dto = dataModel.findById(notificationId); - markAsRead(dto); - PortalNavigator.redirect(dto.getRunAction().getLink().getRelative()); + startTask(dto); } public void goToNotificationDetail(NotificationDto dto, boolean isWorkingTask, ITask task) { @@ -158,8 +161,7 @@ public void goToNotificationDetail(NotificationDto dto, boolean isWorkingTask, I PrimeFaces.current().executeScript(String.format("checkWarningLogForTaskDetail('%s', '%s')", dto.getId(), task.getId())); return; } - markAsRead(dto); - PortalNavigator.redirect(dto.getInfoAction().getLink().getRelative()); + goToTaskDetail(dto); } public void goToTaskDetail(NotificationDto dto) { diff --git a/AxonIvyPortal/portal/src_hd/com/axonivy/portal/component/NotificationFullPage/NotificationFullPage.xhtml b/AxonIvyPortal/portal/src_hd/com/axonivy/portal/component/NotificationFullPage/NotificationFullPage.xhtml index f95737bb93a..a0bef9b0d40 100644 --- a/AxonIvyPortal/portal/src_hd/com/axonivy/portal/component/NotificationFullPage/NotificationFullPage.xhtml +++ b/AxonIvyPortal/portal/src_hd/com/axonivy/portal/component/NotificationFullPage/NotificationFullPage.xhtml @@ -60,7 +60,7 @@
+ actionListener="#{notificationBean.startTask(notification)}" rendered="#{notification.runAction != null}">