r93 - in trunk/chorem-web/src/main: java/org/chorem/bonzoms/action resources resources/i18n resources/org/chorem/bonzoms/action webapp/WEB-INF/jsp/bonzoms
Author: vbriand Date: 2011-04-15 16:39:32 +0200 (Fri, 15 Apr 2011) New Revision: 93 Url: http://chorem.org/repositories/revision/chorem/93 Log: Added a list of companies. An employee and its contract can now be added (on the person's page) Added: trunk/chorem-web/src/main/resources/org/chorem/bonzoms/action/PersonAction-addPerson-validation.xml trunk/chorem-web/src/main/webapp/WEB-INF/jsp/bonzoms/companies.jsp Removed: trunk/chorem-web/src/main/resources/org/chorem/bonzoms/action/PersonAction-validation.xml Modified: trunk/chorem-web/src/main/java/org/chorem/bonzoms/action/CompanyAction.java trunk/chorem-web/src/main/java/org/chorem/bonzoms/action/PersonAction.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/bonzoms/addPerson.jsp trunk/chorem-web/src/main/webapp/WEB-INF/jsp/bonzoms/home.jsp Modified: trunk/chorem-web/src/main/java/org/chorem/bonzoms/action/CompanyAction.java =================================================================== --- trunk/chorem-web/src/main/java/org/chorem/bonzoms/action/CompanyAction.java 2011-04-15 09:57:06 UTC (rev 92) +++ trunk/chorem-web/src/main/java/org/chorem/bonzoms/action/CompanyAction.java 2011-04-15 14:39:32 UTC (rev 93) @@ -12,6 +12,10 @@ import org.chorem.entities.CompanyImpl; import org.chorem.entities.ContactDetails; import org.chorem.entities.ContactDetailsImpl; +import org.nuiton.wikitty.search.Criteria; +import org.nuiton.wikitty.search.PagedResult; +import org.nuiton.wikitty.search.Search; + import com.opensymphony.xwork2.ActionContext; import static org.nuiton.i18n.I18n.n_; @@ -37,15 +41,11 @@ if (name != null && type != null && addressLine1 != null && postcode != null && city != null && country != null && phoneNb != null && website != null) { - if (!name.isEmpty() && !type.isEmpty() && !addressLine1.isEmpty() && - !postcode.isEmpty() && !city.isEmpty() && - !country.isEmpty()) { - //If the company has been added successfully - if (addCompany()) { - result = SUCCESS; - } else { - result = ERROR; - } + //If the company has been added successfully + if (addCompany()) { + result = SUCCESS; + } else { + result = ERROR; } } return result; @@ -174,6 +174,21 @@ } /** + * Gets all companies + * + * @return a list containing all companies + */ + public List<Company> getAllCompanies() { + ChoremProxy proxy = getChoremProxy(); + Search search = Search.query(); + Criteria criteria = search.exteq(Company.EXT_COMPANY).criteria(); + PagedResult<Company> result = proxy.findAllByCriteria(Company.class, + criteria); + List<Company> companies = result.getAll(); + return companies; + } + + /** * @return the name */ public String getName() { Modified: trunk/chorem-web/src/main/java/org/chorem/bonzoms/action/PersonAction.java =================================================================== --- trunk/chorem-web/src/main/java/org/chorem/bonzoms/action/PersonAction.java 2011-04-15 09:57:06 UTC (rev 92) +++ trunk/chorem-web/src/main/java/org/chorem/bonzoms/action/PersonAction.java 2011-04-15 14:39:32 UTC (rev 93) @@ -9,6 +9,8 @@ import org.chorem.ContactDetailsConstants; import org.chorem.action.BaseAction; import org.chorem.entities.ContactDetailsImpl; +import org.chorem.entities.EmployeeImpl; +import org.chorem.entities.EmploymentContractImpl; import org.chorem.entities.PersonImpl; import static org.nuiton.i18n.I18n.n_; @@ -36,14 +38,11 @@ if (firstName != null && lastName != null && email != null && birthDate != null) { - if (!firstName.isEmpty() && !lastName.isEmpty() && - !email.isEmpty() && !birthDate.isEmpty()) { - //If the person has been added successfully - if (addPerson()) { - result = SUCCESS; - } else { - result = ERROR; - } + //If the person has been added successfully + if (addPerson()) { + result = SUCCESS; + } else { + result = ERROR; } } return result; @@ -59,6 +58,15 @@ protected String city; protected String country; protected String phoneNb; + protected String employeeDiploma; + protected String employeePaidLeave; + protected String employeeRtt; + protected String contractType; + protected String contractDescription; + protected String contractSalary; + protected String contractWorkingTime; + protected String contractBeginDate; + protected String contractEndDate; /** * Stores the new person through the proxy @@ -72,7 +80,6 @@ try { ChoremProxy proxy = getChoremProxy(); PersonImpl newPerson = new PersonImpl(); - ContactDetailsImpl newContactDetails = new ContactDetailsImpl(); SimpleDateFormat formatter = new SimpleDateFormat("dd/MM/yyyy"); newPerson.setFirstName(firstName); @@ -90,6 +97,7 @@ //If everything went smoothly if (result) { + ContactDetailsImpl newContactDetails = new ContactDetailsImpl(); String address = addressLine1; if (!addressLine2.isEmpty()) { @@ -113,7 +121,11 @@ newContactDetails.setTarget(newPerson.getWikittyId()); proxy.store(newContactDetails); } - proxy.store(newPerson); + + result = storeEmployee(newPerson, result, proxy); + if (result) { + proxy.store(newPerson); + } } } catch (Exception e) { result = false; @@ -124,6 +136,120 @@ } /** + * Stores the employee details and links them to the person + * + * @param newPerson the person to link the employee details with + * @param result whether or not the previous operations went smoothly + * @param proxy the wikitty proxy + * @return true if no errors occurred, false otherwise + */ + protected boolean storeEmployee(PersonImpl newPerson, boolean result, + ChoremProxy proxy) { + //Filling the employee fields isn't mandatory, but if one of + //them is filled, the others (except the diploma) must be + //filled as well + if (!employeePaidLeave.isEmpty() || !employeeRtt.isEmpty() || + !employeeDiploma.isEmpty()) { + if (!employeePaidLeave.isEmpty() && !employeeRtt.isEmpty()) { + EmployeeImpl newEmployee = new EmployeeImpl(); + + newEmployee.setDiploma(employeeDiploma); + newEmployee.setPerson(newPerson.getWikittyId()); + try { + newEmployee.setPaidLeave( + Float.parseFloat(employeePaidLeave)); + if (newEmployee.getPaidLeave() < 0) { + throw new NumberFormatException(); + } + } catch (NumberFormatException e) { + result = false; + addFieldError("employeePaidLeave", getText( + n_("chorem.bonzoms.employee.paidLeave.wrongFormat"))); + } + try { + newEmployee.setRtt(Float.parseFloat(employeeRtt)); + if (newEmployee.getRtt() < 0) { + throw new NumberFormatException(); + } + } catch (NumberFormatException e) { + result = false; + addFieldError("employeeRtt", getText( + n_("chorem.bonzoms.employee.rtt.wrongFormat"))); + } + + result = storeEmploymentContract(newEmployee, result, proxy); + if (result) { + proxy.store(newEmployee); + } + + } else { + result = false; + addActionError(getText( + n_("chorem.bonzoms.employee.required"))); + } + } + return result; + } + + /** + * Stores an employment contract and links it with the person + * + * @param employee the employee to link the contract with + * @param result whether or not the previous operations went smoothly + * @param proxy the wikitty proxy + * @return true if no errors occurred, false otherwise + */ + protected boolean storeEmploymentContract(EmployeeImpl employee, + boolean result, ChoremProxy proxy) { + if (!contractDescription.isEmpty() && !contractSalary.isEmpty() && + !contractType.isEmpty() && !contractWorkingTime.isEmpty()) { + EmploymentContractImpl newEmploymentContract = + new EmploymentContractImpl(); + SimpleDateFormat formatter = new SimpleDateFormat("dd/MM/yyyy"); + + newEmploymentContract.setDescription(contractDescription); + newEmploymentContract.setEmployee(employee.getWikittyId()); + + try { + newEmploymentContract.setBeginDate( + formatter.parse(contractBeginDate)); + if (!contractEndDate.isEmpty()) { + newEmploymentContract.setEndDate( + formatter.parse(contractEndDate)); + } + } catch (ParseException e) { + addActionError(getText(n_("chorem.date.wrongFormat"))); + result = false; + } + + try { + newEmploymentContract.setSalary(Float.parseFloat(contractSalary)); + } catch (NumberFormatException e) { + addFieldError("contractSalary", + getText(n_("chorem.bonzoms.employmentContract.salary.wrongFormat"))); + result = false; + } + newEmploymentContract.setType(contractType); + try { + newEmploymentContract.setWorkingTime( + Integer.parseInt(contractWorkingTime)); + } catch (NumberFormatException e) { + addFieldError("contractWorkingTime", + getText(n_("chorem.bonzoms.employmentContract.workingTime.wrongFormat"))); + result = false; + } + if (result) { + proxy.store(newEmploymentContract); + } + } else { + addActionError(getText( + n_("chorem.bonzoms.employmentContract.allFieldsRequired"))); + result = false; + } + return result; + } + + /** * @return the firstName */ public String getFirstName() { @@ -262,4 +388,130 @@ public void setPhoneNb(String phoneNb) { this.phoneNb = phoneNb; } + + /** + * @return the employeeDiploma + */ + public String getEmployeeDiploma() { + return employeeDiploma; + } + + /** + * @param employeeDiploma the employeeDiploma to set + */ + public void setEmployeeDiploma(String employeeDiploma) { + this.employeeDiploma = employeeDiploma; + } + + /** + * @return the employeePaidLeave + */ + public String getEmployeePaidLeave() { + return employeePaidLeave; + } + + /** + * @param employeePaidLeave the employeePaidLeave to set + */ + public void setEmployeePaidLeave(String employeePaidLeave) { + this.employeePaidLeave = employeePaidLeave; + } + + /** + * @return the employeeRtt + */ + public String getEmployeeRtt() { + return employeeRtt; + } + + /** + * @param employeeRtt the employeeRtt to set + */ + public void setEmployeeRtt(String employeeRtt) { + this.employeeRtt = employeeRtt; + } + + /** + * @return the contractType + */ + public String getContractType() { + return contractType; + } + + /** + * @param contractType the contractType to set + */ + public void setContractType(String contractType) { + this.contractType = contractType; + } + + /** + * @return the contractDescription + */ + public String getContractDescription() { + return contractDescription; + } + + /** + * @param contractDescription the contractDescription to set + */ + public void setContractDescription(String contractDescription) { + this.contractDescription = contractDescription; + } + + /** + * @return the contractSalary + */ + public String getContractSalary() { + return contractSalary; + } + + /** + * @param contractSalary the contractSalary to set + */ + public void setContractSalary(String contractSalary) { + this.contractSalary = contractSalary; + } + + /** + * @return the contractWorkingTime + */ + public String getContractWorkingTime() { + return contractWorkingTime; + } + + /** + * @param contractWorkingTime the contractWorkingTime to set + */ + public void setContractWorkingTime(String contractWorkingTime) { + this.contractWorkingTime = contractWorkingTime; + } + + /** + * @return the contractBeginDate + */ + public String getContractBeginDate() { + return contractBeginDate; + } + + /** + * @param contractBeginDate the contractBeginDate to set + */ + public void setContractBeginDate(String contractBeginDate) { + this.contractBeginDate = contractBeginDate; + } + + /** + * @return the contractEndDate + */ + public String getContractEndDate() { + return contractEndDate; + } + + /** + * @param contractEndDate the contractEndDate to set + */ + public void setContractEndDate(String contractEndDate) { + this.contractEndDate = contractEndDate; + } } 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:57:06 UTC (rev 92) +++ trunk/chorem-web/src/main/resources/i18n/chorem-web_en_GB.properties 2011-04-15 14:39:32 UTC (rev 93) @@ -18,6 +18,7 @@ chorem.billy.quotation.reference=Reference chorem.billy.quotation.vta=VTA chorem.billy.quotationDetails.title= +chorem.bonzoms.companies= chorem.bonzoms.company=Company {0} chorem.bonzoms.company.add=Add a new company chorem.bonzoms.company.address= @@ -29,6 +30,7 @@ chorem.bonzoms.company.country=Country chorem.bonzoms.company.country.required=You must enter the country chorem.bonzoms.company.create.error=An error occurred while creating your new company, please try again. If the problem persists, please contact an administrator +chorem.bonzoms.company.list= chorem.bonzoms.company.name=Company''s name chorem.bonzoms.company.name.required=You must enter the company''s name chorem.bonzoms.company.phoneNb=Phone number (opt.) @@ -48,8 +50,16 @@ chorem.bonzoms.contactDetails.type.required=You must enter the contact details'' type chorem.bonzoms.contactDetails.value=Contact details'' value chorem.bonzoms.contactDetails.value.required=You must enter the contact details'' value +chorem.bonzoms.employee= +chorem.bonzoms.employee.diploma= +chorem.bonzoms.employee.paidLeave= +chorem.bonzoms.employee.paidLeave.wrongFormat= +chorem.bonzoms.employee.required= +chorem.bonzoms.employee.rtt= +chorem.bonzoms.employee.rtt.wrongFormat= chorem.bonzoms.employmentContract=Employment contract chorem.bonzoms.employmentContract.add=Add a new employment contract +chorem.bonzoms.employmentContract.allFieldsRequired= chorem.bonzoms.employmentContract.beginDate=Begin date (dd/mm/yyyy) chorem.bonzoms.employmentContract.beginDate.required=You must enter the employment contract''s begin date chorem.bonzoms.employmentContract.create.error=An error occurred while creating your new employment contract, please try again. If the problem persists, please contact an administrator 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:57:06 UTC (rev 92) +++ trunk/chorem-web/src/main/resources/i18n/chorem-web_fr_FR.properties 2011-04-15 14:39:32 UTC (rev 93) @@ -17,6 +17,7 @@ chorem.billy.quotation.reference=R\u00E9f\u00E9rence chorem.billy.quotation.vta=TVA chorem.billy.quotationDetails.title= +chorem.bonzoms.companies= chorem.bonzoms.company=Soci\u00E9t\u00E9 chorem.bonzoms.company.add=Ajouter une nouvelle soci\u00E9t\u00E9 chorem.bonzoms.company.address= @@ -28,6 +29,7 @@ chorem.bonzoms.company.country=Pays chorem.bonzoms.company.country.required=Vous devez indiquer le pays chorem.bonzoms.company.create.error=Une erreur s''est produite lors de la cr\u00E9ation de votre nouvelle soci\u00E9t\u00E9, merci d''essayer \u00E0 nouveau. Si le probl\u00E8me se reproduit, merci de contacter un administrateur +chorem.bonzoms.company.list=Obtenir la liste des soci\u00E9t\u00E9s chorem.bonzoms.company.name=Nom de la soci\u00E9t\u00E9 chorem.bonzoms.company.name.required=Vous devez entrer le nom de la soci\u00E9t\u00E9 chorem.bonzoms.company.phoneNb=Num\u00E9ro de t\u00E9l\u00E9phone (opt.) @@ -47,8 +49,16 @@ chorem.bonzoms.contactDetails.type.required=Vous devez saisir le type de la m\u00E9thode de contact chorem.bonzoms.contactDetails.value=Valeur de la m\u00E9thode de contact chorem.bonzoms.contactDetails.value.required=Vous devez entrer la valeur de la m\u00E9thode de contact +chorem.bonzoms.employee=Employ\u00E9 +chorem.bonzoms.employee.diploma=Dipl\u00F4me (opt.) +chorem.bonzoms.employee.paidLeave=Cong\u00E9s pay\u00E9s +chorem.bonzoms.employee.paidLeave.wrongFormat=Les cong\u00E9s pay\u00E9s doivent \u00EAtre \u00EAtre un entier positif ou un nombre \u00E0 virgule flottante positif +chorem.bonzoms.employee.required=Vous devez remplir le nombre de cong\u00E9s pay\u00E9s et les RTT +chorem.bonzoms.employee.rtt=RTT +chorem.bonzoms.employee.rtt.wrongFormat=Les RTT doivent \u00EAtre \u00EAtre un entier positif ou un nombre \u00E0 virgule flottante positif chorem.bonzoms.employmentContract=Contrat de travail chorem.bonzoms.employmentContract.add=Ajouter un nouveau contrat de travail +chorem.bonzoms.employmentContract.allFieldsRequired= chorem.bonzoms.employmentContract.beginDate=Date de d\u00E9but chorem.bonzoms.employmentContract.beginDate.required=Vous devez renseigner la date de d\u00E9but du contrat de travail chorem.bonzoms.employmentContract.create.error=Une erreur s''est produite lors de la cr\u00E9ation de votre nouveau contrat de travail, merci d''essayer \u00E0 nouveau. Si le probl\u00E8me se reproduit, merci de contacter un administrateur Copied: trunk/chorem-web/src/main/resources/org/chorem/bonzoms/action/PersonAction-addPerson-validation.xml (from rev 92, trunk/chorem-web/src/main/resources/org/chorem/bonzoms/action/PersonAction-validation.xml) =================================================================== --- trunk/chorem-web/src/main/resources/org/chorem/bonzoms/action/PersonAction-addPerson-validation.xml (rev 0) +++ trunk/chorem-web/src/main/resources/org/chorem/bonzoms/action/PersonAction-addPerson-validation.xml 2011-04-15 14:39:32 UTC (rev 93) @@ -0,0 +1,49 @@ +<!DOCTYPE validators PUBLIC + "-//OpenSymphony Group//XWork Validator 1.0.2//EN" + "http://www.opensymphony.com/xwork/xwork-validator-1.0.2.dtd"> + +<validators> + <field name="firstName"> + <field-validator type="requiredstring"> + <message key="chorem.bonzoms.person.firstName.required" /> + </field-validator> + </field> + <field name="lastName"> + <field-validator type="requiredstring"> + <message key="chorem.bonzoms.person.lastName.required" /> + </field-validator> + </field> + <field name="email"> + <field-validator type="requiredstring"> + <message key="chorem.bonzoms.person.email.required" /> + </field-validator> + <field-validator type="email"> + <message key="chorem.bonzoms.person.email.wrongFormat" /> + </field-validator> + </field> + <field name="birthDate"> + <field-validator type="requiredstring"> + <message key="chorem.bonzoms.person.birthDate.required" /> + </field-validator> + </field> + <field name="addressLine1"> + <field-validator type="requiredstring"> + <message key="chorem.bonzoms.person.addressLine1.required" /> + </field-validator> + </field> + <field name="postcode"> + <field-validator type="requiredstring"> + <message key="chorem.bonzoms.person.postcode.required" /> + </field-validator> + </field> + <field name="city"> + <field-validator type="requiredstring"> + <message key="chorem.bonzoms.person.city.required" /> + </field-validator> + </field> + <field name="country"> + <field-validator type="requiredstring"> + <message key="chorem.bonzoms.person.country.required" /> + </field-validator> + </field> +</validators> Property changes on: trunk/chorem-web/src/main/resources/org/chorem/bonzoms/action/PersonAction-addPerson-validation.xml ___________________________________________________________________ Added: svn:mime-type + text/plain Deleted: trunk/chorem-web/src/main/resources/org/chorem/bonzoms/action/PersonAction-validation.xml =================================================================== --- trunk/chorem-web/src/main/resources/org/chorem/bonzoms/action/PersonAction-validation.xml 2011-04-15 09:57:06 UTC (rev 92) +++ trunk/chorem-web/src/main/resources/org/chorem/bonzoms/action/PersonAction-validation.xml 2011-04-15 14:39:32 UTC (rev 93) @@ -1,49 +0,0 @@ -<!DOCTYPE validators PUBLIC - "-//OpenSymphony Group//XWork Validator 1.0.2//EN" - "http://www.opensymphony.com/xwork/xwork-validator-1.0.2.dtd"> - -<validators> - <field name="firstName"> - <field-validator type="requiredstring"> - <message key="chorem.bonzoms.person.firstName.required" /> - </field-validator> - </field> - <field name="lastName"> - <field-validator type="requiredstring"> - <message key="chorem.bonzoms.person.lastName.required" /> - </field-validator> - </field> - <field name="email"> - <field-validator type="requiredstring"> - <message key="chorem.bonzoms.person.email.required" /> - </field-validator> - <field-validator type="email"> - <message key="chorem.bonzoms.person.email.wrongFormat" /> - </field-validator> - </field> - <field name="birthDate"> - <field-validator type="requiredstring"> - <message key="chorem.bonzoms.person.birthDate.required" /> - </field-validator> - </field> - <field name="addressLine1"> - <field-validator type="requiredstring"> - <message key="chorem.bonzoms.person.addressLine1.required" /> - </field-validator> - </field> - <field name="postcode"> - <field-validator type="postcode"> - <message key="chorem.bonzoms.person.postcode.required" /> - </field-validator> - </field> - <field name="city"> - <field-validator type="city"> - <message key="chorem.bonzoms.person.city.required" /> - </field-validator> - </field> - <field name="country"> - <field-validator type="country"> - <message key="chorem.bonzoms.person.country.required" /> - </field-validator> - </field> -</validators> Modified: trunk/chorem-web/src/main/resources/struts.xml =================================================================== --- trunk/chorem-web/src/main/resources/struts.xml 2011-04-15 09:57:06 UTC (rev 92) +++ trunk/chorem-web/src/main/resources/struts.xml 2011-04-15 14:39:32 UTC (rev 93) @@ -30,6 +30,9 @@ <result name="error" type="redirectAction">home</result> <result>/WEB-INF/jsp/bonzoms/companyDetails.jsp</result> </action> + <action name="companies" class="org.chorem.bonzoms.action.CompanyAction"> + <result>/WEB-INF/jsp/bonzoms/companies.jsp</result> + </action> <action name="addPersonInput"> <result>/WEB-INF/jsp/bonzoms/addPerson.jsp</result> </action> Modified: trunk/chorem-web/src/main/webapp/WEB-INF/jsp/bonzoms/addPerson.jsp =================================================================== --- trunk/chorem-web/src/main/webapp/WEB-INF/jsp/bonzoms/addPerson.jsp 2011-04-15 09:57:06 UTC (rev 92) +++ trunk/chorem-web/src/main/webapp/WEB-INF/jsp/bonzoms/addPerson.jsp 2011-04-15 14:39:32 UTC (rev 93) @@ -34,9 +34,35 @@ <br /> <br /> <s:textfield key="chorem.bonzoms.person.phoneNb" name="phoneNb" labelSeparator=": " /> + </fieldset> + <br /> + <fieldset> + <legend><s:text name="chorem.bonzoms.employee" /></legend> + <s:textfield key="chorem.bonzoms.employee.diploma" name="employeeDiploma" labelSeparator=": " /> <br /> - <s:submit key="chorem.bonzoms.person.add" name="submit" /> + <s:textfield key="chorem.bonzoms.employee.paidLeave" name="employeePaidLeave" labelSeparator=": " /> + <br /> + <s:textfield key="chorem.bonzoms.employee.rtt" name="employeeRtt" labelSeparator=": " /> + <br /> + <br /> + <fieldset> + <legend><s:text name="chorem.bonzoms.employmentContract" /></legend> + <s:textfield key="chorem.bonzoms.employmentContract.type" name="contractType" labelSeparator=": " /> + <br /> + <br /> + <s:textarea key="chorem.bonzoms.employmentContract.description" name="contractDescription" rows="10" cols="50" labelposition="top" /> + <br /> + <s:textfield key="chorem.bonzoms.employmentContract.salary" name="contractSalary" labelSeparator=": " /> + <br /> + <s:textfield key="chorem.bonzoms.employmentContract.workingTime" name="contractWorkingTime" labelSeparator=": " /> + <br /> + <s:textfield key="chorem.bonzoms.employmentContract.beginDate" name="contractBeginDate" labelSeparator=": " /> + <br /> + <s:textfield key="chorem.bonzoms.employmentContract.endDate" name="contractEndDate" labelSeparator=": " /> + </fieldset> </fieldset> + <br /> + <s:submit key="chorem.bonzoms.person.add" name="submit" /> </s:form> </body> -</html> +</html> \ No newline at end of file Added: trunk/chorem-web/src/main/webapp/WEB-INF/jsp/bonzoms/companies.jsp =================================================================== --- trunk/chorem-web/src/main/webapp/WEB-INF/jsp/bonzoms/companies.jsp (rev 0) +++ trunk/chorem-web/src/main/webapp/WEB-INF/jsp/bonzoms/companies.jsp 2011-04-15 14:39:32 UTC (rev 93) @@ -0,0 +1,29 @@ +<%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %> +<%@page import="java.util.List" %> +<%@page import="org.chorem.entities.Company" %> +<%@page import="org.chorem.bonzoms.action.CompanyAction" %> +<%@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.bonzoms.companies" /> + </title> + <s:head /> + </head> + <body> + <% + List<Company> companies = CompanyAction.getAction().getAllCompanies(); + + for (Company company : companies) { + %> + <s:url namespace="/bonzoms" action="companyDetails" var="companyDetails"> + <s:param name="companyId"><%= company.getWikittyId() %></s:param> + </s:url> + <a href="${companyDetails}"><%= company.getName() %></a><br /> + <% + } + %> + </body> +</html> Property changes on: trunk/chorem-web/src/main/webapp/WEB-INF/jsp/bonzoms/companies.jsp ___________________________________________________________________ Added: svn:mime-type + text/plain Modified: trunk/chorem-web/src/main/webapp/WEB-INF/jsp/bonzoms/home.jsp =================================================================== --- trunk/chorem-web/src/main/webapp/WEB-INF/jsp/bonzoms/home.jsp 2011-04-15 09:57:06 UTC (rev 92) +++ trunk/chorem-web/src/main/webapp/WEB-INF/jsp/bonzoms/home.jsp 2011-04-15 14:39:32 UTC (rev 93) @@ -10,7 +10,8 @@ <body> <p> <s:a action="addCompanyInput"><s:text name="chorem.bonzoms.company.add" /></s:a><br /> - <s:a action="addPersonInput"><s:text name="chorem.bonzoms.person.add" /></s:a> + <s:a action="addPersonInput"><s:text name="chorem.bonzoms.person.add" /></s:a><br /> + <s:a action="companies"><s:text name="chorem.bonzoms.company.list" /></s:a> </p> </body> </html>
participants (1)
-
vbriand@users.chorem.org