Author: vbriand Date: 2011-04-14 15:38:04 +0200 (Thu, 14 Apr 2011) New Revision: 85 Url: http://chorem.org/repositories/revision/chorem/85 Log: Added more details on company's page Modified: trunk/chorem-web/src/main/java/org/chorem/bonzoms/action/CompanyAction.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/webapp/WEB-INF/jsp/bonzoms/companyDetails.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-14 13:11:27 UTC (rev 84) +++ trunk/chorem-web/src/main/java/org/chorem/bonzoms/action/CompanyAction.java 2011-04-14 13:38:04 UTC (rev 85) @@ -1,5 +1,6 @@ package org.chorem.bonzoms.action; +import java.util.List; import java.util.UUID; import org.apache.commons.logging.Log; @@ -9,6 +10,7 @@ import org.chorem.action.BaseAction; import org.chorem.entities.Company; import org.chorem.entities.CompanyImpl; +import org.chorem.entities.ContactDetails; import org.chorem.entities.ContactDetailsImpl; import com.opensymphony.xwork2.ActionContext; @@ -72,6 +74,25 @@ if (company != null) { //If the companyId exists setName(company.getName()); setType(company.getType()); + + List<ContactDetails> contactDetailsList = ChoremProxy. + getContactDetails(companyId); + + for (ContactDetails contactDetails : contactDetailsList) { + if (contactDetails.getName().equals( + CONTACT_DETAILS_POSTAL_ADDRESS + + " of company \"" + company.getName() + "\"")) { + setAddress(contactDetails.getValue()); + } else if (contactDetails.getName().equals( + CONTACT_DETAILS_PHONE + " of company \"" + + name + "\"")) { + setPhoneNb(contactDetails.getValue()); + } else if (contactDetails.getName().equals( + CONTACT_DETAILS_WEBSITE + " of company \"" + + name + "\"")) { + setWebsite(contactDetails.getValue()); + } + } } else { result = ERROR; } @@ -93,6 +114,7 @@ protected String phoneNb; protected String website; protected String companyId; + protected String address; /** * Stores the new company through the proxy @@ -290,4 +312,18 @@ public void setCompanyId(String companyId) { this.companyId = companyId; } + + /** + * @return the address + */ + public String getAddress() { + return address; + } + + /** + * @param address the address to set + */ + public void setAddress(String address) { + this.address = address; + } } 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-14 13:11:27 UTC (rev 84) +++ trunk/chorem-web/src/main/resources/i18n/chorem-web_en_GB.properties 2011-04-14 13:38:04 UTC (rev 85) @@ -20,6 +20,7 @@ chorem.billy.quotationDetails.title= chorem.bonzoms.company=Company {0} chorem.bonzoms.company.add=Add a new company +chorem.bonzoms.company.address= chorem.bonzoms.company.addressLine1=Address chorem.bonzoms.company.addressLine1.required=You must enter the first address line chorem.bonzoms.company.addressLine2=Address line 2 (opt.) 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-14 13:11:27 UTC (rev 84) +++ trunk/chorem-web/src/main/resources/i18n/chorem-web_fr_FR.properties 2011-04-14 13:38:04 UTC (rev 85) @@ -19,6 +19,7 @@ chorem.billy.quotationDetails.title= chorem.bonzoms.company=Soci\u00E9t\u00E9 chorem.bonzoms.company.add=Ajouter une nouvelle soci\u00E9t\u00E9 +chorem.bonzoms.company.address= chorem.bonzoms.company.addressLine1=Adresse chorem.bonzoms.company.addressLine1.required=Vous devez donner l'adresse de l''entreprise chorem.bonzoms.company.addressLine2=Adresse ligne 2 (opt.) Modified: trunk/chorem-web/src/main/webapp/WEB-INF/jsp/bonzoms/companyDetails.jsp =================================================================== --- trunk/chorem-web/src/main/webapp/WEB-INF/jsp/bonzoms/companyDetails.jsp 2011-04-14 13:11:27 UTC (rev 84) +++ trunk/chorem-web/src/main/webapp/WEB-INF/jsp/bonzoms/companyDetails.jsp 2011-04-14 13:38:04 UTC (rev 85) @@ -19,6 +19,13 @@ </s:text> </h2> <s:actionerror /> - <s:textfield key="chorem.bonzoms.company.type" name="type" labelSeparator=": " readonly="true" /><br /> + <s:textfield key="chorem.bonzoms.company.type" name="type" labelSeparator=": " readonly="true" /> + <br /> + <br /> + <s:textarea key="chorem.bonzoms.company.address" name="address" readonly="true" cols="50" rows="3" labelposition="top" /> + <br /> + <s:textfield key="chorem.bonzoms.company.phoneNb" name="phoneNb" labelSeparator=": " readonly="true" /> + <br /> + <s:textfield key="chorem.bonzoms.company.website" name="website" labelSeparator=": " readonly="true" /> </body> </html>