Merging with main fork

This commit is contained in:
Misha 2015-12-04 15:39:56 +02:00
parent 0094d6bcf2
commit b58c4e4c17
43 changed files with 3346 additions and 3 deletions

View file

@ -40,6 +40,8 @@ import org.libreplan.business.expensesheet.daos.IExpenseSheetLineDAO;
import org.libreplan.business.externalcompanies.daos.IExternalCompanyDAO;
import org.libreplan.business.labels.daos.ILabelDAO;
import org.libreplan.business.labels.daos.ILabelTypeDAO;
import org.libreplan.business.logs.daos.IIssueLogDAO;
import org.libreplan.business.logs.daos.IRiskLogDAO;
import org.libreplan.business.materials.daos.IMaterialCategoryDAO;
import org.libreplan.business.materials.daos.IMaterialDAO;
import org.libreplan.business.materials.daos.IUnitTypeDAO;
@ -200,6 +202,12 @@ public class Registry {
@Autowired
private IExpenseSheetDAO expenseSheetDAO;
@Autowired
private IIssueLogDAO issueLogDAO;
@Autowired
private IRiskLogDAO riskLogDAO;
@Autowired
private IExpenseSheetLineDAO expenseSheetLineDAO;
@ -383,6 +391,12 @@ public class Registry {
return getInstance().expenseSheetDAO;
}
public static IIssueLogDAO getIssueLogDAO() {
return getInstance().issueLogDAO;
}
public static IRiskLogDAO getRiskLogDAO() {return getInstance().riskLogDAO;}
public static IExpenseSheetLineDAO getExpenseSheetLineDAO() {
return getInstance().expenseSheetLineDAO;
}

View file

@ -48,6 +48,8 @@ public class Configuration extends BaseEntity {
private String companyCode;
private Boolean generateCodeForProjectLog = true;
private Boolean generateCodeForCriterion = true;
private Boolean generateCodeForLabel = true;
@ -202,6 +204,12 @@ public class Configuration extends BaseEntity {
return true;
}
//TODO 2 added methods follow below
public void setGeneratedCodeForProjectLog(Boolean generateCodeForProjectLog) {
this.generateCodeForProjectLog = generateCodeForProjectLog;
}
public Boolean getGenerateCodeForProjectLog(){ return generateCodeForProjectLog;}
public void setGenerateCodeForCriterion(Boolean generateCodeForCriterion) {
this.generateCodeForCriterion = generateCodeForCriterion;
}

View file

@ -31,6 +31,8 @@ import org.libreplan.business.costcategories.entities.ResourcesCostCategoryAssig
import org.libreplan.business.costcategories.entities.TypeOfWorkHours;
import org.libreplan.business.expensesheet.entities.ExpenseSheet;
import org.libreplan.business.labels.entities.LabelType;
import org.libreplan.business.logs.entities.IssueLog;
import org.libreplan.business.logs.entities.RiskLog;
import org.libreplan.business.materials.entities.MaterialCategory;
import org.libreplan.business.materials.entities.UnitType;
import org.libreplan.business.orders.entities.Order;
@ -56,7 +58,7 @@ public enum EntityNameEnum {
"Calendar exception day", true), COST_CATEGORY("Cost category",
true), RESOURCE_CALENDAR("Resource calendar", true), CRITERION_SATISFACTION(
"Criterion satisfaction", true), RESOURCE_COST_CATEGORY_ASSIGNMENT(
"Resource cost category assignment", true), EXPENSE_SHEET("Expense sheet", true);
"Resource cost category assignment", true), EXPENSE_SHEET("Expense sheet", true), ISSUE_LOG("Issue log", true), RISK_LOG("Risk log", true);
private String description;
@ -121,6 +123,13 @@ public enum EntityNameEnum {
.getResourcesCostCategoryAssignmentDAO();
case EXPENSE_SHEET:
return (IIntegrationEntityDAO<ExpenseSheet>) Registry.getExpenseSheetDAO();
case ISSUE_LOG:
return (IIntegrationEntityDAO<IssueLog>) Registry.getIssueLogDAO();
case RISK_LOG:
return (IIntegrationEntityDAO<RiskLog>) Registry.getRiskLogDAO();
default:
throw new RuntimeException("can't handle the code sequence of the "
+ description);

View file

@ -0,0 +1,40 @@
/*
* This file is part of LibrePlan
*
* Copyright (C) 2013 St. Antoniusziekenhuis
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package org.libreplan.business.logs.daos;
import java.util.List;
import org.libreplan.business.common.daos.IIntegrationEntityDAO;
import org.libreplan.business.logs.entities.IssueLog;
/**
* Contract for {@link IssueLogDAO}
*
* @author Miciele Ghiorghis <m.ghiorghis@antoniusziekenhuis.nl>
*/
public interface IIssueLogDAO extends IIntegrationEntityDAO<IssueLog> {
/**
* Gets all the issue-logs
*
* @return a list of {@link IssueLog} objects
*/
List<IssueLog> getIssueLogs();
}

View file

@ -0,0 +1,49 @@
/*
* This file is part of LibrePlan
*
* Copyright (C) 2013 St. Antoniusziekenhuis
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package org.libreplan.business.logs.daos;
import java.util.List;
import org.libreplan.business.common.daos.IIntegrationEntityDAO;
import org.libreplan.business.logs.entities.IssueLog;
import org.libreplan.business.logs.entities.ProjectLog;
import org.libreplan.business.logs.entities.RiskLog;
/**
* Contract for {@link ProjectLogDAO}
*
* @author Miciele Ghiorghis <m.ghiorghis@antoniusziekenhuis.nl>
*/
public interface IProjectLogDAO extends IIntegrationEntityDAO<ProjectLog> {
/**
* Gets all the issue-logs
*
* @return a list of {@link IssueLog} objects
*/
List<IssueLog> getIssueLogs();
/**
* Gets all the risk logs
*
* @return a list of {@link RiskLog} objects
*/
List<RiskLog> getRiskLogs();
}

View file

@ -0,0 +1,36 @@
/*
* This file is part of LibrePlan
*
* Copyright (C) 2013 St. Antoniusziekenhuis
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package org.libreplan.business.logs.daos;
import java.util.List;
import org.libreplan.business.common.daos.IIntegrationEntityDAO;
import org.libreplan.business.logs.entities.RiskLog;
public interface IRiskLogDAO extends IIntegrationEntityDAO<RiskLog> {
/**
* Gets all the risk-logs
*
* @return a list of {@link RiskLog} objects
*/
List<RiskLog> getRiskLogs();
}

View file

@ -0,0 +1,46 @@
/*
* This file is part of LibrePlan
*
* Copyright (C) 2013 St. Antoniusziekenhuis
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package org.libreplan.business.logs.daos;
import java.util.List;
import org.libreplan.business.common.daos.IntegrationEntityDAO;
import org.libreplan.business.logs.entities.IssueLog;
import org.springframework.beans.factory.config.BeanDefinition;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Repository;
/**
* DAO for {@link IssueLog}
*
* @author Miciele Ghiorghis <m.ghiorghis@antoniusziekenhuis.nl>
*/
@Repository
@Scope(BeanDefinition.SCOPE_SINGLETON)
public class IssueLogDAO extends IntegrationEntityDAO<IssueLog> implements
IIssueLogDAO {
@Override
public List<IssueLog> getIssueLogs() {
return list(IssueLog.class);
}
}

View file

@ -0,0 +1,54 @@
/*
* This file is part of LibrePlan
*
* Copyright (C) 2013 St. Antoniusziekenhuis
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package org.libreplan.business.logs.daos;
import java.util.List;
import org.libreplan.business.common.daos.IntegrationEntityDAO;
import org.libreplan.business.logs.entities.IssueLog;
import org.libreplan.business.logs.entities.ProjectLog;
import org.libreplan.business.logs.entities.RiskLog;
import org.springframework.beans.factory.config.BeanDefinition;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Repository;
import org.springframework.transaction.annotation.Transactional;
/**
* DAO for {@link ProjectLog}
*
* @author Miciele Ghiorghis <m.ghiorghis@antoniusziekenhuis.nl>
*/
@Repository
@Scope(BeanDefinition.SCOPE_SINGLETON)
@Transactional
public class ProjectLogDAO extends IntegrationEntityDAO<ProjectLog> implements
IProjectLogDAO {
@Override
public List<IssueLog> getIssueLogs() {
return list(IssueLog.class);
}
@Override
public List<RiskLog> getRiskLogs() {
return list(RiskLog.class);
}
}

View file

@ -0,0 +1,46 @@
/*
* This file is part of LibrePlan
*
* Copyright (C) 2013 St. Antoniusziekenhuis
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package org.libreplan.business.logs.daos;
import java.util.List;
import org.libreplan.business.common.daos.IntegrationEntityDAO;
import org.libreplan.business.logs.entities.RiskLog;
import org.springframework.beans.factory.config.BeanDefinition;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Repository;
/**
* DAO for {@link RiskLog}
*
* @author Miciele Ghiorghis <m.ghiorghis@antoniusziekenhuis.nl>
*/
@Repository
@Scope(BeanDefinition.SCOPE_SINGLETON)
public class RiskLogDAO extends IntegrationEntityDAO<RiskLog> implements
IRiskLogDAO {
@Override
public List<RiskLog> getRiskLogs() {
return list(RiskLog.class);
}
}

View file

@ -0,0 +1,158 @@
/*
* This file is part of LibrePlan
*
* Copyright (C) 2013 St. Antoniusziekenhuis
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package org.libreplan.business.logs.entities;
import javax.validation.constraints.NotNull;
import java.util.Date;
import org.libreplan.business.common.IntegrationEntity;
import org.libreplan.business.common.Registry;
import org.libreplan.business.common.daos.IIntegrationEntityDAO;
import org.libreplan.business.users.entities.User;
/**
* IssueLog entity, represents parameters to be able to administrate issues that
* come up in the project
*
* @author Misha Gozhda <misha@libreplan-enterprise.com>
*/
public class IssueLog extends ProjectLog {
private IssueTypeEnum type = IssueTypeEnum.getDefault();
private IssueStatusEnum status = IssueStatusEnum.getDefault();
private LowMediumHighEnum priority = LowMediumHighEnum.getDefault();
private LowMediumHighEnum severity = LowMediumHighEnum.getDefault();
private Date dateRaised;
private User createdBy;
private String assignedTo;
private Date dateResolved;
private Date deadline;
private String notes;
public static IssueLog create() {
return create(new IssueLog(new Date()));
}
/**
* Constructor for Hibernate. Do not use!
*/
protected IssueLog() {
}
private IssueLog(Date date) {
this.dateRaised = date;
}
public IssueTypeEnum getType() {
return type;
}
public void setType(IssueTypeEnum type) {
this.type = type;
}
public IssueStatusEnum getStatus() {
return status;
}
public void setStatus(IssueStatusEnum status) {
this.status = status;
}
@NotNull(message = "priority is not specified")
public LowMediumHighEnum getPriority() {
return priority;
}
public void setPriority(LowMediumHighEnum priority) {
this.priority = priority;
}
public LowMediumHighEnum getSeverity() {
return severity;
}
public void setSeverity(LowMediumHighEnum severity) {
this.severity = severity;
}
@NotNull(message = "date raised is not specified")
public Date getDateRaised() {
return dateRaised;
}
public void setDateRaised(Date dateEntered) {
this.dateRaised = dateEntered;
}
public User getCreatedBy() {
return createdBy;
}
public void setCreatedBy(User user) {
this.createdBy = user;
}
public String getAssignedTo() {
return assignedTo;
}
public void setAssignedTo(String assignedTo) {
this.assignedTo = assignedTo;
}
public Date getDateResolved() {
return dateResolved;
}
public void setDateResolved(Date dateResolved) {
this.dateResolved = dateResolved;
}
public Date getDeadline() {
return deadline;
}
public void setDeadline(Date decisionDate) {
this.deadline = decisionDate;
}
public String getNotes() {
return notes;
}
public void setNotes(String notes) {
this.notes = notes;
}
@Override
public String getHumanId() {
return getCode();
}
@Override
protected IIntegrationEntityDAO<? extends IntegrationEntity> getIntegrationEntityDAO() {
return (IIntegrationEntityDAO<? extends IntegrationEntity>) Registry
.getIssueLogDAO();
}
}

View file

@ -0,0 +1,26 @@
package org.libreplan.business.logs.entities;
import static org.libreplan.business.i18n.I18nHelper._;
/**
* Defines INVESTIGATING, ESCALATED, RESOLVED enums
* to be used as data type in
* {@link IssueLog}
*
* @author Misha Gozhda <misha@libreplan-enterprise.com>
*/
public enum IssueStatusEnum {
INVESTIGATING(_("INVESTIGATING")), ESCALATED(_("ESCALATED")), RESOLVED(_("RESOLVED"));
private final String issueStatusEnum;
IssueStatusEnum(String issueStatusEnum) {
this.issueStatusEnum = issueStatusEnum;
}
public String getDisplayName() {
return issueStatusEnum;
}
public static IssueStatusEnum getDefault() {
return IssueStatusEnum.INVESTIGATING;
}
}

View file

@ -0,0 +1,28 @@
package org.libreplan.business.logs.entities;
import static org.libreplan.business.i18n.I18nHelper._;
/**
* Defines PROBLEM_OR_CONCERN, REQUEST_FOR_CHANGE, OFF_SPECIFICATION enums
* to be used as data type in
* {@link IssueLog}
*
* @author Misha Gozhda <misha@libreplan-enterprise.com>
*/
public enum IssueTypeEnum {
PROBLEM_OR_CONCERN(_("PROBLEM OR CONCERN")), REQUEST_FOR_CHANGE(_("REQUEST FOR CHANGE")), OFF_SPECIFICATION(_("OFF SPECIFICATON"));
private final String issueTypeEnum;
IssueTypeEnum(String issueTypeEnum) {
this.issueTypeEnum = issueTypeEnum;
}
public String getDisplayName() {
return issueTypeEnum;
}
public static IssueTypeEnum getDefault() {
return IssueTypeEnum.OFF_SPECIFICATION;
}
}

View file

@ -0,0 +1,47 @@
/*
* This file is part of LibrePlan
*
* Copyright (C) 2013 St. Antoniusziekenhuis
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package org.libreplan.business.logs.entities;
import static org.libreplan.business.i18n.I18nHelper._;
/**
* Defines the low, medium and high enums to be used as data type in
* {@link IssueLog} and {@link RiskLog}
*
* @author Misha Gozhda <misha@libreplan-enterprise.com>
*/
public enum LowMediumHighEnum {
LOW(_("LOW")), MEDIUM(_("MEDIUM")), HIGH(_("HIGH"));
private final String lowMediumHighEnum;
LowMediumHighEnum(String lowMediumHighEnum) {
this.lowMediumHighEnum = lowMediumHighEnum;
}
public String getDisplayName() {
return lowMediumHighEnum;
}
public static LowMediumHighEnum getDefault() {
return LowMediumHighEnum.LOW;
}
}

View file

@ -0,0 +1,54 @@
/*
* This file is part of LibrePlan
*
* Copyright (C) 2013 St. Antoniusziekenhuis
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package org.libreplan.business.logs.entities;
import org.libreplan.business.common.IHumanIdentifiable;
import org.libreplan.business.common.IntegrationEntity;
import org.libreplan.business.common.Registry;
import org.libreplan.business.common.daos.IIntegrationEntityDAO;
import org.libreplan.business.orders.entities.Order;
/**
* This class is the base class for all logs like issue-log, risk-log etc.
*
* @author Misha Gozhda <misha@libreplan-enterprise.com>
*/
public abstract class ProjectLog extends IntegrationEntity implements
IHumanIdentifiable {
protected Order project;
protected String description;
public Order getOrder() {
return project;
}
public void setOrder(Order order) {
this.project = order;
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
}

View file

@ -0,0 +1,172 @@
/*
* This file is part of LibrePlan
*
* Copyright (C) 2013 St. Antoniusziekenhuis
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package org.libreplan.business.logs.entities;
import org.libreplan.business.common.IntegrationEntity;
import org.libreplan.business.common.Registry;
import org.libreplan.business.common.daos.IIntegrationEntityDAO;
import org.libreplan.business.users.entities.User;
import java.util.Date;
/**
* RiskLog entity, represents parameters to be able to administrate risks that
* come up in the project
*
* @author Misha Gozhda <misha@libreplan-enterprise.com>
*/
public class RiskLog extends ProjectLog {
private String projectName;
private String status;
private LowMediumHighEnum probability = LowMediumHighEnum.getDefault();
private LowMediumHighEnum impact = LowMediumHighEnum.getDefault();
private Date dateCreated;
private User createdBy;
private String counterMeasures;
private String contingency;
private String responsible;
private Date actionWhen;
private String notes;
private RiskScoreStatesEnum score = RiskScoreStatesEnum.getDefault();
public static RiskLog create() {
return create(new RiskLog());
}
/**
* Constructor for Hibernate. Do not use!
*/
protected RiskLog() {
}
public String getProjectName() {
return projectName;
}
public void setProjectName (String projectName) {
this.projectName = projectName;
}
public String getStatus() {
return status;
}
public void setStatus(String status) {
this.status = status;
}
public LowMediumHighEnum getProbability() {
return probability;
}
public void setProbability(LowMediumHighEnum probability) {
this.probability = probability;
}
public LowMediumHighEnum getImpact() {
return impact;
}
public void setImpact(LowMediumHighEnum impact) {
this.impact = impact;
}
public Date getDateCreated() {
return dateCreated;
}
public void setDateCreated(Date dateCreated) {
this.dateCreated = dateCreated;
}
public User getCreatedBy() {
return createdBy;
}
public void setCreatedBy(User createdBy) {
this.createdBy = createdBy;
}
public String getCounterMeasures() {
return counterMeasures;
}
public void setCounterMeasures(String counterMeasures) {
this.counterMeasures = counterMeasures;
}
public String getContingency() {
return contingency;
}
public void setContingency(String contingency) {
this.contingency = contingency;
}
public void setResponsible(String responsible) {
this.responsible = responsible;
}
public String getResponsible() {
return responsible;
}
public Date getActionWhen() {
return actionWhen;
}
public void setActionWhen(Date actionWhen) {
this.actionWhen = actionWhen;
}
public String getNotes() {
return notes;
}
public void setNotes(String notes) {
this.notes = notes;
}
public void setScoreAfterCM(RiskScoreStatesEnum scoreAfterCM) {
this.score = scoreAfterCM;
}
public RiskScoreStatesEnum getScoreAfterCM() {
return score;
}
public int getRiskScore() {
return (probability.ordinal() + 1) * (impact.ordinal() + 1);
}
@Override
public String getHumanId() {
return getCode();
}
@Override
protected IIntegrationEntityDAO<? extends IntegrationEntity> getIntegrationEntityDAO() {
return (IIntegrationEntityDAO<? extends IntegrationEntity>) Registry
.getRiskLogDAO();
}
}

View file

@ -0,0 +1,26 @@
package org.libreplan.business.logs.entities;
import static org.libreplan.business.i18n.I18nHelper._;
/**
* Defines ZERO, ONE, TWO, THREE, FOUR, SIX, NINE
* to be used as data type in
* {@link RiskLog}
*
* @author Misha Gozhda <misha@libreplan-enterprise.com>
*/
public enum RiskScoreStatesEnum {
ZERO(_("0")), ONE(_("1")), TWO(_("2")), THREE(_("3")), FOUR(_("4")), SIX(_("6")), NINE(_("9")) ;
private final String riskScoreStateEnum;
RiskScoreStatesEnum(String riskScoreStateEnum) {
this.riskScoreStateEnum = riskScoreStateEnum;
}
public String getDisplayName() {
return riskScoreStateEnum;
}
public static RiskScoreStatesEnum getDefault() {
return RiskScoreStatesEnum.ZERO;
}
}

View file

@ -97,6 +97,9 @@
<value>
org/libreplan/business/email/entities/Email.hbm.xml
</value>
<value>
org/libreplan/business/logs/entities/Logs.hbm.xml
</value>
</list>
</property>
</bean>

View file

@ -0,0 +1,107 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<hibernate-mapping package="org.libreplan.business.logs.entities" default-access="field">
<class name="IssueLog" table="issue_log">
<id name="id" column="id" type="long" access="property">
<generator class="hilo">
<param name="max_lo">100</param>
</generator>
</id>
<property name="code" access="property" not-null="true" unique="true"/>
<many-to-one name="project" class="org.libreplan.business.orders.entities.Order" lazy="false">
<column name="project" not-null="true"/>
</many-to-one>
<property name="type" access="field" not-null="true" >
<type name="org.hibernate.type.EnumType" >
<param name="enumClass">org.libreplan.business.logs.entities.IssueTypeEnum</param>
</type>
</property>
<property name="description" column="description" access="field"/>
<property name="priority" access="field" not-null="true">
<type name="org.hibernate.type.EnumType">
<param name="enumClass">org.libreplan.business.logs.entities.LowMediumHighEnum</param>
</type>
</property>
<property name="severity" access="field" not-null="true">
<type name="org.hibernate.type.EnumType">
<param name="enumClass">org.libreplan.business.logs.entities.LowMediumHighEnum</param>
</type>
</property>
<property name="dateRaised" column="date_raised" access="field" not-null="true">
</property>
<property name="assignedTo" column="assigned_to" access="field"/>
<many-to-one name="createdBy" class="org.libreplan.business.users.entities.User" lazy="false">
<column name="created_by" not-null="true"/>
</many-to-one>
<property name="deadline" column="deadline" />
<property name="dateResolved" column="date_resolved"/>
<property name="notes" column="notes" access="field"/>
</class>
<class name="RiskLog" table="risk_log">
<id name="id" column="id" type="long" access="property">
<generator class="hilo">
<param name="max_lo">100</param>
</generator>
</id>
<property name="code" access="property" not-null="true" unique="true"/>
<many-to-one name="project" class="org.libreplan.business.orders.entities.Order" lazy="false">
<column name="project" not-null="true"/>
</many-to-one>
<property name="probability" access="field" not-null="true">
<type name="org.hibernate.type.EnumType">
<param name="enumClass">org.libreplan.business.logs.entities.LowMediumHighEnum</param>
</type>
</property>
<property name="impact" access="field" not-null="true">
<type name="org.hibernate.type.EnumType">
<param name="enumClass">org.libreplan.business.logs.entities.LowMediumHighEnum</param>
</type>
</property>
<property name="dateCreated" column="date_created" access="field" not-null="true"/>
<many-to-one name="createdBy" class="org.libreplan.business.users.entities.User" lazy="false">
<column name="created_by" />
</many-to-one>
<property name="counterMeasures" column="counter_measures" access="field"/>
<property name="contingency" column="contingency" access="field"/>
<property name="responsible" column="responsible" access="field"/>
<property name="actionWhen" column="action_when" access="field"/>
<property name="notes" column="notes" access="field"/>
<property name="description" column="description" access="field"/>
<property name="status" column="status" access="field"/>
<property name="score" access="field" not-null="true">
<type name="org.hibernate.type.EnumType">
<param name="enumClass">org.libreplan.business.logs.entities.RiskScoreStatesEnum</param>
</type>
</property>
</class>
</hibernate-mapping>

View file

@ -275,6 +275,12 @@ public class CustomMenuController extends Div implements IMenuItemsRegister {
}
}, "01-introducion.html#id2"));
}
/* planningItems.add(subItem(_("RiskLog"), new ICapture() {
@Override
public void capture() {
globalView.g
}
}*/
if (SecurityUtils.isSuperuserOrUserInRoles(UserRole.ROLE_PLANNING)) {
planningItems.add(subItem(_("Resources Load"), new ICapture() {
@Override
@ -298,6 +304,13 @@ public class CustomMenuController extends Div implements IMenuItemsRegister {
planningItems.add(subItem(_("Import project"),
"/orders/imports/projectImport.zul", ""));
}
if (SecurityUtils.isSuperuserOrUserInRoles(UserRole.ROLE_CRITERIA)) {
planningItems.add(subItem(_("RiskLog"),
"/logs/issue_log.zul",
"02-criterios.html#id1"));
}
if (!planningItems.isEmpty()) {
topItem(_("Planning"), "/planner/index.zul", "", planningItems);
}

View file

@ -0,0 +1,119 @@
/*
* This file is part of LibrePlan
*
* Copyright (C) 2013 St. Antoniusziekenhuis
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package org.libreplan.web.logs;
import java.util.List;
import org.libreplan.business.common.exceptions.ValidationException;
import org.libreplan.business.logs.entities.IssueLog;
import org.libreplan.business.orders.entities.Order;
import org.libreplan.business.users.entities.User;
/**
* Contract for {@link IssueLogModel}
*
* @author Miciele Ghiorghis <m.ghiorghis@antoniusziekenhuis.nl>
*/
public interface IIssueLogModel {
/**
* Returns a list of all {@link IssueLog}
*/
List<IssueLog> getIssueLogs();
/**
* Returns a list of all {@link Order}
*/
List<Order> getOrders();
/**
* Returns current {@link Order}
*/
Order getOrder();
/**
* Sets the order
*
* @param order
* the order to be set
*/
void setOrder(Order order);
/**
* Returns a list of all {@link User}
*/
List<User> getUsers();
/**
* Returns the {@link User}
*/
User getCreatedBy();
/**
* Sets the user
*
* @param user
* the user to be set
*/
void setCreatedBy(User user);
/**
* Prepares for create a new {@link IssueLog}.
*/
void initCreate();
/**
* Prepares for edit {@link IssueLog}
*
* @param issueLog
* an object to be edited
*/
void initEdit(IssueLog issueLog);
/**
* Gets the current {@link IssueLog}.
*
* @return A {@link IssueLog}
*/
IssueLog getIssueLog();
/**
* Saves the current {@link IssueLog}
*
* @throws ValidationException
* if validation fails
*/
void confirmSave() throws ValidationException;
/**
* Cancels the current {@link IssueLog}
*/
void cancel();
/**
* Removes the current {@link IssueLog}
*
* @param issueLog
* an object to be removed
*/
void remove(IssueLog issueLog);
}

View file

@ -0,0 +1,119 @@
/*
* This file is part of LibrePlan
*
* Copyright (C) 2013 St. Antoniusziekenhuis
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package org.libreplan.web.logs;
import java.util.List;
import org.libreplan.business.common.exceptions.ValidationException;
import org.libreplan.business.logs.entities.RiskLog;
import org.libreplan.business.orders.entities.Order;
import org.libreplan.business.users.entities.User;
/**
* Contract for {@link RiskLogModel}
*
* @author Miciele Ghiorghis <m.ghiorghis@antoniusziekenhuis.nl>
*/
public interface IRiskLogModel {
/**
* Returns a list of all {@link RiskLog}
*/
List<RiskLog> getRiskLogs();
/**
* Returns a list of all {@link Order}
*/
List<Order> getOrders();
/**
* Returns current {@link Order}
*/
Order getOrder();
/**
* Sets the order
*
* @param order
* the order to set
*/
void setOrder(Order order);
/**
* Returns a list of all {@link User}
*/
List<User> getUsers();
/**
* Returns {@link User}
*/
User getCreatedBy();
/**
* Sets the user
*
* @param user
* the user to be set
*/
void setCreatedBy(User user);
/**
* Prepares for create a new {@link RiskLog}.
*/
void initCreate();
/**
* Prepares for edit {@link RiskLog}
*
* @param riskLog
* an object to be edited
*/
void initEdit(RiskLog riskLog);
/**
* Gets the current {@link RiskLog}.
*
* @return A {@link RiskLog}
*/
RiskLog getRiskLog();
/**
* Saves the current {@link RiskLog}
*
* @throws ValidationException
* if validation fails
*/
void confirmSave() throws ValidationException;
/**
* Cancels the current {@link RiskLog}
*/
void cancel();
/**
* Removes the current {@link RiskLog}
*
* @param riskLog
* an object to be removed
*/
void remove(RiskLog riskLog);
}

View file

@ -0,0 +1,420 @@
/*
* This file is part of LibrePlan
*
* Copyright (C) 2013 St. Antoniusziekenhuis
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package org.libreplan.web.logs;
import static org.libreplan.web.I18nHelper._;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import org.apache.commons.logging.LogFactory;
import org.libreplan.business.common.exceptions.InstanceNotFoundException;
import org.libreplan.business.common.exceptions.ValidationException;
import org.libreplan.business.logs.entities.IssueLog;
import org.libreplan.business.logs.entities.IssueStatusEnum;
import org.libreplan.business.logs.entities.IssueTypeEnum;
import org.libreplan.business.logs.entities.LowMediumHighEnum;
import org.libreplan.business.orders.entities.Order;
import org.libreplan.business.users.entities.User;
import org.libreplan.web.common.BaseCRUDController;
import org.libreplan.web.common.Util;
import org.libreplan.web.common.components.bandboxsearch.BandboxSearch;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.config.BeanDefinition;
import org.springframework.context.annotation.Scope;
import org.zkoss.zk.ui.Component;
import org.zkoss.zk.ui.WrongValueException;
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.*;
import org.zkoss.zk.ui.Executions;
import javax.swing.*;
/**
* Controller for IssueLog CRUD actions
*
* @author Misha Gozhda <misha@libreplan-enterprise.com>
*/
@SuppressWarnings("serial")
@org.springframework.stereotype.Component
@Scope(BeanDefinition.SCOPE_PROTOTYPE)
public class IssueLogCRUDController extends BaseCRUDController<IssueLog> {
private static final org.apache.commons.logging.Log LOG = LogFactory
.getLog(IssueLogCRUDController.class);
@Autowired
private IIssueLogModel issueLogModel;
private BandboxSearch bdProjectIssueLog;
private BandboxSearch bdUserIssueLog;
@Override
public void doAfterCompose(Component comp) throws Exception {
super.doAfterCompose(comp);
comp.setVariable("issueLogController", this, true);
showListWindow();
initializeOrderComponent();
initializeUserComponent();
}
/**
* Initializes order component
*/
private void initializeOrderComponent() {
bdProjectIssueLog = (BandboxSearch) editWindow
.getFellow("bdProjectIssueLog");
Util.createBindingsFor(bdProjectIssueLog);
bdProjectIssueLog.setListboxEventListener(Events.ON_SELECT,
new EventListener() {
@Override
public void onEvent(Event event) {
final Object object = bdProjectIssueLog
.getSelectedElement();
issueLogModel.setOrder((Order) object);
}
});
bdProjectIssueLog.setListboxEventListener(Events.ON_OK,
new EventListener() {
@Override
public void onEvent(Event event) {
final Object object = bdProjectIssueLog
.getSelectedElement();
issueLogModel.setOrder((Order) object);
bdProjectIssueLog.close();
}
});
}
/**
* Initializes user component
*/
private void initializeUserComponent() {
bdUserIssueLog = (BandboxSearch) editWindow.getFellow("bdUserIssueLog");
Util.createBindingsFor(bdUserIssueLog);
bdUserIssueLog.setListboxEventListener(Events.ON_SELECT, new EventListener() {
@Override
public void onEvent(Event event) {
final Object object = bdUserIssueLog.getSelectedElement();
issueLogModel.setCreatedBy((User) object);
}
});
bdUserIssueLog.setListboxEventListener(Events.ON_OK, new EventListener() {
@Override
public void onEvent(Event event) {
final Object object = bdUserIssueLog.getSelectedElement();
issueLogModel.setCreatedBy((User) object);
bdUserIssueLog.close();
}
});
}
/**
* Enumerations rendering
*/
public static ListitemRenderer issueTypeRenderer = new ListitemRenderer() {
@Override
public void render(org.zkoss.zul.Listitem item, Object data)
throws Exception {
IssueTypeEnum issueTypeEnum = (IssueTypeEnum) data;
String displayName = issueTypeEnum.getDisplayName();
item.setLabel(displayName);
}
};
public static ListitemRenderer issueStatusRenderer = new ListitemRenderer() {
@Override
public void render(org.zkoss.zul.Listitem item, Object data)
throws Exception {
IssueStatusEnum issueStatusEnum = (IssueStatusEnum) data;
String displayName = issueStatusEnum.getDisplayName();
item.setLabel(displayName);
}
};
public static ListitemRenderer lowMediumHighEnumRenderer = new ListitemRenderer() {
@Override
public void render(org.zkoss.zul.Listitem item, Object data)
throws Exception {
LowMediumHighEnum lowMediumHighEnum = (LowMediumHighEnum) data;
String displayName = lowMediumHighEnum.getDisplayName();
item.setLabel(displayName);
}
};
/**
* Renders issue logs
*
* @return {@link RowRenderer}
*/
public RowRenderer getIssueLogsRowRenderer() {
return new RowRenderer() {
@Override
public void render(Row row, Object data) throws Exception {
final IssueLog issueLog = (IssueLog) data;
row.setValue(issueLog);
appendObject(row, issueLog.getCode());
appendLabel(row, issueLog.getOrder().getName());
appendObject(row, issueLog.getType());
appendObject(row, issueLog.getStatus());
appendLabel(row, issueLog.getDescription());
appendObject(row, issueLog.getPriority());
appendObject(row, issueLog.getSeverity());
appendDate(row, issueLog.getDateRaised());
appendLabel(row, issueLog.getCreatedBy().getLoginName());
appendLabel(row, issueLog.getAssignedTo());
appendDate(row, issueLog.getDeadline());
appendDate(row, issueLog.getDateResolved());
appendLabel(row, issueLog.getNotes());
appendOperations(row, issueLog);
}
};
}
/**
* Appends the specified <code>object</code> to the specified
* <code>row</code>
*
* @param row
* @param object
*/
private void appendObject(final Row row, Object object) {
String text = new String("");
if (object != null) {
text = object.toString();
}
appendLabel(row, text);
}
/**
* Creates {@link Label} bases on the specified <code>value</code> and
* appends to the specified <code>row</code>
*
* @param row
* @param value
*/
private void appendLabel(final Row row, String value) {
Label label = new Label(value);
row.appendChild(label);
}
/**
* Appends the specified <code>date</code> to the specified <code>row</code>
* @param row
* @param date*/
private void appendDate(final Row row, Date date) {
String labelDate = new String("");
if (date != null) {
labelDate = Util.formatDate(date);
}
appendLabel(row, labelDate);
}
/**
* Appends operation(edit and remove) to the specified <code>row</code>
*
* @param row
* @param issueLog
*/
private void appendOperations(final Row row, final IssueLog issueLog) {
Hbox hbox = new Hbox();
hbox.appendChild(Util.createEditButton(new EventListener() {
@Override
public void onEvent(Event event) {
goToEditForm(issueLog);
}
}));
hbox.appendChild(Util.createRemoveButton(new EventListener() {
@Override
public void onEvent(Event event) {
confirmDelete(issueLog);
}
}));
row.appendChild(hbox);
}
/**
* Returns {@link LowMediumHighEnum} values
*/
public LowMediumHighEnum[] getLowMediumHighEnum() {
return LowMediumHighEnum.values();
}
/**
* Returns {@link IssueTypeEnum} values
*/
public IssueTypeEnum[] getIssueTypeEnum() {
return IssueTypeEnum.values();
}
/**
* Returns {@link IssueStatusEnum} values
*/
public IssueStatusEnum[] getIssueStatusEnum() {
return IssueStatusEnum.values();
}
/**
* Returns a list of {@link Order} objects
*/
public List<Order> getOrders() {
return issueLogModel.getOrders();
}
/**
* Returns a list of {@link User} objects
*/
public List<User> getUsers() {
return issueLogModel.getUsers();
}
/**
* Returns date entered
*/
public Date getDateRaised() {
if (issueLogModel.getIssueLog() == null) {
return null;
}
return (issueLogModel.getIssueLog().getDateRaised() != null) ? issueLogModel
.getIssueLog().getDateRaised()
: null;
}
/**
* Sets the date entered
*
* @param date
* date eneted
*/
public void setDateRaised(Date date) {
issueLogModel.getIssueLog().setDateRaised(date);
}
/**
* Returns date resolved
*/
public Date getDateResolved() {
if (issueLogModel.getIssueLog() == null) {
return null;
}
return (issueLogModel.getIssueLog().getDateResolved() != null) ? issueLogModel
.getIssueLog().getDateResolved()
: null;
}
/**
* Sets the date resolved
*
* @param date
* the date resolved
*/
public void setDateResolved(Date date) {
issueLogModel.getIssueLog().setDateResolved(date);
}
public Date getDeadline() {
if (issueLogModel.getIssueLog() == null) {
return null;
}
return (issueLogModel.getIssueLog().getDeadline() != null) ? issueLogModel
.getIssueLog().getDeadline() // this is a getIntegrationEntityDAO method
: null;
}
public void setDeadline(Date date) {
issueLogModel.getIssueLog().setDeadline(date);
}
/**
* Returns the {@link IssueLog} object
*/
public IssueLog getIssueLog() {
return issueLogModel.getIssueLog();
}
/**
* Returns a list of {@link IssueLog} objects
*/
public List<IssueLog> getIssueLogs() {
if (LogsController.getProjectNameVisibility() == true)
return issueLogModel.getIssueLogs();
else{
List<IssueLog> issueLogs = new ArrayList<IssueLog>();
Order order = LogsController.getOrder();
for (IssueLog issueLog : issueLogModel.getIssueLogs()) {
if (issueLog.getOrder().equals(order))
issueLogs.add(issueLog);
}
return issueLogs;
}
}
@Override
protected String getEntityType() {
return _("issuelog-number");
}
@Override
protected String getPluralEntityType() {
return _("Issue logs");
}
@Override
protected void initCreate() {
issueLogModel.initCreate();
}
@Override
protected void initEdit(IssueLog entity) {
issueLogModel.initEdit(entity);
}
@Override
protected void save() throws ValidationException {
if (getIssueLog().getOrder() == null) {
throw new WrongValueException(bdProjectIssueLog,
_("please select a project"));
}
if (getIssueLog().getCreatedBy() == null) {
throw new WrongValueException(bdUserIssueLog,
_("please select an author"));
}
issueLogModel.confirmSave();
}
@Override
protected IssueLog getEntityBeingEdited() {
return issueLogModel.getIssueLog();
}
@Override
protected void delete(IssueLog entity) throws InstanceNotFoundException {
issueLogModel.remove(entity);
}
}

View file

@ -0,0 +1,183 @@
/*
* This file is part of LibrePlan
*
* Copyright (C) 2013 St. Antoniusziekenhuis
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package org.libreplan.web.logs;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import org.libreplan.business.common.IntegrationEntity;
import org.libreplan.business.common.daos.IConfigurationDAO;
import org.libreplan.business.common.entities.EntityNameEnum;
import org.libreplan.business.common.exceptions.InstanceNotFoundException;
import org.libreplan.business.common.exceptions.ValidationException;
import org.libreplan.business.logs.daos.IIssueLogDAO;
import org.libreplan.business.logs.daos.IProjectLogDAO;
import org.libreplan.business.logs.entities.IssueLog;
import org.libreplan.business.orders.daos.IOrderDAO;
import org.libreplan.business.orders.entities.Order;
import org.libreplan.business.scenarios.IScenarioManager;
import org.libreplan.business.users.daos.IUserDAO;
import org.libreplan.business.users.entities.User;
import org.libreplan.web.common.IntegrationEntityModel;
import org.libreplan.web.common.concurrentdetection.OnConcurrentModification;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.config.BeanDefinition;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
/**
* Model for UI operations related to {@link IssueLog}
*
* @author Miciele Ghiorghis <m.ghiorghis@antoniusziekenhuis.nl>
*/
@Service
@Scope(BeanDefinition.SCOPE_PROTOTYPE)
@OnConcurrentModification(goToPage = "/logs/_logs.zul")
public class IssueLogModel extends IntegrationEntityModel implements
IIssueLogModel {
private IssueLog issueLog;
@Autowired
private IIssueLogDAO issueLogDAO;
@Autowired
private IProjectLogDAO projectLogDAO;
@Autowired
private IUserDAO userDAO;
@Autowired
private IOrderDAO orderDAO;
@Autowired
private IScenarioManager scenarioManager;
@Autowired
private IConfigurationDAO configurationDAO;
@Override
@Transactional(readOnly = true)
public List<IssueLog> getIssueLogs() {
return projectLogDAO.getIssueLogs();
}
@Override
@Transactional(readOnly = true)
public List<Order> getOrders() {
return orderDAO.getOrders();
}
@Override
@Transactional(readOnly = true)
public List<User> getUsers() {
List<User> users = new ArrayList<User>();
users.addAll(userDAO.findAll());
return users;
}
@Override
@Transactional(readOnly = true)
public void initCreate() {
boolean codeGenerated = configurationDAO.getConfiguration()
.getGenerateCodeForProjectLog();
this.issueLog = IssueLog.create();
if (codeGenerated) {
issueLog.setCodeAutogenerated(codeGenerated);
setDefaultCode();
}
}
@Override
public void initEdit(IssueLog issueLog) {
this.issueLog = issueLog;
}
@Override
public IssueLog getIssueLog() {
return this.issueLog;
}
@Override
@Transactional
public void confirmSave() throws ValidationException {
issueLogDAO.save(issueLog);
}
@Override
public void cancel() {
issueLog = null;
}
@Override
@Transactional
public void remove(IssueLog issueLog) {
try {
issueLogDAO.remove(issueLog.getId());
} catch (InstanceNotFoundException e) {
throw new RuntimeException(e);
}
}
@Override
public EntityNameEnum getEntityName() {
return EntityNameEnum.ISSUE_LOG;
}
@Override
public IntegrationEntity getCurrentEntity() {
return this.issueLog;
}
@Override
protected Set<IntegrationEntity> getChildren() {
return new HashSet<IntegrationEntity>();
}
@Override
public Order getOrder() {
return issueLog.getOrder();
}
@Override
public void setOrder(Order order) {
if (this.issueLog != null) {
IssueLog issueLog = getIssueLog();
issueLog.setOrder(order);
}
}
@Override
public User getCreatedBy() {
return issueLog.getCreatedBy();
}
@Override
public void setCreatedBy(User user) {
if (this.issueLog != null) {
IssueLog issueLog = getIssueLog();
issueLog.setCreatedBy(user);
}
}
}

View file

@ -0,0 +1,119 @@
/*
* This file is part of LibrePlan
*
* Copyright (C) 2013 St. Antoniusziekenhuis
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package org.libreplan.web.logs;
import java.util.HashMap;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.libreplan.business.orders.entities.Order;
import org.libreplan.web.common.Util;
import org.springframework.beans.factory.config.BeanDefinition;
import org.springframework.context.annotation.Scope;
import org.zkoss.zk.ui.Component;
import org.zkoss.zk.ui.Executions;
import org.zkoss.zk.ui.util.GenericForwardComposer;
import org.zkoss.zul.api.Hbox;
import org.zkoss.zul.api.Window;
/**
* Controller for Logs(issue and risk logs)
*
* @author Misha Gozhda <misha@libreplan-enterprise.com>
*/
@org.springframework.stereotype.Component
@Scope(BeanDefinition.SCOPE_PROTOTYPE)
public class LogsController extends GenericForwardComposer {
private static final Log LOG = LogFactory.getLog(LogsController.class);
private Window issueLogWindow;
private Window riskLogWindow;
private Window logWindow;
private Hbox logsFilter;
private IssueLogCRUDController issueLogController;
private RiskLogCRUDController riskLogController;
private static boolean projectNameVisibility = true;
private static Order order = null;
@Override
public void doAfterCompose(Component comp) throws Exception {
super.doAfterCompose(comp);
comp.setVariable("logsController", this, true);
Component filterComponent = Executions.createComponents(
"/logs/_logsFilter.zul", logsFilter,
new HashMap<String, String>());
filterComponent.setVariable("logsFilterController", this, true);
logsFilter.setVisible(true);
logWindow = (Window) comp.getFellowIfAny("logWindow");
Util.createBindingsFor(logWindow);
setupIssueLogController();
}
public void onApplyFilter() {
}
public void setupIssueLogController() {
issueLogWindow = (Window) self.getFellowIfAny("issueLogWindow");
if (issueLogController == null) {
issueLogController = new IssueLogCRUDController();
}
try {
issueLogController.doAfterCompose(issueLogWindow);
} catch (Exception e) {
throw new RuntimeException(e);
}
}
public void setupRiskLogController() {
riskLogWindow = (Window) self.getFellowIfAny("riskLogWindow");
if (riskLogController == null) {
riskLogController = new RiskLogCRUDController();
}
try {
riskLogController.doAfterCompose(riskLogWindow);
} catch (Exception e) {
throw new RuntimeException(e);
}
}
public static void goToOrderMode(Order order) {
LogsController.projectNameVisibility =false;
LogsController.order = order;
}
public static void goToGlobalMode(){
projectNameVisibility = true;
order = null;
}
public static boolean getProjectNameVisibility() {
return projectNameVisibility;
}
public static Order getOrder() {
return order;
}
}

View file

@ -0,0 +1,366 @@
/*
* This file is part of LibrePlan
*
* Copyright (C) 2013 St. Antoniusziekenhuis
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package org.libreplan.web.logs;
import static org.libreplan.web.I18nHelper._;
import java.util.Date;
import java.util.List;
import org.apache.commons.logging.LogFactory;
import org.libreplan.business.common.exceptions.InstanceNotFoundException;
import org.libreplan.business.common.exceptions.ValidationException;
import org.libreplan.business.logs.entities.LowMediumHighEnum;
import org.libreplan.business.logs.entities.RiskLog;
import org.libreplan.business.logs.entities.RiskScoreStatesEnum;
import org.libreplan.business.orders.entities.Order;
import org.libreplan.business.users.entities.User;
import org.libreplan.web.common.BaseCRUDController;
import org.libreplan.web.common.Util;
import org.libreplan.web.common.components.bandboxsearch.BandboxSearch;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.config.BeanDefinition;
import org.springframework.context.annotation.Scope;
import org.zkoss.zk.ui.Component;
import org.zkoss.zk.ui.WrongValueException;
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.*;
/**
* Controller for RiskLog CRUD actions
*
* @author Misha Gozhda <misha@libreplan-enterprise.com>
*/
@SuppressWarnings("serial")
@org.springframework.stereotype.Component
@Scope(BeanDefinition.SCOPE_PROTOTYPE)
public class RiskLogCRUDController extends BaseCRUDController<RiskLog> {
private static final org.apache.commons.logging.Log LOG = LogFactory
.getLog(RiskLogCRUDController.class);
@Autowired
private IRiskLogModel riskLogModel;
private BandboxSearch bdProjectRiskLog;
private BandboxSearch bdUserRiskLog;
@Override
public void doAfterCompose(Component comp) throws Exception {
super.doAfterCompose(comp);
comp.setVariable("riskLogController", this, true);
showListWindow();
initializeOrderComponent();
initializeUserComponent();
}
/**
* Initializes order component
*/
private void initializeOrderComponent() {
bdProjectRiskLog = (BandboxSearch) editWindow
.getFellow("bdProjectRiskLog");
Util.createBindingsFor(bdProjectRiskLog);
bdProjectRiskLog.setListboxEventListener(Events.ON_SELECT,
new EventListener() {
@Override
public void onEvent(Event event) {
final Object object = bdProjectRiskLog.getSelectedElement();
riskLogModel.setOrder((Order) object);
}
});
bdProjectRiskLog.setListboxEventListener(Events.ON_OK, new EventListener() {
@Override
public void onEvent(Event event) {
final Object object = bdProjectRiskLog.getSelectedElement();
riskLogModel.setOrder((Order) object);
bdProjectRiskLog.close();
}
});
}
/**
* Initializes user component
*/
private void initializeUserComponent() {
bdUserRiskLog = (BandboxSearch) editWindow.getFellow("bdUserRiskLog");
Util.createBindingsFor(bdUserRiskLog);
bdUserRiskLog.setListboxEventListener(Events.ON_SELECT,
new EventListener() {
@Override
public void onEvent(Event event) {
final Object object = bdUserRiskLog
.getSelectedElement();
riskLogModel.setCreatedBy((User) object);
}
});
bdUserRiskLog.setListboxEventListener(Events.ON_OK,
new EventListener() {
@Override
public void onEvent(Event event) {
final Object object = bdUserRiskLog
.getSelectedElement();
riskLogModel.setCreatedBy((User) object);
bdUserRiskLog.close();
}
});
}
/**
* Renders risk logs
*
* @return {@link RowRenderer}
*/
public RowRenderer getRiskLogsRowRenderer() {
return new RowRenderer() {
@Override
public void render(Row row, Object data) throws Exception {
final RiskLog riskLog = (RiskLog) data;
row.setValue(riskLog);
appendObject(row, riskLog.getCode());
appendLabel(row, riskLog.getOrder().getName());
appendObject(row, riskLog.getProbability());
appendObject(row, riskLog.getImpact());
appendObject(row, riskLog.getRiskScore());
appendLabel(row, riskLog.getStatus());
appendLabel(row, riskLog.getDescription());
appendDate(row, riskLog.getDateCreated());
appendLabel(row, riskLog.getCreatedBy().getFullName() + riskLog.getCreatedBy().getLoginName());
appendLabel(row, riskLog.getCounterMeasures());
appendLabel(row, "4");
appendLabel(row, riskLog.getContingency());
appendLabel(row, riskLog.getResponsible());
appendDate(row, riskLog.getActionWhen());
appendLabel(row, riskLog.getNotes());
appendOperations(row, riskLog);
}
};
}
public static ListitemRenderer lowMediumHighEnumRenderer = new ListitemRenderer() {
@Override
public void render(org.zkoss.zul.Listitem item, Object data)
throws Exception {
LowMediumHighEnum lowMediumHighEnum = (LowMediumHighEnum) data;
String displayName = lowMediumHighEnum.getDisplayName();
item.setLabel(displayName);
}
};
public static ListitemRenderer riskScoreStatesEnumRenderer = new ListitemRenderer() {
@Override
public void render(org.zkoss.zul.Listitem item, Object data)
throws Exception {
RiskScoreStatesEnum riskScoreStatesEnum = (RiskScoreStatesEnum) data;
String displayName = riskScoreStatesEnum.getDisplayName();
item.setLabel(displayName);
}
};
/**
* Appends the specified <code>object</code> to the specified
* <code>row</code>
*
* @param row
* @param object
*/
private void appendObject(final Row row, Object object) {
String text = new String("");
if (object != null) {
text = object.toString();
}
appendLabel(row, text);
}
/**
* Creates {@link Label} bases on the specified <code>value</code> and
* appends to the specified <code>row</code>
*
* @param row
* @param value
*/
private void appendLabel(final Row row, String value) {
Label label = new Label(value);
row.appendChild(label);
}
/**
* Appends the specified <code>date</code> to the specified <code>row</code>
*
* @param row
* @param date
*/
private void appendDate(final Row row, Date date) {
String labelDate = new String("");
if (date != null) {
labelDate = Util.formatDate(date);
}
appendLabel(row, labelDate);
}
/**
* Appends operation(edit and remove) to the specified <code>row</code>
*
* @param row
* @param riskLog
*/
private void appendOperations(final Row row, final RiskLog riskLog) {
Hbox hbox = new Hbox();
hbox.appendChild(Util.createEditButton(new EventListener() {
@Override
public void onEvent(Event event) {
goToEditForm(riskLog);
}
}));
hbox.appendChild(Util.createRemoveButton(new EventListener() {
@Override
public void onEvent(Event event) {
confirmDelete(riskLog);
}
}));
row.appendChild(hbox);
}
/**
* Returns {@link LowMediumHighEnum} values
*/
public LowMediumHighEnum[] getLowMediumHighEnums() {
return LowMediumHighEnum.values();
}
/**
* Returns {@link org.libreplan.business.logs.entities.RiskScoreStatesEnum} values
*/
public RiskScoreStatesEnum[] getRiskScoreStatesEnums() {
return RiskScoreStatesEnum.values();
}
/**
* Returns a list of {@link Order} objects
*/
public List<Order> getOrders() {
return riskLogModel.getOrders();
}
/**
* Returns a list of {@link User} objects
*/
public List<User> getUsers() {
return riskLogModel.getUsers();
}
/**
* Returns registration date
*/
public Date getDateCreated() {
if (riskLogModel.getRiskLog() == null) {
return null;
}
return (riskLogModel.getRiskLog().getDateCreated() != null) ? riskLogModel
.getRiskLog().getDateCreated()
: null;
}
/**
* Sets the registration date
*
* @param date
* registration date
*/
public void setDateCreated(Date date) {
riskLogModel.getRiskLog().setDateCreated(date);
}
public void setActionWhen(Date date) {
riskLogModel.getRiskLog().setActionWhen(date);
}
public Date getActionWhen() {
if (riskLogModel.getRiskLog() == null) {
return null;
}
return (riskLogModel.getRiskLog().getActionWhen() != null) ? riskLogModel
.getRiskLog().getActionWhen()
: null;
}
/**
* Returns the {@link RiskLog} object
*/
public RiskLog getRiskLog() {
return riskLogModel.getRiskLog();
}
/**
* Returns a list of {@link RiskLog} objects
*/
public List<RiskLog> getRiskLogs() {
return riskLogModel.getRiskLogs();
}
@Override
protected String getEntityType() {
return _("Issue log");
}
@Override
protected String getPluralEntityType() {
return _("Issue logs");
}
@Override
protected void initCreate() {
riskLogModel.initCreate();
}
@Override
protected void initEdit(RiskLog entity) {
riskLogModel.initEdit(entity);
}
@Override
protected void save() throws ValidationException {
if (getRiskLog().getOrder() == null) {
throw new WrongValueException(bdProjectRiskLog,
_("please select a project"));
}
if (getRiskLog().getCreatedBy() == null) {
throw new WrongValueException(bdUserRiskLog,
_("please select an author"));
}
riskLogModel.confirmSave();
}
@Override
protected RiskLog getEntityBeingEdited() {
return riskLogModel.getRiskLog();
}
@Override
protected void delete(RiskLog entity) throws InstanceNotFoundException {
riskLogModel.remove(entity);
}
}

View file

@ -0,0 +1,183 @@
/*
* This file is part of LibrePlan
*
* Copyright (C) 2013 St. Antoniusziekenhuis
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package org.libreplan.web.logs;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import org.libreplan.business.common.IntegrationEntity;
import org.libreplan.business.common.daos.IConfigurationDAO;
import org.libreplan.business.common.entities.EntityNameEnum;
import org.libreplan.business.common.exceptions.InstanceNotFoundException;
import org.libreplan.business.common.exceptions.ValidationException;
import org.libreplan.business.logs.daos.IProjectLogDAO;
import org.libreplan.business.logs.daos.IRiskLogDAO;
import org.libreplan.business.logs.entities.RiskLog;
import org.libreplan.business.orders.daos.IOrderDAO;
import org.libreplan.business.orders.entities.Order;
import org.libreplan.business.scenarios.IScenarioManager;
import org.libreplan.business.users.daos.IUserDAO;
import org.libreplan.business.users.entities.User;
import org.libreplan.web.common.IntegrationEntityModel;
import org.libreplan.web.common.concurrentdetection.OnConcurrentModification;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.config.BeanDefinition;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
/**
* Model for UI operations related to {@link RiskLog}
*
* @author Miciele Ghiorghis <m.ghiorghis@antoniusziekenhuis.nl>
*/
@Service
@Scope(BeanDefinition.SCOPE_PROTOTYPE)
@OnConcurrentModification(goToPage = "/logs/_logs.zul")
public class RiskLogModel extends IntegrationEntityModel implements
IRiskLogModel {
private RiskLog riskLog;
@Autowired
private IRiskLogDAO riskLogDAO;
@Autowired
private IProjectLogDAO projectLogDAO;
@Autowired
private IUserDAO userDAO;
@Autowired
private IOrderDAO orderDAO;
@Autowired
private IScenarioManager scenarioManager;
@Autowired
private IConfigurationDAO configurationDAO;
@Override
@Transactional(readOnly = true)
public List<RiskLog> getRiskLogs() {
return projectLogDAO.getRiskLogs();
}
@Override
@Transactional(readOnly = true)
public List<Order> getOrders() {
return orderDAO.getOrders();
}
@Override
@Transactional(readOnly = true)
public List<User> getUsers() {
List<User> users = new ArrayList<User>();
users.addAll(userDAO.findAll());
return users;
}
@Override
@Transactional(readOnly = true)
public void initCreate() {
boolean codeGenerated = configurationDAO.getConfiguration()
.getGenerateCodeForProjectLog();
this.riskLog = RiskLog.create();
if (codeGenerated) {
riskLog.setCodeAutogenerated(codeGenerated);
setDefaultCode();
}
}
@Override
public void initEdit(RiskLog riskLog) {
this.riskLog = riskLog;
}
@Override
public RiskLog getRiskLog() {
return this.riskLog;
}
@Override
@Transactional
public void confirmSave() throws ValidationException {
riskLogDAO.save(riskLog);
}
@Override
public void cancel() {
riskLog = null;
}
@Override
@Transactional
public void remove(RiskLog riskLog) {
try {
riskLogDAO.remove(riskLog.getId());
} catch (InstanceNotFoundException e) {
throw new RuntimeException(e);
}
}
@Override
public EntityNameEnum getEntityName() {
return EntityNameEnum.RISK_LOG;
}
@Override
public IntegrationEntity getCurrentEntity() {
return this.riskLog;
}
@Override
protected Set<IntegrationEntity> getChildren() {
return new HashSet<IntegrationEntity>();
}
@Override
public Order getOrder() {
return riskLog.getOrder();
}
@Override
public void setOrder(Order order) {
if (this.riskLog != null) {
RiskLog riskLog = getRiskLog();
riskLog.setOrder(order);
}
}
@Override
public User getCreatedBy() {
return riskLog.getCreatedBy();
}
@Override
public void setCreatedBy(User user) {
if (this.riskLog != null) {
RiskLog riskLog = getRiskLog();
riskLog.setCreatedBy(user);
}
}
}

View file

@ -0,0 +1,160 @@
/*
* This file is part of LibrePlan
*
* Copyright (C) 2013 St. Antoniusziekenhuis
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package org.libreplan.web.planner.tabs;
import static org.libreplan.web.I18nHelper._;
import static org.libreplan.web.planner.tabs.MultipleTabsPlannerController.BREADCRUMBS_SEPARATOR;
import static org.libreplan.web.planner.tabs.MultipleTabsPlannerController.getSchedulingLabel;
import java.util.HashMap;
import java.util.Map;
import org.libreplan.business.users.entities.UserRole;
import org.libreplan.web.common.Util;
import org.libreplan.web.logs.LogsController;
import org.libreplan.web.planner.order.IOrderPlanningGate;
import org.libreplan.web.planner.tabs.CreatedOnDemandTab.IComponentCreator;
import org.libreplan.web.security.SecurityUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.zkoss.ganttz.extensions.ITab;
import org.zkoss.zk.ui.Component;
import org.zkoss.zk.ui.Executions;
import org.zkoss.zul.Image;
import org.zkoss.zul.Label;
import javax.swing.*;
/**
* Creates global Tab for Logs(issue and risk logs)
*
* @author Misha Gozhda <misha@libreplan-enterprise.com>
*/
public class LogsTabCreator {
public static ITab create(Mode mode, LogsController logsController, LogsController logsControllerGlobal,
Component breadcrumbs, IOrderPlanningGate orderPlanningGate,
Map<String, String[]> parameters) {
return new LogsTabCreator(mode, logsController, logsControllerGlobal, breadcrumbs,
orderPlanningGate, parameters)
.build();
}
private final Mode mode;
private final LogsController logsControllerGlobal;
private final LogsController logsController;
private final Component breadcrumbs;
private final IOrderPlanningGate orderPlanningGate;
private LogsTabCreator(Mode mode, LogsController logsController, LogsController logsControllerGlobal,
Component breadcrumbs, IOrderPlanningGate orderPlanningGate,
Map<String, String[]> parameters) {
this.mode = mode;
this.logsController = logsController;
this.logsControllerGlobal = logsControllerGlobal;
this.breadcrumbs = breadcrumbs;
this.orderPlanningGate = orderPlanningGate;
}
private ITab build() {
return TabOnModeType.forMode(mode)
.forType(ModeType.GLOBAL, createGlobalLogsTab())
.forType(ModeType.ORDER, createOrderLogsTab())
.create();
}
private ITab createGlobalLogsTab() {
IComponentCreator componentCreator = new IComponentCreator() {
@Override
public org.zkoss.zk.ui.Component create(
org.zkoss.zk.ui.Component parent) {
Map<String, Object> arguments = new HashMap<String, Object>();
arguments.put("logsController", logsControllerGlobal);
return Executions.createComponents("/logs/_logs.zul",
parent, arguments);
}
};
return new CreatedOnDemandTab(_("Logs"), "logs-global",
componentCreator) {
@Override
protected void beforeShowAction() {
if (!SecurityUtils
.isSuperuserOrUserInRoles(UserRole.ROLE_PLANNING)) {
Util.sendForbiddenStatusCodeInHttpServletResponse();
}
}
@Override
protected void afterShowAction() {
if (breadcrumbs.getChildren() != null) {
breadcrumbs.getChildren().clear();
}
breadcrumbs.appendChild(new Image(BREADCRUMBS_SEPARATOR));
breadcrumbs.appendChild(new Label(getSchedulingLabel()));
breadcrumbs.appendChild(new Image(BREADCRUMBS_SEPARATOR));
breadcrumbs.appendChild(new Label(_("Logs")));
}
};
}
private ITab createOrderLogsTab() {
IComponentCreator componentCreator = new IComponentCreator() {
@Override
public org.zkoss.zk.ui.Component create(
org.zkoss.zk.ui.Component parent) {
Map<String, Object> arguments = new HashMap<String, Object>();
arguments.put("logsController", logsController);
return Executions.createComponents("/logs/_logs.zul",
parent, arguments);
}
};
return new CreatedOnDemandTab(_("Logs"), "logs-order",
componentCreator) {
@Override
protected void beforeShowAction() {
if (!SecurityUtils
.isSuperuserOrUserInRoles(UserRole.ROLE_PLANNING)) {
Util.sendForbiddenStatusCodeInHttpServletResponse();
}
}
@Override
protected void afterShowAction() {
if (breadcrumbs.getChildren() != null) {
breadcrumbs.getChildren().clear();
}
breadcrumbs.appendChild(new Image(BREADCRUMBS_SEPARATOR));
breadcrumbs.appendChild(new Label(getSchedulingLabel()));
breadcrumbs.appendChild(new Image(BREADCRUMBS_SEPARATOR));
breadcrumbs.appendChild(new Label(_("Logs")));
breadcrumbs.appendChild(new Image(BREADCRUMBS_SEPARATOR));
breadcrumbs.appendChild(new Label(mode.getOrder().getName()));
}
};
}
}

View file

@ -42,6 +42,7 @@ import org.libreplan.web.common.entrypoints.URLHandlerRegistry;
import org.libreplan.web.dashboard.DashboardController;
import org.libreplan.web.dashboard.DashboardControllerGlobal;
import org.libreplan.web.limitingresources.LimitingResourcesController;
import org.libreplan.web.logs.LogsController;
import org.libreplan.web.montecarlo.MonteCarloController;
import org.libreplan.web.orders.OrderCRUDController;
import org.libreplan.web.planner.allocation.AdvancedAllocationController.IBack;
@ -75,6 +76,8 @@ import org.zkoss.zk.ui.event.EventListener;
import org.zkoss.zk.ui.event.Events;
import org.zkoss.zk.ui.util.Composer;
import javax.swing.*;
/**
* Creates and handles several tabs
*
@ -83,7 +86,8 @@ import org.zkoss.zk.ui.util.Composer;
*/
@Component
@Scope(BeanDefinition.SCOPE_PROTOTYPE)
public class MultipleTabsPlannerController implements Composer,
public class
MultipleTabsPlannerController implements Composer,
IGlobalViewEntryPoints {
public static String WELCOME_URL = "-- no URL provided --";
@ -164,6 +168,8 @@ public class MultipleTabsPlannerController implements Composer,
private ITab dashboardTab;
private ITab logsTab;
private TabSwitcher tabsSwitcher;
@Autowired
@ -190,6 +196,12 @@ public class MultipleTabsPlannerController implements Composer,
@Autowired
private DashboardControllerGlobal dashboardControllerGlobal;
@Autowired
private LogsController logsController;
@Autowired
private LogsController logsControllerGlobal;
private org.zkoss.zk.ui.Component breadcrumbs;
@Autowired
@ -303,6 +315,32 @@ public class MultipleTabsPlannerController implements Composer,
dashboardController, dashboardControllerGlobal, orderPlanningController, breadcrumbs,
resourcesSearcher);
logsTab = LogsTabCreator.create(mode, logsController, logsControllerGlobal, breadcrumbs, new IOrderPlanningGate() {
@Override
public void goToScheduleOf(Order order) {
getTabsRegistry()
.show(planningTab, changeModeTo(order));
}
@Override
public void goToOrderDetails(Order order) {
getTabsRegistry().show(ordersTab, changeModeTo(order));
}
@Override
public void goToTaskResourceAllocation(Order order,
TaskElement task) {
// do nothing
}
@Override
public void goToDashboard(Order order) {
// do nothing
}
}, parameters);
final boolean isMontecarloVisible = isMonteCarloVisible();
if (isMontecarloVisible) {
monteCarloTab = MonteCarloTabCreator.create(mode,
@ -334,6 +372,8 @@ public class MultipleTabsPlannerController implements Composer,
tabsConfiguration.add(visibleOnlyAtOrderMode(monteCarloTab));
}
tabsConfiguration.add(tabWithNameReloading(logsTab, typeChanged));
return tabsConfiguration;
}
@ -467,6 +507,7 @@ public class MultipleTabsPlannerController implements Composer,
@Override
public void goToCompanyScheduling() {
LogsController.goToGlobalMode();
getTabsRegistry().show(planningTab);
}
@ -541,6 +582,7 @@ public class MultipleTabsPlannerController implements Composer,
}
private IBeforeShowAction changeModeTo(final Order order) {
logsController.goToOrderMode(order);
return new IBeforeShowAction() {
@Override
public void doAction() {

View file

@ -0,0 +1,119 @@
/*
* This file is part of LibrePlan
*
* Copyright (C) 2012 Igalia, S.L.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*//*
package org.libreplan.web.users.services;
import javax.servlet.http.HttpServletRequest;
import org.libreplan.business.common.IAdHocTransactionService;
import org.libreplan.business.common.IOnTransaction;
import org.libreplan.business.common.exceptions.InstanceNotFoundException;
import org.libreplan.business.users.daos.IOrderAuthorizationDAO;
import org.libreplan.business.users.daos.IUserDAO;
import org.libreplan.business.users.entities.User;
import org.libreplan.business.users.entities.UserRole;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.Authentication;
import org.springframework.security.ui.TargetUrlResolverImpl;
import org.springframework.security.ui.savedrequest.SavedRequest;
import org.springframework.security.userdetails.UserDetails;
*/
/**
* Determines the URL for authenticated users depending on if user is bound or
* not to any resource.<br />
*
* If the user is bound to a resource then the target URL will be the user
* dashboard.
*
* @author Manuel Rego Casasnovas <mrego@igalia.com>
*//*
public class CustomTargetUrlResolver extends TargetUrlResolverImpl {
public final static String USER_DASHBOARD_URL = "/myaccount/userDashboard.zul";
public static final String PLANNING_URL = "/planner/index.zul";
public static final String SETTINGS_URL = "/myaccount/settings.zul";
@Autowired
private IUserDAO userDAO;
@Autowired
private IOrderAuthorizationDAO orderAuthorizationDAO;
@Autowired
private IAdHocTransactionService transactionServiceDAO;
@Override
public String determineTargetUrl(SavedRequest savedRequest,
HttpServletRequest currentRequest, final Authentication auth) {
if (isUserInRole(auth, UserRole.ROLE_SUPERUSER.name())) {
return super.determineTargetUrl(savedRequest, currentRequest, auth);
}
if (isUserInRole(auth, UserRole.ROLE_BOUND_USER.name())) {
return USER_DASHBOARD_URL;
}
if (isUserInRole(auth, UserRole.ROLE_PLANNING.name())) {
return PLANNING_URL;
}
boolean userOrItsProfilesHaveAnyAuthorization = transactionServiceDAO
.runOnReadOnlyTransaction(new IOnTransaction<Boolean>() {
@Override
public Boolean execute() {
try {
UserDetails userDetails = (UserDetails) auth.getPrincipal();
User user = userDAO.findByLoginName(userDetails.getUsername());
user.getProfiles().size();
return orderAuthorizationDAO
.userOrItsProfilesHaveAnyAuthorization(user);
} catch (InstanceNotFoundException e) {
throw new RuntimeException(e);
}
}
});
if (userOrItsProfilesHaveAnyAuthorization) {
return PLANNING_URL;
}
return SETTINGS_URL;
}
private boolean isUserInRole(Authentication auth, String role) {
if ((auth == null) || (auth.getPrincipal() == null)
|| (auth.getAuthorities() == null)) {
return false;
}
for (int i = 0; i < auth.getAuthorities().length; i++) {
if (role.equals(auth.getAuthorities()[i].getAuthority())) {
return true;
}
}
return false;
}
}
*/

View file

@ -1077,6 +1077,19 @@ span.perspective, span.perspective-active {
margin-top: 5px;
}
.perspective.logs-global .z-button-cm {
background-image: url(../img/ico_logs-global.png);
}
.perspective-active.logs-global .z-button-cm {
background-image: url(../img/ico_logs-global.png);
}
.perspective.logs-order .z-button-cm {
background-image: url(../img/ico_logs-order.png);
}
.perspective-active.logs-order .z-button-cm {
background-image: url(../img/ico_logs-order.png);
}
.perspectives-column {
display:none;

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.1 KiB

View file

@ -0,0 +1,169 @@
<!--
This file is part of LibrePlan
Copyright (C) 2013 St. Antoniusziekenhuis
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
-->
<window id="editWindow">
<caption id="caption" sclass="caption-title" />
<grid id="issueLogGrid">
<columns>
<column width="160px" />
<column/>
</columns>
<rows>
<row>
<label value="${i18n:_('Issue number')}" />
<textbox id="issueNumberTextBox" width="605px"
value="@{issueLogController.issueLog.code}" disabled="true"/>
</row>
<row>
<label value="${i18n:_('Project')}" />
<bandboxSearch id="bdProjectIssueLog" widthBandbox="610px" widthListbox="610px"
constraint="no empty:${i18n:_('cannot be empty')}"
finder="OrderBandboxFinder"
model="@{issueLogController.orders}"
selectedElement="@{issueLogController.issueLog.order}"/>
</row>
<row>
<label value="${i18n:_('Type and status')}" />
<grid>
<columns>
<column width="80px"/>
<column width="235px"/>
<column width="60px"/>
<column width="235px"/>
</columns>
<rows>
<row>
<label value="${i18n:_('Type')}" />
<listbox id="listIssueLogType" mold="select" rows="1" width="230px"
model="@{issueLogController.issueTypeEnum}"
selectedItem="@{issueLogController.issueLog.type}"
itemRenderer="@{issueLogController.issueTypeRenderer}" />
<label value="${i18n:_('Status')}" />
<listbox id="listIssueLogStatus" mold="select" rows="1" width="230px"
model="@{issueLogController.issueStatusEnum}"
selectedItem="@{issueLogController.issueLog.status}"
itemRenderer="@{issueLogController.issueStatusRenderer}" />
</row>
</rows>
</grid>
</row>
<row>
<label value="${i18n:_('Creation info')}" />
<grid>
<columns>
<column width="80px"/>
<column width="120px"/>
<column width="80px"/>
<column width="330px"/>
</columns>
<rows>
<row>
<label value="${i18n:_('Date raised')}" />
<datebox id="dateRaisedBox" width="110px"
constraint="no empty:${i18n:_('cannot be empty')}"
value="@{issueLogController.dateRaised}" />
<label value="${i18n:_('Created by')}" />
<bandboxSearch id="bdUserIssueLog" widthBandbox="320px" widthListbox="340px"
finder="UserBandboxFinder"
model="@{issueLogController.users}"
selectedElement="@{issueLogController.issueLog.createdBy}"/>
</row>
</rows>
</grid>
</row>
<row>
<label value="${i18n:_('Description')}" />
<textbox id="descriptionNameTextBox" width="605px" rows="4"
value="@{issueLogController.issueLog.description}"/>
</row>
<row>
<label value="${i18n:_('Categories')}" />
<grid>
<columns>
<column width="150px"/>
<column width="155px"/>
<column width="150px"/>
<column width="155px"/>
</columns>
<rows>
<row>
<label value="${i18n:_('Priority')}" />
<listbox id="listIssueLogPriority" mold="select" rows="1" width="150px"
model="@{issueLogController.lowMediumHighEnum}"
selectedItem="@{issueLogController.issueLog.priority}"
itemRenderer="@{issueLogController.lowMediumHighEnumRenderer}" />
<label value="${i18n:_('Severity')}"/>
<listbox id="listIssueLogSeverity" mold="select" rows="1" width="150px"
model="@{issueLogController.lowMediumHighEnum}"
selectedItem="@{issueLogController.issueLog.severity}"
itemRenderer="@{issueLogController.lowMediumHighEnumRenderer}" />
</row>
</rows>
</grid>
</row>
<row>
<label value="${i18n:_('Assigned to')}" />
<textbox id="assignedToTextBox" width="605px"
value="@{issueLogController.issueLog.assignedTo}"/>
</row>
<row>
<label value="${i18n:_('Timing')}" />
<hbox>
<grid id="timing">
<columns>
<column width="150px"/>
<column width="155px"/>
<column width="150px"/>
<column width="155px"/>
</columns>
<rows>
<row>
<label value="${i18n:_('Deadline')}"/>
<datebox id="deadline" width="145px"
value="@{issueLogController.deadline}" />
<label value="${i18n:_('Date resolved')}" />
<datebox id="dateResolved" width="145px"
value="@{issueLogController.dateResolved}" />
</row>
</rows>
</grid>
</hbox>
</row>
<row>
<label value="${i18n:_('Notes')}" />
<textbox value="@{issueLogController.issueLog.notes}" width="605px" rows="8" multiline="true" />
</row>
</rows>
</grid>
<!-- Control buttons -->
<button onClick="issueLogController.saveAndExit()"
label="${i18n:_('Save')}"
sclass="save-button global-action" />
<button onClick="issueLogController.saveAndContinue()"
label="${i18n:_('Save and Continue')}"
sclass="save-button global-action" />
<button onClick="issueLogController.cancelForm()"
label="${i18n:_('Cancel')}"
sclass="cancel-button global-action" />
</window>

View file

@ -0,0 +1,153 @@
<!--
This file is part of LibrePlan
Copyright (C) 2013 St. Antoniusziekenhuis
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
-->
<window id="editWindow" height="100%">
<caption id="caption" sclass="caption-title" />
<grid id="riskLogGrid" >
<columns>
<column width="160px" />
<column/>
</columns>
<rows>
<row>
<label value="${i18n:_('Code')}" />
<textbox id="riskNumberTextBox" width="605px"
value="@{riskLogController.riskLog.code}" disabled="true"/>
</row>
<row>
<label value="${i18n:_('Project')}" />
<bandboxSearch id="bdProjectRiskLog" widthBandbox="610px" widthListbox="610px"
constraint="no empty:${i18n:_('cannot be empty')}"
finder="OrderBandboxFinder"
model="@{riskLogController.orders}"
selectedElement="@{riskLogController.riskLog.order}"/>
</row>
<row>
<label value="${i18n:_('Status')}" />
<textbox value="@{riskLogController.riskLog.status}" width="605px" rows="1" multiline="false" />
</row>
<row>
<label value="${i18n:_('Estimations')}" />
<grid>
<columns>
<column width="80px"/>
<column width="140px"/>
<column width="60px"/>
<column width="140px"/>
<column width="80px"/>
<column width="110px"/>
</columns>
<rows>
<row>
<label value="${i18n:_('Probability')}" />
<listbox id="listRiskLogProbability" mold="select" rows="1" width="135px"
model="@{riskLogController.lowMediumHighEnums}"
selectedItem="@{riskLogController.riskLog.probability}"
itemRenderer="@{riskLogController.lowMediumHighEnumRenderer}" />
<label value="${i18n:_('Impact')}" />
<listbox id="listRiskLogImpact" mold="select" rows="1" width="135px"
model="@{riskLogController.lowMediumHighEnums}"
selectedItem="@{riskLogController.riskLog.impact}"
itemRenderer="@{riskLogController.lowMediumHighEnumRenderer}" />
<label value="${i18n:_('Risk score')}" />
<textbox value="@{riskLogController.riskLog.riskScore}" width="95px" rows="1" disabled="true" />
</row>
</rows>
</grid>
</row>
<row>
<label value="${i18n:_('Creation info')}" />
<grid>
<columns>
<column width="80px"/>
<column width="120px"/>
<column width="80px"/>
<column width="330px"/>
</columns>
<rows>
<row>
<label value="${i18n:_('Date created')}" />
<datebox id="dateCreatedBox" width="110px"
constraint="no empty:${i18n:_('cannot be empty')}"
value="@{riskLogController.dateCreated}" />
<label value="${i18n:_('Created by')}" />
<bandboxSearch id="bdUserRiskLog" widthBandbox="320px" widthListbox="340px"
finder="UserBandboxFinder"
model="@{riskLogController.users}"
selectedElement="@{riskLogController.riskLog.createdBy}"/>
</row>
</rows>
</grid>
</row>
<row>
<label value="${i18n:_('Description')}" />
<textbox id="descriptionNameTextBox" width="605px" rows="3"
value="@{riskLogController.riskLog.description}"/>
</row>
<row>
<label value="${i18n:_('Counter measures (CM)')}" />
<textbox id="counterMeasuresTextbox" width="605px" rows="1"
value="@{riskLogController.riskLog.counterMeasures}"/>
</row>
<row>
<label value="${i18n:_('Risk Score After CM')}" />
<listbox id="listRiskScores" mold="select" rows="1" width="135px"
model="@{riskLogController.riskScoreStatesEnums}"
selectedItem="@{riskLogController.riskLog.scoreAfterCM}"
itemRenderer="@{riskLogController.riskScoreStatesEnumRenderer}" />/>
</row>
<row>
<label value="${i18n:_('Contingency')}" />
<textbox id="contingencyBox" width="605px" rows="3"
value="@{riskLogController.riskLog.contingency}"/>
</row>
<row>
<label value="${i18n:_('Responsible')}" />
<textbox id="responsibleBox" width="605px" rows="1"
value="@{riskLogController.riskLog.responsible}"/>
</row>
<row>
<label value="${i18n:_('Action When')}" />
<datebox id="ActionWhenDateBox" width="110px"
constraint="no empty:${i18n:_('cannot be empty')}"
value="@{riskLogController.actionWhen}" />
</row>
<row>
<label value="${i18n:_('Notes')}" />
<textbox value="@{riskLogController.riskLog.notes}" width="605px" rows="3" multiline="true" />
</row>
</rows>
</grid>
<!-- Control buttons -->
<button onClick="riskLogController.saveAndExit()"
label="${i18n:_('Save')}"
sclass="save-button global-action" />
<button onClick="riskLogController.saveAndContinue()"
label="${i18n:_('Save and Continue')}"
sclass="save-button global-action" />
<button onClick="riskLogController.cancelForm()"
label="${i18n:_('Cancel')}"
sclass="cancel-button global-action" />
</window>

View file

@ -0,0 +1,42 @@
<!--
This file is part of LibrePlan
Copyright (C) 2013 St. Antoniusziekenhuis
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
-->
<window id="listWindow">
<grid id="listIssueLog" model="@{issueLogController.issueLogs}" mold="paging"
pageSize="15" span="0" sizedByContent="false"
rowRenderer="@{issueLogController.issueLogsRowRenderer}">
<columns sizable="true">
<column label="${i18n:_('Code')}" sort="auto(lower(code))" />
<column label="${i18n:_('Projectname')}" visible="@{logsController.projectNameVisibility}" sort="auto(lower(order))" />
<column label="${i18n:_('Type')}" sort="auto(lower(type))"/>
<column label="${i18n:_('Status')}" sort="auto(lower(status))"/>
<column label="${i18n:_('Description')}" sort="auto(lower(description))"/>
<column label="${i18n:_('Priority')}" sort="auto(lower(priority))"/>
<column label="${i18n:_('Severity')}" sort="auto(lower(severity))"/>
<column label="${i18n:_('Date raised')}" sort="auto(lower(dateRaised))"/>
<column label="${i18n:_('Created By')}" sort="auto(lower(createdBy))" hflex="min" />
<column label="${i18n:_('Assigned To')}" sort="auto(lower(assignedTo))"/>
<column label="${i18n:_('Deadline')}" sort="auto(lower(deadline))"/>
<column label="${i18n:_('Date Resolved')}" sort="auto(lower(dateResolved))"/>
<column label="${i18n:_('Notes')}" sort="auto(lower(notes))"/>
<column label="${i18n:_('Operations')}" sclass="operations" hflex="min"/>
</columns>
</grid>
<button id="show_create_form" onClick='issueLogController.goToCreateForm()'
label="${i18n:_('Create')}" sclass="create-button global-action"/>
</window>

View file

@ -0,0 +1,44 @@
<!--
This file is part of LibrePlan
Copyright (C) 2013 St. Antoniusziekenhuis
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
-->
<window id="listWindow">
<grid id="listRiskLog" model="@{riskLogController.riskLogs}" mold="paging"
pageSize="15" span="0" sizedByContent="false"
rowRenderer="@{riskLogController.riskLogsRowRenderer}">
<columns sizable="true">
<column label="${i18n:_('Code')}" sort="auto(lower(code))" />
<column label="${i18n:_('Projectname')}" visible="@{logsController.projectNameVisibility}" sort="auto(lower(order))" />
<column label="${i18n:_('Probability')}" sort="auto(lower(probability))"/>
<column label="${i18n:_('Impact')}" sort="auto(lower(impact))"/>
<column label="${i18n:_('Risk score')}" sort="auto"/>
<column label="${i18n:_('Status')}" sort="auto(lower(status))"/>
<column label="${i18n:_('Description')}" sort="auto(lower(code))"/>
<column label="${i18n:_('Date created')}" sclass="date" hflex="min" sort="auto(lower(dateCreated))"/>
<column label="${i18n:_('CreatedBy')}" sort="auto(lower(createdBy))"/>
<column label="${i18n:_('Counter measures')}" sort="auto(lower(counterMeasures))"/>
<column label="${i18n:_('New risk score')}" sort="auto"/>
<column label="${i18n:_('Contingency')}" sort="auto"/>
<column label="${i18n:_('Responsible')}" sort="auto"/>
<column label="${i18n:_('ActionWhen')}" sclass="date" hflex="min" sort="auto(lower(actionWhen))"/>
<column label="${i18n:_('Notes')}" hflex="min" sort="auto"/>
<column label="${i18n:_('Operations')}" sclass="operations" hflex="min"/>
</columns>
</grid>
<button id="show_create_form" onClick='riskLogController.goToCreateForm()'
label="${i18n:_('Create')}" sclass="create-button global-action"/>
</window>

View file

@ -0,0 +1,62 @@
<!--
This file is part of LibrePlan
Copyright (C) 2013 St. Antoniusziekenhuis
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
-->
<?taglib uri="/WEB-INF/tld/i18n.tld" prefix="i18n"?>
<?component name="listIssueLogs" inline="true" macroURI="issue_log.zul"?>
<?component name="listRiskLogs" inline="true" macroURI="risk_log.zul"?>
<zk>
<zscript><![CDATA[
logsController = arg.get("logsController");
]]>
</zscript>
<div self="@{define(content)}" height="100%" style="overflow:visible">
<style src="/dashboard/css/dashboard.css" dynamic="true" />
<div height="30px" sclass="toolbar-box">
<hbox id="logsFilter" visible="false" />
</div>
<window self="@{define(content)}" id="logWindow" apply="${logsController}" vflex="1">
<borderlayout sclass="orderslayout" height="100%">
<center border="0" class="orderslayout-area">
<tabbox id="tabboxLog">
<tabs>
<tab id="tabIssueLogs" label="${i18n:_('Issue logs')}" selected="true"
onSelect = "logsController.setupIssueLogController();"/>
<tab id="tabRiskLogs" label="${i18n:_('Risk logs')}"
onSelect = "logsController.setupRiskLogController();"/>
</tabs>
<tabpanels>
<tabpanel sclass="orderelements-tab" id="tabpanelLog">
<listIssueLogs id="issueLogs" fulfill="tabIssueLogs.onSelect"/>
</tabpanel>
<tabpanel sclass="orderelements-tab" id="tabpanelLog2">
<listRiskLogs id="riskLogs" fulfill="tabRiskLogs.onSelect"/>
</tabpanel>
</tabpanels>
</tabbox>
</center>
</borderlayout>
</window>
</div>
</zk>

View file

@ -0,0 +1,28 @@
<!--
This file is part of LibrePlan
Copyright (C) 2013 St. Antoniusziekenhuis
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
-->
<hbox align="center" sclass="filtering-area">
<label value="${i18n:_('Name')}"
tooltiptext="${i18n:_('Select required issue/risk name and press filter button')}"/>
<textbox id="filterName" width="100px" onChange="logsFilterController.onApplyFilter()" />
<button mold="trendy" image="/common/img/ico_filter.png" style="margin-top: -4px"
tooltiptext="${i18n:_('Apply filtering to issues')}"
onClick="logsFilterController.onApplyFilter()"/>
</hbox>

View file

@ -0,0 +1,33 @@
<!--
This file is part of LibrePlan
Copyright (C) 2013 St. Antoniusziekenhuis
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
-->
<?link rel="stylesheet" type="text/css" href="/common/css/libreplan.css"?>
<?link rel="stylesheet" type="text/css" href="/common/css/libreplan_zk.css"?>
<?taglib uri="/WEB-INF/tld/i18n.tld" prefix="i18n"?>
<?component name="list" inline="true" macroURI="_listIssueLog.zul"?>
<?component name="edit" inline="true" macroURI="_editIssueLog.zul"?>
<zk>
<window self="@{define(content)}" id="issueLogWindow" apply="org.libreplan.web.logs.IssueLogCRUDController">
<vbox id="messagesContainer" />
<list id="listWindow" />
<edit id="editWindow" />
</window>
</zk>

View file

@ -0,0 +1,33 @@
<!--
This file is part of LibrePlan
Copyright (C) 2013 St. Antoniusziekenhuis
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
-->
<?link rel="stylesheet" type="text/css" href="/common/css/libreplan.css"?>
<?link rel="stylesheet" type="text/css" href="/common/css/libreplan_zk.css"?>
<?taglib uri="/WEB-INF/tld/i18n.tld" prefix="i18n"?>
<?component name="list" inline="true" macroURI="_listRiskLog.zul"?>
<?component name="edit" inline="true" macroURI="_editRiskLog.zul"?>
<zk>
<window self="@{define(content)}" id="riskLogWindow" apply="${org.libreplan.web.logs.riskLogCRUDController}" >
<vbox id="messagesContainer" />
<list id="listWindow" />
<edit id="editWindow" />
</window>
</zk>