diff --git a/libreplan-webapp/src/main/java/org/libreplan/web/logs/IssueLogCRUDController.java b/libreplan-webapp/src/main/java/org/libreplan/web/logs/IssueLogCRUDController.java index 18ba2cf8f..de7b110ac 100644 --- a/libreplan-webapp/src/main/java/org/libreplan/web/logs/IssueLogCRUDController.java +++ b/libreplan-webapp/src/main/java/org/libreplan/web/logs/IssueLogCRUDController.java @@ -24,6 +24,7 @@ import static org.libreplan.web.I18nHelper._; import java.util.ArrayList; import java.util.Date; import java.util.List; +import java.util.Objects; import org.apache.commons.logging.LogFactory; import org.libreplan.business.common.exceptions.InstanceNotFoundException; @@ -46,6 +47,9 @@ import org.zkoss.zk.ui.event.EventListener; import org.zkoss.zk.ui.event.Events; import org.zkoss.zul.*; +import javax.swing.*; +import javax.swing.table.TableCellEditor; + /** * Controller for IssueLog CRUD actions * @@ -182,10 +186,28 @@ public class IssueLogCRUDController extends BaseCRUDController { appendDate(row, issueLog.getDateResolved()); appendLabel(row, issueLog.getNotes()); appendOperations(row, issueLog); + setPriorityColor(row, issueLog.getPriority()); } }; } + private void setPriorityColor(Row row, LowMediumHighEnum priority) { + if (priority == LowMediumHighEnum.LOW) { + Cell cell = (Cell) row.getChildren().get(5); + cell.setClass("Issuelog-priority-color-green"); + } + + if (priority == LowMediumHighEnum.MEDIUM) { + Cell cell = (Cell) row.getChildren().get(5); + cell.setClass("Issuelog-priority-color-yellow"); + } + + if (priority == LowMediumHighEnum.HIGH) { + Cell cell = (Cell) row.getChildren().get(5); + cell.setClass("Issuelog-priority-color-red"); + } + } + /** * Appends the specified object to the specified * row @@ -210,7 +232,9 @@ public class IssueLogCRUDController extends BaseCRUDController { */ private void appendLabel(final Row row, String value) { Label label = new Label(value); - row.appendChild(label); + Cell cell = new Cell(); + cell.appendChild(label); + row.appendChild(cell); } /** 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 1354fa15a..e2b53694f 100644 --- a/libreplan-webapp/src/main/webapp/common/css/libreplan_zk.css +++ b/libreplan-webapp/src/main/webapp/common/css/libreplan_zk.css @@ -1940,3 +1940,15 @@ select { .z-menu-popup a:focus { text-decoration: none !important; } + +.Issuelog-priority-color-red { + background: red !important; +} + +.Issuelog-priority-color-yellow { + background: yellow !important; +} + +.Issuelog-priority-color-green { + background: green !important; +} diff --git a/libreplan-webapp/src/main/webapp/logs/_listIssueLog.zul b/libreplan-webapp/src/main/webapp/logs/_listIssueLog.zul index 10c9ff2f9..497a13f96 100644 --- a/libreplan-webapp/src/main/webapp/logs/_listIssueLog.zul +++ b/libreplan-webapp/src/main/webapp/logs/_listIssueLog.zul @@ -21,9 +21,9 @@ pageSize="15" span="0" sizedByContent="false" rowRenderer="@{issueLogController.issueLogsRowRenderer}"> - + - +