r92 - in trunk/chorem-web/src/main: java/org/chorem/gepeto/action resources resources/i18n webapp/WEB-INF/jsp/gepeto
Author: vbriand Date: 2011-04-15 11:57:06 +0200 (Fri, 15 Apr 2011) New Revision: 92 Url: http://chorem.org/repositories/revision/chorem/92 Log: Added a list of projects without quotation Added: trunk/chorem-web/src/main/webapp/WEB-INF/jsp/gepeto/projectsWithoutQuotation.jsp Modified: trunk/chorem-web/src/main/java/org/chorem/gepeto/action/ProjectAction.java trunk/chorem-web/src/main/resources/i18n/chorem-web_en_GB.properties trunk/chorem-web/src/main/resources/i18n/chorem-web_fr_FR.properties trunk/chorem-web/src/main/resources/struts.xml trunk/chorem-web/src/main/webapp/WEB-INF/jsp/gepeto/home.jsp Modified: trunk/chorem-web/src/main/java/org/chorem/gepeto/action/ProjectAction.java =================================================================== --- trunk/chorem-web/src/main/java/org/chorem/gepeto/action/ProjectAction.java 2011-04-15 09:41:44 UTC (rev 91) +++ trunk/chorem-web/src/main/java/org/chorem/gepeto/action/ProjectAction.java 2011-04-15 09:57:06 UTC (rev 92) @@ -396,13 +396,35 @@ endYear = cal.get(Calendar.YEAR); if (beginYear <= yearInt && yearInt <= endYear) { company = proxy.restore(Company.class, projectOrder.getCompany()); - customers.add(company); + if (!customers.contains(company)) { + customers.add(company); + } } } return customers; } /** + * Gets the projects without any quotation + * + * @return the projects without quotation + */ + public List<Project> getProjectsWithoutQuotation() { + ChoremProxy proxy = getChoremProxy(); + List<Quotation> quotations = getAllQuotations(); + Collection<Project> projects = new ArrayList<Project>(getAllProjects()); + List<Project> projectsWithQuotation = new ArrayList<Project>(); + Project project; + + for (Quotation quotation : quotations) { + project = proxy.restore(Project.class, quotation.getProject()); + projectsWithQuotation.add(project); + } + projects.removeAll(projectsWithQuotation); + return (List<Project>) projects; + } + + /** * @return the name */ public String getName() { Modified: trunk/chorem-web/src/main/resources/i18n/chorem-web_en_GB.properties =================================================================== --- trunk/chorem-web/src/main/resources/i18n/chorem-web_en_GB.properties 2011-04-15 09:41:44 UTC (rev 91) +++ trunk/chorem-web/src/main/resources/i18n/chorem-web_en_GB.properties 2011-04-15 09:57:06 UTC (rev 92) @@ -143,6 +143,7 @@ chorem.gepeto.projectsByYear.thead.start=Start chorem.gepeto.projectsByYear.title=Projects of year {0} chorem.gepeto.projectsWithoutQuotation= +chorem.gepeto.projectsWithoutQuotation.title= chorem.gepeto.results.title=Results by year chorem.gepeto.task=Task {0} chorem.gepeto.task.add=Add a new task Modified: trunk/chorem-web/src/main/resources/i18n/chorem-web_fr_FR.properties =================================================================== --- trunk/chorem-web/src/main/resources/i18n/chorem-web_fr_FR.properties 2011-04-15 09:41:44 UTC (rev 91) +++ trunk/chorem-web/src/main/resources/i18n/chorem-web_fr_FR.properties 2011-04-15 09:57:06 UTC (rev 92) @@ -138,7 +138,8 @@ chorem.gepeto.projectsByYear.thead.name=Nom chorem.gepeto.projectsByYear.thead.start=D\u00E9but chorem.gepeto.projectsByYear.title=Projets de l''ann\u00E9e {0} -chorem.gepeto.projectsWithoutQuotation= +chorem.gepeto.projectsWithoutQuotation=Obtenir la liste des projets sans devis +chorem.gepeto.projectsWithoutQuotation.title= chorem.gepeto.results.title=R\u00E9sultats par ann\u00E0e chorem.gepeto.task=T\u00E2che {0} chorem.gepeto.task.add=Ajouter une nouvelle t\u00E2che Modified: trunk/chorem-web/src/main/resources/struts.xml =================================================================== --- trunk/chorem-web/src/main/resources/struts.xml 2011-04-15 09:41:44 UTC (rev 91) +++ trunk/chorem-web/src/main/resources/struts.xml 2011-04-15 09:57:06 UTC (rev 92) @@ -106,10 +106,13 @@ <result name="error" type="redirectAction">home</result> <result>/WEB-INF/jsp/gepeto/projectOrderDetails.jsp</result> </action> - <action name="getProjectsByYear" class="org.chorem.gepeto.action.ProjectAction" method="projectsByYear"> + <action name="projectsByYear" class="org.chorem.gepeto.action.ProjectAction" method="projectsByYear"> <result name="error" type="redirectAction">home</result> <result>/WEB-INF/jsp/gepeto/projectsByYear.jsp</result> </action> + <action name="projectsWithoutQuotation" class="org.chorem.gepeto.action.ProjectAction"> + <result>/WEB-INF/jsp/gepeto/projectsWithoutQuotation.jsp</result> + </action> <action name="projectDetails" class="org.chorem.gepeto.action.ProjectAction" method="projectDetails"> <result name="error" type="redirectAction">home</result> <result>/WEB-INF/jsp/gepeto/projectDetails.jsp</result> Modified: trunk/chorem-web/src/main/webapp/WEB-INF/jsp/gepeto/home.jsp =================================================================== --- trunk/chorem-web/src/main/webapp/WEB-INF/jsp/gepeto/home.jsp 2011-04-15 09:41:44 UTC (rev 91) +++ trunk/chorem-web/src/main/webapp/WEB-INF/jsp/gepeto/home.jsp 2011-04-15 09:57:06 UTC (rev 92) @@ -10,11 +10,11 @@ <body> <p> <s:a action="addProjectInput"><s:text name="chorem.gepeto.project.add" /></s:a><br /> - <s:url action="getProjectsByYear" var="getProjectsByYear"> + <s:url action="projectsByYear" var="projectsByYear"> <s:param name="year">2011</s:param> </s:url> - <a href="${getProjectsByYear}"><s:text name="chorem.gepeto.projects" /></a><br /> - <s:a action="getProjectsWithoutQuotation"><s:text name="chorem.gepeto.projectsWithoutQuotation" /></s:a><br /> + <a href="${projectsByYear}"><s:text name="chorem.gepeto.projects" /></a><br /> + <s:a action="projectsWithoutQuotation"><s:text name="chorem.gepeto.projectsWithoutQuotation" /></s:a><br /> </p> </body> </html> Added: trunk/chorem-web/src/main/webapp/WEB-INF/jsp/gepeto/projectsWithoutQuotation.jsp =================================================================== --- trunk/chorem-web/src/main/webapp/WEB-INF/jsp/gepeto/projectsWithoutQuotation.jsp (rev 0) +++ trunk/chorem-web/src/main/webapp/WEB-INF/jsp/gepeto/projectsWithoutQuotation.jsp 2011-04-15 09:57:06 UTC (rev 92) @@ -0,0 +1,27 @@ +<%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> +<%@page import="java.util.List" %> +<%@page import="org.chorem.entities.Project" %> +<%@page import="org.chorem.gepeto.action.ProjectAction" %> +<%@taglib prefix="s" uri="/struts-tags" %> + +<html xmlns:s="http://java.sun.com/xml/ns/j2ee/web-jsptaglibrary_2_0.xsd" + xmlns:jsp="http://java.sun.com/JSP/Page"> + <head> + <title><s:text name="chorem.gepeto.projectsWithoutQuotation.title" /></title> + <s:head /> + </head> + <body> + <p> + <% + List<Project> projects = ProjectAction.getAction().getProjectsWithoutQuotation(); + + for (Project project : projects) { + %> + <s:url action="projectDetails" var="projectDetails"> + <s:param name="projectId"><%= project.getWikittyId() %></s:param> + </s:url> + <a href="${projectDetails}"><%= project.getName() %></a><br /> + <% } %> + </p> + </body> +</html> Property changes on: trunk/chorem-web/src/main/webapp/WEB-INF/jsp/gepeto/projectsWithoutQuotation.jsp ___________________________________________________________________ Added: svn:mime-type + text/plain
participants (1)
-
vbriand@users.chorem.org