branch develop updated (794e95a -> 6f3426a)
This is an automated email from the git hooks/post-receive script. New change to branch develop in repository chorem. See http://git.chorem.org/chorem.git from 794e95a fixes #1136 : change request to get invoice that target project and quotations on the project new 6f3426a fixes #1148 : NPE sur l'export de contacts The 1 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "adds" were already present in the repository and have only been added to this reference. Detailed log of new commits: commit 6f3426a7c97006c4ecbc5aebc21c3d864c38fbc3 Author: kootox <jean.couteau@gmail.com> Date: Mon Dec 1 14:50:42 2014 +0100 fixes #1148 : NPE sur l'export de contacts Summary of changes: .../chorem/webmotion/actions/crm/ExportAction.java | 89 +++++++++++----------- 1 file changed, 46 insertions(+), 43 deletions(-) -- To stop receiving notification emails like this one, please contact chorem.org SCM administrator <admin+scm@chorem.org>.
This is an automated email from the git hooks/post-receive script. New commit to branch develop in repository chorem. See http://git.chorem.org/chorem.git commit 6f3426a7c97006c4ecbc5aebc21c3d864c38fbc3 Author: kootox <jean.couteau@gmail.com> Date: Mon Dec 1 14:50:42 2014 +0100 fixes #1148 : NPE sur l'export de contacts --- .../chorem/webmotion/actions/crm/ExportAction.java | 89 +++++++++++----------- 1 file changed, 46 insertions(+), 43 deletions(-) diff --git a/chorem-webmotion/src/main/java/org/chorem/webmotion/actions/crm/ExportAction.java b/chorem-webmotion/src/main/java/org/chorem/webmotion/actions/crm/ExportAction.java index b67f18b..2a7c432 100644 --- a/chorem-webmotion/src/main/java/org/chorem/webmotion/actions/crm/ExportAction.java +++ b/chorem-webmotion/src/main/java/org/chorem/webmotion/actions/crm/ExportAction.java @@ -66,50 +66,53 @@ public class ExportAction extends WebMotionController { client.findAllByQuery(Employee.class, contactsQuery); for(Employee contact:contacts){ - ContactRowForExport contactRow = new ContactRowForExport(); - //Contact company - Company company = client.restore(Company.class, contact.getCompany(), ""); - contactRow.setCompany(company.getName()); - - //contact names - Person person = client.restore(Person.class, contact.getPerson()); - contactRow.setFirstName(person.getFirstName()); - contactRow.setLastName(person.getLastName()); - - //start with person info - WikittyQuery personContactDetailsQuery = new WikittyQueryMaker().and() - .exteq(ContactDetails.EXT_CONTACTDETAILS) - .eq(ContactDetails.ELEMENT_FIELD_CONTACTDETAILS_TARGET, person.getWikittyId()) - .end().setLimit(WikittyQuery.MAX); - WikittyQueryResult<ContactDetails> personContactDetails = - client.findAllByQuery(ContactDetails.class, personContactDetailsQuery); - for (ContactDetails detail:personContactDetails) { - addContactDetail(contactRow, detail); + if (contact.getPerson() != null && contact.getCompany() != null) { + + ContactRowForExport contactRow = new ContactRowForExport(); + //Contact company + Company company = client.restore(Company.class, contact.getCompany(), ""); + contactRow.setCompany(company.getName()); + + //contact names + Person person = client.restore(Person.class, contact.getPerson()); + contactRow.setFirstName(person.getFirstName()); + contactRow.setLastName(person.getLastName()); + + //start with person info + WikittyQuery personContactDetailsQuery = new WikittyQueryMaker().and() + .exteq(ContactDetails.EXT_CONTACTDETAILS) + .eq(ContactDetails.ELEMENT_FIELD_CONTACTDETAILS_TARGET, person.getWikittyId()) + .end().setLimit(WikittyQuery.MAX); + WikittyQueryResult<ContactDetails> personContactDetails = + client.findAllByQuery(ContactDetails.class, personContactDetailsQuery); + for (ContactDetails detail : personContactDetails) { + addContactDetail(contactRow, detail); + } + + //then company info (override person info if duplicate) + WikittyQuery companyContactDetailsQuery = new WikittyQueryMaker().and() + .exteq(ContactDetails.EXT_CONTACTDETAILS) + .eq(ContactDetails.ELEMENT_FIELD_CONTACTDETAILS_TARGET, company.getWikittyId()) + .end().setLimit(WikittyQuery.MAX); + WikittyQueryResult<ContactDetails> companyContactDetails = + client.findAllByQuery(ContactDetails.class, companyContactDetailsQuery); + for (ContactDetails detail : companyContactDetails) { + addContactDetail(contactRow, detail); + } + + //end with employee info (override previous info if duplicate) + WikittyQuery employeeContactDetailsQuery = new WikittyQueryMaker().and() + .exteq(ContactDetails.EXT_CONTACTDETAILS) + .eq(ContactDetails.ELEMENT_FIELD_CONTACTDETAILS_TARGET, contact.getWikittyId()) + .end().setLimit(WikittyQuery.MAX); + WikittyQueryResult<ContactDetails> employeeContactDetails = + client.findAllByQuery(ContactDetails.class, employeeContactDetailsQuery); + for (ContactDetails detail : employeeContactDetails) { + addContactDetail(contactRow, detail); + } + + datas.add(contactRow); } - - //then company info (override person info if duplicate) - WikittyQuery companyContactDetailsQuery = new WikittyQueryMaker().and() - .exteq(ContactDetails.EXT_CONTACTDETAILS) - .eq(ContactDetails.ELEMENT_FIELD_CONTACTDETAILS_TARGET, company.getWikittyId()) - .end().setLimit(WikittyQuery.MAX); - WikittyQueryResult<ContactDetails> companyContactDetails = - client.findAllByQuery(ContactDetails.class, companyContactDetailsQuery); - for (ContactDetails detail:companyContactDetails) { - addContactDetail(contactRow, detail); - } - - //end with employee info (override previous info if duplicate) - WikittyQuery employeeContactDetailsQuery = new WikittyQueryMaker().and() - .exteq(ContactDetails.EXT_CONTACTDETAILS) - .eq(ContactDetails.ELEMENT_FIELD_CONTACTDETAILS_TARGET, contact.getWikittyId()) - .end().setLimit(WikittyQuery.MAX); - WikittyQueryResult<ContactDetails> employeeContactDetails = - client.findAllByQuery(ContactDetails.class, employeeContactDetailsQuery); - for (ContactDetails detail:companyContactDetails) { - addContactDetail(contactRow, detail); - } - - datas.add(contactRow); } -- To stop receiving notification emails like this one, please contact chorem.org SCM administrator <admin+scm@chorem.org>.
participants (1)
-
chorem.org scm