Commit 2759f2b5 by Tuomas Riihimäki

Merge branch 'issue105_csvExportEnterilla' into 'master'

Ei enää välilöyntejä csv:ssä

otsikko

See merge request !342
2 parents 65bf3fdf 521339ae
...@@ -107,35 +107,48 @@ public class UserCartView extends GenericCDIView { ...@@ -107,35 +107,48 @@ public class UserCartView extends GenericCDIView {
for (EventUser uc : usercart) for (EventUser uc : usercart)
{ {
sb.append(uc.getFirstnames()).append(CSV_SEPARATOR); StringBuilder ul = new StringBuilder();
sb.append(uc.getLastname()).append(CSV_SEPARATOR);
sb.append(uc.getNick()).append(CSV_SEPARATOR);
sb.append(uc.getLogin()).append(CSV_SEPARATOR); ul.append(uc.getFirstnames()).append(CSV_SEPARATOR);
sb.append(uc.getBirthday() != null ? dateformat.format(uc.getBirthday()) : "").append(CSV_SEPARATOR); ul.append(uc.getLastname()).append(CSV_SEPARATOR);
sb.append(uc.getUser().getAge()).append(CSV_SEPARATOR); ul.append(uc.getNick()).append(CSV_SEPARATOR);
sb.append(uc.getPhone()).append(CSV_SEPARATOR); ul.append(uc.getLogin()).append(CSV_SEPARATOR);
sb.append(uc.getEmail()).append(CSV_SEPARATOR); ul.append(uc.getBirthday() != null ? dateformat.format(uc.getBirthday()) : "").append(CSV_SEPARATOR);
sb.append(uc.getAddress()).append(CSV_SEPARATOR); ul.append(uc.getUser().getAge()).append(CSV_SEPARATOR);
sb.append(uc.getZip()).append(CSV_SEPARATOR); ul.append(uc.getPhone()).append(CSV_SEPARATOR);
sb.append(uc.getUser().getTown()).append(CSV_SEPARATOR); ul.append(uc.getEmail()).append(CSV_SEPARATOR);
ul.append(uc.getAddress()).append(CSV_SEPARATOR);
ul.append(uc.getZip()).append(CSV_SEPARATOR);
ul.append(uc.getUser().getTown()).append(CSV_SEPARATOR);
for (GroupMembership gm : uc.getGroupMemberships()) for (GroupMembership gm : uc.getGroupMemberships())
{ {
if (gm.getPlaceReservation() != null) if (gm.getPlaceReservation() != null)
{ {
sb.append(gm.getPlaceReservation().getName()).append(", "); ul.append(gm.getPlaceReservation().getName()).append(", ");
} }
} }
sb.append(CSV_SEPARATOR); ul.append(CSV_SEPARATOR);
if (uc.getCreated() != null) { if (uc.getCreated() != null) {
sb.append(createtimeFormat.format(uc.getCreated().getTime())); ul.append(createtimeFormat.format(uc.getCreated().getTime()));
} }
sb.append(CSV_SEPARATOR); ul.append(CSV_SEPARATOR);
if (uc.getEventuserCreated() != null) { if (uc.getEventuserCreated() != null) {
sb.append(createtimeFormat.format(uc.getEventuserCreated())); ul.append(createtimeFormat.format(uc.getEventuserCreated()));
} }
sb.append(CSV_SEPARATOR); ul.append(CSV_SEPARATOR);
sb.append(ul.toString()
.replaceAll("\n", " ")
.replaceAll("\r", " ")
.replaceAll(" ", " ")
);
sb.append("\n"); sb.append("\n");
} }
DefaultStreamedContent ret = new DefaultStreamedContent(new ByteArrayInputStream(sb.toString().getBytes(UTF8))); DefaultStreamedContent ret = new DefaultStreamedContent(new ByteArrayInputStream(sb.toString().getBytes(UTF8)));
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!