BrightSide Workbench Full Report + Source Code
org.turro.crm.zul.sale.SaleActionRowComposer Class Reference
Inheritance diagram for org.turro.crm.zul.sale.SaleActionRowComposer:
Collaboration diagram for org.turro.crm.zul.sale.SaleActionRowComposer:

Public Member Functions

void onChanging $comment (InputEvent evt)
 
void onSelect $touchpoint ()
 
void onCheck $touchpointend ()
 
void onSelect $address ()
 
void onSelect $vendor ()
 
void onChange $type ()
 
void onChange $attendees ()
 
void onChange $fromDate ()
 
void onChange $toDate ()
 
void onCheck $status ()
 
void onClick $calendar ()
 
void onClick $saveButton ()
 
void onClick $cancelButton ()
 
void onClick $delButton ()
 
void doAfterCompose (Component comp) throws Exception
 

Detailed Description

Author
Lluis TurrĂ³ Cutiller lluis.nosp@m.@tur.nosp@m.ro.or.nosp@m.g

Definition at line 61 of file SaleActionRowComposer.java.

Member Function Documentation

◆ $address()

void onSelect org.turro.crm.zul.sale.SaleActionRowComposer.$address ( )

Definition at line 95 of file SaleActionRowComposer.java.

95  {
96  updateButtons(true);
97  }

◆ $attendees()

void onChange org.turro.crm.zul.sale.SaleActionRowComposer.$attendees ( )

Definition at line 107 of file SaleActionRowComposer.java.

107  {
108  updateButtons(true);
109  }

◆ $calendar()

void onClick org.turro.crm.zul.sale.SaleActionRowComposer.$calendar ( )

Definition at line 128 of file SaleActionRowComposer.java.

128  {
129  CalendarView.showCalendar(new CalendarEventCallback() {
130  @Override
131  public void onCreate(Date from, Date to) {
132  fromDate.setValue(from);
133  toDate.setValue(to);
134  updateDates();
135  updateButtons(true);
136  }
137  @Override
138  public void onUpdate(Date from, Date to) {
139  fromDate.setValue(from);
140  toDate.setValue(to);
141  updateDates();
142  updateButtons(true);
143  }
144  @Override
145  public String getPath() {
146  return CrmPU.getObjectPath(saleAction);
147  }
148  });
149  }
Here is the call graph for this function:

◆ $cancelButton()

void onClick org.turro.crm.zul.sale.SaleActionRowComposer.$cancelButton ( )

Definition at line 178 of file SaleActionRowComposer.java.

178  {
179  initControls();
180  updateButtons(false);
181  }

◆ $comment()

void onChanging org.turro.crm.zul.sale.SaleActionRowComposer.$comment ( InputEvent  evt)

Definition at line 83 of file SaleActionRowComposer.java.

83  {
84  updateButtons(true, evt.getValue());
85  }

◆ $delButton()

void onClick org.turro.crm.zul.sale.SaleActionRowComposer.$delButton ( )

Definition at line 183 of file SaleActionRowComposer.java.

183  {
184  Messages.confirmDeletion().show(() -> {
185  EntityCollections.entities(saleAction.getVendorProspect().getSaleActions()).remove(saleAction);
186  saleAction.setVendorProspect(null);
187  new CrmPU().executeUpdate("delete from SaleAction as sa where sa = ?", new Object[] { saleAction });
188  row.detach();
189  });
190  }
VendorProspect getVendorProspect()
void setVendorProspect(VendorProspect vendorProspect)
Here is the call graph for this function:

◆ $fromDate()

void onChange org.turro.crm.zul.sale.SaleActionRowComposer.$fromDate ( )

Definition at line 111 of file SaleActionRowComposer.java.

111  {
112  toDate.setValue(CheckDate.addDayDifference(lastDate, fromDate.getValue(), toDate.getValue()));
113  updateDates();
114  updateButtons(true);
115  }

◆ $saveButton()

void onClick org.turro.crm.zul.sale.SaleActionRowComposer.$saveButton ( )

Definition at line 151 of file SaleActionRowComposer.java.

151  {
152  saleAction.setActionDate(fromDate.getValue());
153  saleAction.setFinalDate(toDate.getValue());
154  saleAction.setComment(comment.getValue());
155  saleAction.setVendorProspect(vendor.getObjectValue());
156  saleAction.setActionType((Set<String>) type.getCollection());
157  saleAction.setAttendees((HashSet<String>) attendees.getAttendees());
158  if(saleProspect.getType() == ProspectType.TRACING) {
159  saleAction.getTouchPoints().clear();
160  } else {
161  saleAction.setProcessTouchPoints((Set<TouchPoint>) touchpoint.getObjectValues());
162  saleAction.setEndingTouchPoint(touchpointend.getObjectValue());
163  }
164  saleAction.setAddress(address.getObjectValue());
165  saleAction.setStatus(status.getSelectedIndex());
166  if(!saleAction.isEmpty()) {
167  saleAction.prepareSave();
168  boolean reload = saleAction.getId() == 0;
169  saleAction = new CrmPU().saveObject(saleAction);
170  if(reload) {
171  grid.refresh();
172  } else {
173  updateButtons(false);
174  }
175  }
176  }
void setActionType(Set< String > actionType)
Definition: SaleAction.java:70
void setEndingTouchPoint(TouchPoint tp)
void setAttendees(Set< String > attendees)
Definition: SaleAction.java:86
void setComment(String comment)
Definition: SaleAction.java:94
void setFinalDate(Date finalDate)
void setProcessTouchPoints(Set< TouchPoint > stp)
void setActionDate(Date actionDate)
Definition: SaleAction.java:62
Set< TouchPoint > getTouchPoints()
void setAddress(Address address)
Collection< String > getCollection()
Here is the call graph for this function:

◆ $status()

void onCheck org.turro.crm.zul.sale.SaleActionRowComposer.$status ( )

Definition at line 122 of file SaleActionRowComposer.java.

122  {
123  updateControls();
124  updateDates();
125  updateButtons(true);
126  }

◆ $toDate()

void onChange org.turro.crm.zul.sale.SaleActionRowComposer.$toDate ( )

Definition at line 117 of file SaleActionRowComposer.java.

117  {
118  updateDates();
119  updateButtons(true);
120  }

◆ $touchpoint()

void onSelect org.turro.crm.zul.sale.SaleActionRowComposer.$touchpoint ( )

Definition at line 87 of file SaleActionRowComposer.java.

87  {
88  updateButtons(true);
89  }

◆ $touchpointend()

void onCheck org.turro.crm.zul.sale.SaleActionRowComposer.$touchpointend ( )

Definition at line 91 of file SaleActionRowComposer.java.

91  {
92  updateButtons(true);
93  }

◆ $type()

void onChange org.turro.crm.zul.sale.SaleActionRowComposer.$type ( )

Definition at line 103 of file SaleActionRowComposer.java.

103  {
104  updateButtons(true);
105  }

◆ $vendor()

void onSelect org.turro.crm.zul.sale.SaleActionRowComposer.$vendor ( )

Definition at line 99 of file SaleActionRowComposer.java.

99  {
100  updateButtons(true);
101  }

◆ doAfterCompose()

void org.turro.crm.zul.sale.SaleActionRowComposer.doAfterCompose ( Component  comp) throws Exception

Definition at line 193 of file SaleActionRowComposer.java.

193  {
194  super.doAfterCompose(comp);
195  saleAction = (SaleAction) Executions.getCurrent().getAttribute("saleAction");
196  if(saleAction == null) {
197  saleProspect = (SaleProspect) Executions.getCurrent().getAttribute("saleProspect");
198  if(saleProspect != null) {
199  Date from = (Date) Executions.getCurrent().getAttribute("from"),
200  to = (Date) Executions.getCurrent().getAttribute("to");
201  saleAction = new SaleAction();
202  if(from != null && to != null) {
203  saleAction.setActionDate(from);
204  saleAction.setFinalDate(to);
205  } else {
206  saleAction.setActionDate(new Date());
207  }
208  saleAction.setAttendees(saleProspect.getAttendees());
209  SaleAction last = saleProspect.getSaleActions().isEmpty() ? null : saleProspect.getSaleActions().last();
210  if(last != null) {
211  saleAction.setTouchPoints(last.getTouchPoints());
212  }
213  grid = ((SaleActionGrid) Executions.getCurrent().getAttribute("grid"));
214  }
215  } else {
216  saleProspect = saleAction.getVendorProspect().getSaleProspect();
217  row = ((Row) Executions.getCurrent().getAttribute("row"));
218  }
219  initControls();
220  }
void setTouchPoints(Set< TouchPoint > touchPoints)
Here is the call graph for this function:

The documentation for this class was generated from the following file: