19 package org.turro.crm.zul.sale;
21 import org.turro.command.Command;
22 import org.turro.command.CommandUtil;
23 import org.turro.command.Context;
24 import org.turro.contacts.organigram.TargetFinder;
25 import org.turro.crm.entity.Campaign;
26 import org.turro.crm.entity.CampaignVendor;
27 import org.turro.crm.entity.Customer;
28 import org.turro.crm.entity.CustomerOwner;
29 import org.turro.crm.entity.ProspectStage;
30 import org.turro.crm.entity.ProspectType;
31 import org.turro.crm.entity.SaleAction;
32 import org.turro.crm.entity.SaleProspect;
33 import org.turro.crm.entity.TouchPoint;
34 import org.turro.crm.entity.VendorProspect;
35 import org.turro.crm.zul.customer.CustomerFilter;
36 import org.turro.crm.zul.customer.CustomerFilterGrid;
37 import org.turro.crm.zul.customer.CustomerListbox;
38 import org.turro.i18n.I_;
39 import org.turro.plugin.contacts.IContact;
40 import org.turro.util.Chars;
41 import org.turro.util.PhraseBuilder;
42 import org.turro.zkoss.filter.GenericFilterListbox;
43 import org.turro.zkoss.grid.PagingGrid;
44 import org.turro.zkoss.label.LabelTypes;
45 import org.zkoss.zk.ui.HtmlBasedComponent;
46 import org.zkoss.zk.ui.ext.AfterCompose;
47 import org.zkoss.zul.Column;
48 import org.zkoss.zul.Columns;
49 import org.zkoss.zul.Label;
50 import org.zkoss.zul.Row;
51 import org.zkoss.zul.Rows;
52 import org.zkoss.zul.Vlayout;
68 this.campaign = campaign;
75 customers.
show(
I_.
get(
"Customers"),
"800px",
"600px",
new Command() {
77 public Object execute(Context context) {
78 if(customers !=
null) {
112 private void addRows() {
116 if(rows !=
null) removeChild(rows);
124 HtmlBasedComponent comp =
null;
125 if(sp.getId() == 0L) {
126 comp =
new Label(sp.getFullDescription());
128 comp = CommandUtil.getLink(sp);
131 rows.appendChild(row);
132 if(sp.getVendorProspects().isEmpty()) {
133 comp.setStyle(
"color:red;");
135 row.appendChild(comp);
138 Vlayout vbox =
new Vlayout();
139 row.appendChild(vbox);
140 vbox.appendChild(
new Label(sp.getSaleActions().size() +
""));
142 vbox =
new Vlayout();
143 row.appendChild(vbox);
144 SaleAction sa = sp.getLastSaleAction();
146 for(TouchPoint tp : sa.getProcessTouchPoints()) {
147 vbox.appendChild(LabelTypes.getSoftLabel(tp.getName()));
149 TouchPoint tp = sa.getEndingTouchPoint();
151 vbox.appendChild(LabelTypes.getCaptionLabel(tp.getName()));
155 PhraseBuilder pb =
new PhraseBuilder();
156 for(VendorProspect vp : sp.getVendorProspects()) {
157 pb.addWord(vp.getVendor().getName());
158 pb.addPendingSeparator(
", ");
160 pb.addPendingSeparator(
" " + Chars.forward() +
" ");
161 for(IContact contact : sp.getIAttendees()) {
162 pb.addWord(contact.getName());
163 pb.addPendingSeparator(
", ");
165 row.appendChild(LabelTypes.getSoftLabel(pb.toString()));
181 private void addColumns() {
182 Columns cols =
new Columns();
185 Column col =
new Column(
I_.
get(
"Sale prospect"));
186 cols.appendChild(col);
188 col =
new Column(
I_.
get(
"Sale actions"),
null,
"150px");
189 col.setAlign(
"right");
190 cols.appendChild(col);
192 col =
new Column(
I_.
get(
"Touch points"),
null,
"30%");
193 cols.appendChild(col);
195 col =
new Column(
I_.
get(
"Participants"),
null,
"20%");
196 cols.appendChild(col);
SaleProspect customerExists(Customer customer)
TargetArray getTargetArray()
Set< CampaignVendor > getCampaignVendors()
Set< SaleProspect > getSaleProspects()
void setStage(ProspectStage stage)
void setIAttendees(Collection< IContact > contacts)
void setClosingDate(Date closingDate)
void setCampaign(Campaign campaign)
void addCampaignVendor(CampaignVendor campaignVendor)
void setType(ProspectType type)
void setCustomer(Customer customer)
void setDescription(String description)
void setProspectDate(Date prospectDate)
void addCustomerOwner(CustomerOwner customerOwner)
void setCampaign(Campaign campaign)
static String get(String msg)
void show(String title, String width, String height, Command command)
Collection< E > getObjectValues()
void setRowCount(int rows)