1 /*jshint bitwise:true, indent:2, curly:true, eqeqeq:true, immed:true,
2 latedef:true, newcap:true, noarg:true, regexp:true, undef:true,
3 trailing:true, white:true, strict:false*/
4 /*global XT:true, XM:true, _:true, enyo:true, Globalize:true*/
8 // ..........................................................
13 name: "XV.AccountListParameters",
14 kind: "XV.ParameterWidget",
15 characteristicsRole: "isAccounts",
17 {kind: "onyx.GroupboxHeader", content: "_account".loc()},
18 {name: "isActive", attr: "isActive", label: "_showInactive".loc(), defaultKind: "XV.CheckboxWidget",
19 getParameter: function () {
21 if (!this.getValue()) {
23 attribute: this.getAttr(),
31 {name: "number", label: "_number".loc(), attr: "number"},
32 {name: "name", label: "_name".loc(), attr: "name"},
33 {kind: "onyx.GroupboxHeader", content: "_contact".loc()},
34 {name: "primaryContact", label: "_primaryContact".loc(), attr: "primaryContact.name"},
35 {name: "primaryEmail", label: "_primaryEmail".loc(), attr: "primaryContact.primaryEmail"},
36 {kind: "onyx.GroupboxHeader", content: "_address".loc()},
37 {name: "phone", label: "_phone".loc(), attr: ["primaryContact.phone", "primaryContact.alternate", "primaryContact.fax"]},
38 {name: "street", label: "_street".loc(), attr: ["primaryContact.address.line1", "primaryContact.address.line2", "primaryContact.address.line3"]},
39 {name: "city", label: "_city".loc(), attr: "primaryContact.address.city"},
40 {name: "postalCode", label: "_postalCode".loc(), attr: "primaryContact.address.postalCode"},
41 {name: "state", label: "_state".loc(), attr: "primaryContact.address.state"},
42 {name: "country", label: "_country".loc(), attr: "primaryContact.address.country"},
43 {kind: "onyx.GroupboxHeader", content: "_userAccount".loc()},
44 {name: "owner", label: "_owner".loc(), attr: "owner", defaultKind: "XV.UserAccountWidget"}
49 name: "XV.UserAccountListParameters",
50 kind: "XV.ParameterWidget",
52 {kind: "onyx.GroupboxHeader", content: "_userAccount".loc()},
53 {name: "isActive", attr: "isActive", label: "_showInactive".loc(), defaultKind: "XV.CheckboxWidget",
54 getParameter: function () {
56 if (!this.getValue()) {
58 attribute: this.getAttr(),
66 {name: "username", label: "_username".loc(), attr: "username"},
67 {name: "propername", label: "_propername".loc(), attr: "propername"},
68 {name: "email", label: "_email".loc(), attr: "email"}
72 // ..........................................................
77 var _namify = function (obj) {
78 return "show" + obj.type.pluralize();
82 name: "XV.ActivityListParameters",
83 kind: "XV.ParameterWidget",
87 defaultParameters: function () {
88 var actTypes = this.getActivityTypes(),
89 keys = _.keys(actTypes),
90 params = {user: XM.currentUser};
92 _.each(keys, function (key) {
93 _.each(actTypes[key], function (obj) {
94 params[_namify(obj)] = true;
101 {kind: "onyx.GroupboxHeader", content: "_activities".loc()},
102 {name: "showInactive", label: "_showInactive".loc(), attr: "isActive", defaultKind: "XV.CheckboxWidget",
103 getParameter: function () {
105 if (!this.getValue()) {
107 attribute: this.getAttr(),
115 {name: "name", label: "_name".loc(), attr: "name"},
116 {name: "description", label: "_description".loc(), attr: "description"},
117 {kind: "onyx.GroupboxHeader", content: "_userAccounts".loc(), name: "userHeader"},
118 {name: "owner", label: "_owner".loc(), attr: "owner", defaultKind: "XV.UserAccountWidget"},
119 {name: "assignedTo", label: "_assignedTo".loc(), attr: "assignedTo", defaultKind: "XV.UserAccountWidget"},
120 {name: "user", label: "_user".loc(), attr: ["owner.username", "assignedTo.username"], defaultKind: "XV.UserAccountWidget"},
121 {kind: "onyx.GroupboxHeader", content: "_dueDate".loc()},
122 {name: "fromDate", label: "_fromDate".loc(), attr: "dueDate", operator: ">=",
123 filterLabel: "_from".loc() + " " + "_dueDate".loc() + " " + "_date".loc(),
124 defaultKind: "XV.DateWidget"},
125 {name: "toDate", label: "_toDate".loc(), attr: "dueDate", operator: "<=",
126 filterLabel: "_to".loc() + " " + "_dueDate".loc() + " " + "_date".loc(),
127 defaultKind: "XV.DateWidget"}
129 create: function () {
130 var fn1 = this.defaultFilterChanged, // Cache to intercept
131 fn2 = this.populateFromUserPref,
132 actTypes = this.getActivityTypes(),
133 keys = _.keys(actTypes),
137 this.defaultFilterChanged = function () {};
138 this.populateFromUserPref = function () {};
140 this.inherited(arguments);
142 // Build up toggle check boxes for activity types
143 _.each(keys, function (key) {
145 that.createComponent({
146 kind: "onyx.GroupboxHeader",
147 content: ("_" + key).loc()
150 _.each(actTypes[key], function (obj) {
151 // Create filter Widget
152 that.createComponent({
154 label: obj.label ? obj.label : ("_" + obj.type.pluralize().camelize()).loc(),
155 defaultKind: "XV.ToggleButtonWidget"
161 this.defaultFilterChanged = fn1;
162 this.defaultFilterChanged();
163 this.populateFromUserPref = fn2;
164 this.populateFromUserPref();
166 getParameters: function () {
167 var params = this.inherited(arguments),
168 actTypes = this.getActivityTypes(),
169 keys = _.keys(actTypes),
174 // For each dynamically added object type
175 // see if toggle is on and update params
176 _.each(keys, function (key) {
177 _.each(actTypes[key], function (obj) {
178 if (that.$[_namify(obj)].getValue()) {
179 value.push(obj.type);
185 param.attribute = "activityType";
186 param.operator = "ANY";
195 // ..........................................................
200 name: "XV.AddressListParameters",
201 kind: "XV.ParameterWidget",
203 {kind: "onyx.GroupboxHeader", content: "_address".loc()},
204 {name: "isActive", attr: "isActive", label: "_showInactive".loc(), defaultKind: "XV.CheckboxWidget",
205 getParameter: function () {
207 if (!this.getValue()) {
209 attribute: this.getAttr(),
217 {name: "street", label: "_street".loc(), attr: ["line1", "line2", "line3"]},
218 {name: "city", label: "_city".loc(), attr: "city"},
219 {name: "postalCode", label: "_postalCode".loc(), attr: "postalCode"},
220 {name: "state", label: "_state".loc(), attr: "state"},
221 {name: "country", label: "_country".loc(), attr: "country"},
222 {name: "account", label: "_account".loc(), attr: "account", defaultKind: "XV.AccountWidget"}
226 // ..........................................................
231 name: "XV.ContactListParameters",
232 kind: "XV.ParameterWidget",
233 characteristicsRole: "isContacts",
235 {kind: "onyx.GroupboxHeader", content: "_contact".loc()},
236 {name: "isActive", attr: "isActive", label: "_showInactive".loc(), defaultKind: "XV.CheckboxWidget",
237 getParameter: function () {
239 if (!this.getValue()) {
241 attribute: this.getAttr(),
249 {name: "name", label: "_name".loc(), attr: "name"},
250 {name: "primaryEmail", label: "_primaryEmail".loc(), attr: "primaryEmail"},
251 {name: "phone", label: "_phone".loc(), attr: ["phone", "alternate", "fax"]},
252 {kind: "onyx.GroupboxHeader", content: "_address".loc()},
253 {name: "street", label: "_street".loc(), attr: ["address.line1", "address.line2", "address.line3"]},
254 {name: "city", label: "_city".loc(), attr: "address.city"},
255 {name: "state", label: "_state".loc(), attr: "address.state"},
256 {name: "postalCode", label: "_postalCode".loc(), attr: "address.postalCode"},
257 {name: "country", label: "_country".loc(), attr: "address.country"},
258 {kind: "onyx.GroupboxHeader", content: "_relationships".loc()},
259 {name: "account", label: "_account".loc(), attr: ["account.number", "accountParent"], defaultKind: "XV.AccountWidget"},
260 {kind: "onyx.GroupboxHeader", content: "_userAccount".loc()},
261 {name: "owner", label: "_owner".loc(), attr: "owner", defaultKind: "XV.UserAccountWidget"}
265 // ..........................................................
270 name: "XV.CostCategoryListParameters",
271 kind: "XV.ParameterWidget",
273 {kind: "onyx.GroupboxHeader", content: "_costCategory".loc()},
274 {name: "code", label: "_code".loc(), attr: "code"}
278 // ..........................................................
283 name: "XV.CreditCardListParameters",
284 kind: "XV.ParameterWidget",
286 {kind: "onyx.GroupboxHeader", content: "_creditCards".loc()},
287 {name: "name", label: "_name".loc(), attr: "name"}
291 // ..........................................................
296 name: "XV.CustomerListParameters",
297 kind: "XV.ParameterWidget",
299 {kind: "onyx.GroupboxHeader", content: "_customer".loc()},
300 {name: "isActive", attr: "isActive", label: "_showInactive".loc(), defaultKind: "XV.CheckboxWidget",
301 getParameter: function () {
303 if (!this.getValue()) {
305 attribute: this.getAttr(),
313 {name: "number", label: "_number".loc(), attr: "number"},
314 {name: "name", label: "_name".loc(), attr: "name"},
315 {name: "customerType", attr: "customerType", label: "_customerType".loc(), defaultKind: "XV.CustomerTypePicker"},
316 {kind: "onyx.GroupboxHeader", content: "_contact".loc()},
317 {name: "primaryEmail", label: "_primaryEmail".loc(), attr: "billingContact.primaryEmail"},
318 {name: "phone", label: "_phone".loc(), attr: ["billingContact.phone", "billingContact.alternate", "billingContact.fax"]},
319 {kind: "onyx.GroupboxHeader", content: "_address".loc()},
320 {name: "street", label: "_street".loc(), attr: ["billingContact.address.line1", "billingContact.address.line2", "billingContact.address.line3"]},
321 {name: "city", label: "_city".loc(), attr: "billingContact.address.city"},
322 {name: "state", label: "_state".loc(), attr: "billingContact.address.state"},
323 {name: "postalCode", label: "_postalCode".loc(), attr: "billingContact.address.postalCode"},
324 {name: "country", label: "_country".loc(), attr: "billingContact.address.country"}
328 // ..........................................................
333 name: "XV.CustomerGroupListParameters",
334 kind: "XV.ParameterWidget",
336 {kind: "onyx.GroupboxHeader", content: "_customerGroup".loc()},
337 {name: "name", label: "_name".loc(), attr: "name"},
338 {name: "description", label: "_description".loc(), attr: "description"}
342 // ..........................................................
347 name: "XV.DepartmentListParameters",
348 kind: "XV.ParameterWidget",
350 {kind: "onyx.GroupboxHeader", content: "_department".loc()},
351 {name: "number", label: "_number".loc(), attr: "number"},
352 {name: "name", label: "_code".loc(), attr: "name"}
356 // ..........................................................
361 name: "XV.EmployeeListParameters",
362 kind: "XV.ParameterWidget",
363 characteristicsRole: "isEmployees",
365 {kind: "onyx.GroupboxHeader", content: "_account".loc()},
366 {name: "isActive", attr: "isActive", label: "_showInactive".loc(), defaultKind: "XV.CheckboxWidget",
367 getParameter: function () {
369 if (!this.getValue()) {
371 attribute: this.getAttr(),
379 {name: "code", label: "_code".loc(), attr: "code"},
380 {name: "number", label: "_number".loc(), attr: "number"},
381 {name: "name", label: "_name".loc(), attr: "name"},
382 {kind: "onyx.GroupboxHeader", content: "_detail".loc()},
383 {name: "manager", label: "_manager".loc(), attr: "manager", defaultKind: "XV.EmployeeWidget"},
384 {name: "department", label: "_department".loc(), attr: "department", defaultKind: "XV.DepartmentWidget"},
385 {name: "shift", label: "_shift".loc(), attr: "shift", defaultKind: "XV.ShiftWidget"},
386 {kind: "onyx.GroupboxHeader", content: "_contact".loc()},
387 {name: "contact", label: "_contact".loc(), attr: "contact.name"},
388 {name: "primaryEmail", label: "_primaryEmail".loc(), attr: "contact.primaryEmail"},
389 {name: "phone", label: "_phone".loc(), attr: ["primaryContact.phone", "contact.alternate", "contact.fax"]},
390 {kind: "onyx.GroupboxHeader", content: "_address".loc()},
391 {name: "street", label: "_street".loc(), attr: ["primaryContact.address.line1", "contact.address.line2", "contact.address.line3"]},
392 {name: "city", label: "_city".loc(), attr: "contact.address.city"},
393 {name: "postalCode", label: "_postalCode".loc(), attr: "contact.address.postalCode"},
394 {name: "state", label: "_state".loc(), attr: "contact.address.state"},
395 {name: "country", label: "_country".loc(), attr: "cntact.address.country"}
399 // ..........................................................
404 name: "XV.EmployeeGroupListParameters",
405 kind: "XV.ParameterWidget",
407 {kind: "onyx.GroupboxHeader", content: "_employeeGroup".loc()},
408 {name: "name", label: "_name".loc(), attr: "name"},
409 {name: "description", label: "_description".loc(),
414 // ..........................................................
419 name: "XV.FreightClassListParameters",
420 kind: "XV.ParameterWidget",
422 {kind: "onyx.GroupboxHeader", content: "_freightClass".loc()},
423 {name: "code", label: "_code".loc(), attr: "code"},
424 {name: "description", label: "_description".loc(), attr: "description"}
428 // ..........................................................
433 name: "XV.CustomerShiptoParameters",
434 kind: "XV.ParameterWidget",
436 {kind: "onyx.GroupboxHeader", content: "_shipTo".loc()},
437 // TODO: this must not be editable
438 {name: "customer", label: "_customer".loc(), attr: "customer", defaultKind: "XV.CustomerWidget"},
439 {name: "number", label: "_number".loc(), attr: "number"},
440 {name: "name", label: "_name".loc(), attr: "name"}
444 // ..........................................................
449 name: "XV.FileListParameters",
450 kind: "XV.ParameterWidget",
452 {kind: "onyx.GroupboxHeader", content: "_file".loc()},
453 {name: "name", label: "_name".loc(), attr: "name"},
454 {name: "description", label: "_description".loc(), attr: "description"}
458 // ..........................................................
463 name: "XV.IncidentListParameters",
464 kind: "XV.ParameterWidget",
465 defaultParameters: function () {
470 characteristicsRole: "isIncidents",
472 {kind: "onyx.GroupboxHeader", content: "_incident".loc()},
473 {name: "number", label: "_number".loc(), attr: "number"},
474 {name: "description", label: "_description".loc(), attr: "description"},
475 {name: "category", label: "_category".loc(), attr: "category",
476 defaultKind: "XV.IncidentCategoryPicker"},
477 {name: "severity", label: "_severity".loc(), attr: "severity",
478 defaultKind: "XV.IncidentSeverityPicker"},
479 {name: "resolution", label: "_resolution".loc(), attr: "resolution",
480 defaultKind: "XV.IncidentResolutionPicker"},
481 {kind: "onyx.GroupboxHeader", content: "_priority".loc()},
482 {name: "priorityEquals", label: "_equals".loc(), attr: "priority",
483 defaultKind: "XV.PriorityPicker"},
484 {name: "priorityAbove", label: "_above".loc(), attr: "priority",
485 filterLabel: "_priority".loc() + " " + "_above".loc(),
486 defaultKind: "XV.PriorityPicker",
487 getParameter: function () {
488 var value = this.getValue(),
492 attribute: "priorityOrder",
494 value: value.get("order")
499 {kind: "onyx.GroupboxHeader", content: "_status".loc()},
500 {name: "statusEquals", label: "_equals".loc(), attr: "status",
501 filterLabel: "_status".loc() + " " + "_equals".loc(),
502 defaultKind: "XV.IncidentStatusPicker"},
503 {name: "statusAbove", label: "_above".loc(), attr: "status",
504 filterLabel: "_status".loc() + " " + "_above".loc(),
505 defaultKind: "XV.IncidentStatusPicker",
506 getParameter: function () {
507 var value = this.getValue(),
532 attribute: "statusOrder",
539 {kind: "onyx.GroupboxHeader", content: "_relationships".loc()},
540 {name: "account", label: "_account".loc(), attr: "account", defaultKind: "XV.AccountWidget"},
541 {name: "contact", label: "_contact".loc(), attr: "contact", defaultKind: "XV.ContactWidget"},
542 {kind: "onyx.GroupboxHeader", content: "_userAccounts".loc()},
543 {name: "owner", label: "_owner".loc(), attr: "owner", defaultKind: "XV.UserAccountWidget"},
544 {name: "assignedTo", label: "_assignedTo".loc(), attr: "assignedTo", defaultKind: "XV.UserAccountWidget"},
545 {name: "user", label: "_user".loc(), attr: ["owner.username", "assignedTo.username"], defaultKind: "XV.UserAccountWidget"},
546 {kind: "onyx.GroupboxHeader", content: "_created".loc()},
547 {name: "createdFromDate", label: "_fromDate".loc(),
548 filterLabel: "_created".loc() + " " + "_fromDate".loc(),
549 attr: "created", operator: ">=",
550 defaultKind: "XV.DateWidget"},
551 {name: "createdToDate", label: "_toDate".loc(),
552 filterLabel: "_created".loc() + " " + "_toDate".loc(),
553 attr: "created", operator: "<=",
554 defaultKind: "XV.DateWidget"},
555 {kind: "onyx.GroupboxHeader", content: "_updated".loc()},
556 {name: "updatedFromDate", label: "_fromDate".loc(),
557 filterLabel: "_updated".loc() + " " + "_fromDate".loc(),
558 attr: "updated", operator: ">=",
559 defaultKind: "XV.DateWidget"},
560 {name: "updatedToDate", label: "_toDate".loc(),
561 filterLabel: "_updated".loc() + " " + "_toDate".loc(),
562 attr: "updated", operator: "<=",
563 defaultKind: "XV.DateWidget"}
567 // ..........................................................
571 name: "XV.InvoiceListParameters",
572 kind: "XV.ParameterWidget",
574 {kind: "onyx.GroupboxHeader", name: "invoiceHeader", content: "_invoice".loc()},
575 {name: "number", label: "_number".loc(), attr: "number"},
576 {kind: "onyx.GroupboxHeader", content: "_show".loc()},
577 {name: "showUnposted", label: "_showUnposted".loc(),
578 attr: "isPosted", defaultKind: "XV.CheckboxWidget",
579 getParameter: function () {
581 if (!this.getValue()) {
583 attribute: this.getAttr(),
591 {name: "showPosted", label: "_showPosted".loc(),
592 attr: "isPosted", defaultKind: "XV.CheckboxWidget",
593 getParameter: function () {
595 if (!this.getValue()) {
597 attribute: this.getAttr(),
605 {name: "showVoided", label: "_showVoided".loc(),
606 attr: "isVoid", defaultKind: "XV.CheckboxWidget"},
607 {kind: "onyx.GroupboxHeader", content: "_customer".loc()},
608 {name: "customer", attr: "customer", label: "_customer".loc(), defaultKind: "XV.BillingCustomerWidget"},
609 {name: "customerType", attr: "customer.customerType", label: "_customerType".loc(), defaultKind: "XV.CustomerTypePicker"},
610 {name: "customerTypePattern", attr: "customer.customerType", label: "_customerTypePattern".loc()},
611 // TODO: INCLUDES operator? But what would the attr be?
612 //{name: "customerGroup", attr: "customer.customerGroups.customerGroup",
613 // label: "_customerGroup".loc(), defaultKind: "XV.CustomerGroupWidget"},
619 - Type Pattern (text)
622 {kind: "onyx.GroupboxHeader", name: "invoiceDateHeader", content: "_invoiceDate".loc()},
623 {name: "fromDate", label: "_fromDate".loc(), attr: "invoiceDate", operator: ">=",
624 defaultKind: "XV.DateWidget"},
625 {name: "toDate", label: "_toDate".loc(), attr: "invoiceDate", operator: "<=",
626 defaultKind: "XV.DateWidget"}
628 create: function () {
629 this.inherited(arguments);
630 // XXX only apply this if the filter is default
631 this.$.showUnposted.setValue(true);
636 // ..........................................................
641 name: "XV.ItemListParameters",
642 kind: "XV.ParameterWidget",
643 characteristicsRole: "isItems",
645 {kind: "onyx.GroupboxHeader", content: "_item".loc()},
646 {name: "isActive", attr: "isActive", label: "_showInactive".loc(), defaultKind: "XV.CheckboxWidget",
647 getParameter: function () {
649 if (!this.getValue()) {
651 attribute: this.getAttr(),
659 {name: "number", label: "_number".loc(), attr: "number"},
660 {name: "description", label: "_description".loc(), attr: ["description1", "description2"]},
661 {name: "itemType", label: "_type".loc(), attr: "itemType",
662 defaultKind: "XV.ItemTypePicker"},
663 {name: "classCode", label: "_classCode".loc(), attr: "classCode",
664 defaultKind: "XV.ClassCodePicker"},
665 {name: "category", label: "_category".loc(), attr: "productCategory",
666 defaultKind: "XV.ProductCategoryPicker"}
670 // ..........................................................
675 name: "XV.ItemSiteListParameters",
676 kind: "XV.ParameterWidget",
678 {kind: "onyx.GroupboxHeader", content: "_itemSite".loc()},
679 {name: "itemWidget", label: "_item".loc(), attr: "item",
680 defaultKind: "XV.ItemWidget"},
681 {name: "site", label: "_site".loc(), attr: "site",
682 defaultKind: "XV.SitePicker"},
683 {name: "isActive", attr: "isActive", label: "_showInactive".loc(), defaultKind: "XV.CheckboxWidget",
684 getParameter: function () {
686 if (!this.getValue()) {
688 attribute: this.getAttr(),
696 {kind: "onyx.GroupboxHeader", content: "_item".loc()},
697 {name: "itemNumber", label: "_number".loc(), attr: "item.number"},
698 {name: "itemDescription", label: "_description".loc(), attr: ["item.description1", "item.description2"]},
699 {kind: "onyx.GroupboxHeader", content: "_site".loc()},
700 {name: "siteCode", label: "_code".loc(), attr: "site.code"},
701 {name: "siteDescription", label: "_description".loc(), attr: "site.description"},
702 {kind: "onyx.GroupboxHeader", content: "_classCode".loc()},
703 {name: "classCode", label: "_equals".loc(), attr: "item.classCode",
704 defaultKind: "XV.ClassCodePicker"},
705 {name: "classCodePattern", label: "_code".loc(), attr: "item.classCode.code"},
706 {kind: "onyx.GroupboxHeader", content: "_costCategory".loc()},
707 {name: "costCategory", label: "_equals".loc(), attr: "costCategory",
708 defaultKind: "XV.CostCategoryPicker"},
709 {name: "costCategoryPattern", label: "_code".loc(), attr: "costCategory.code"},
710 {kind: "onyx.GroupboxHeader", content: "_plannerCode".loc()},
711 {name: "plannerCode", label: "_equals".loc(), attr: "plannerCode",
712 defaultKind: "XV.PlannerCodePicker"},
713 {name: "plannerCodePattern", label: "_code".loc(), attr: "plannerCode.code"}
717 // ..........................................................
722 name: "XV.LedgerAccountListParameters",
723 kind: "XV.ParameterWidget",
725 {kind: "onyx.GroupboxHeader", content: "_ledgerAccount".loc()},
726 {name: "isActive", attr: "isActive", label: "_showInactive".loc(), defaultKind: "XV.CheckboxWidget",
727 getParameter: function () {
729 if (!this.getValue()) {
731 attribute: this.getAttr(),
739 {name: "name", label: "_name".loc(), attr: "name"},
740 {name: "description", label: "_description".loc(), attr: "description"},
741 {name: "accountType", label: "_type".loc(), attr: "accountType",
742 defaultKind: "XV.LedgerAccountTypePicker"}
747 // ..........................................................
752 name: "XV.OpportunityListParameters",
753 kind: "XV.ParameterWidget",
754 defaultParameters: function () {
759 characteristicsRole: "isOpportunities",
761 {kind: "onyx.GroupboxHeader", content: "_opportunity".loc()},
762 {name: "showInactive", label: "_showInactive".loc(), attr: "isActive",
763 defaultKind: "XV.CheckboxWidget",
764 getParameter: function () {
766 if (!this.getValue()) {
768 attribute: this.getAttr(),
776 {name: "name", label: "_name".loc(), attr: "name"},
777 {kind: "onyx.GroupboxHeader", content: "_status".loc()},
778 {name: "stage", label: "_stage".loc(), attr: "opportunityStage",
779 defaultKind: "XV.OpportunityStagePicker"},
780 {name: "priority", label: "_priority".loc(), attr: "priority",
781 defaultKind: "XV.PriorityPicker"},
782 {name: "type", label: "_type".loc(), attr: "opportunityType",
783 defaultKind: "XV.OpportunityTypePicker"},
784 {name: "source", label: "_source".loc(), attr: "opportunitySource",
785 defaultKind: "XV.OpportunitySourcePicker"},
786 {kind: "onyx.GroupboxHeader", content: "_relationships".loc()},
787 {name: "account", label: "_account".loc(), attr: "account", defaultKind: "XV.AccountWidget"},
788 {name: "contact", label: "_contact".loc(), attr: "contact", defaultKind: "XV.ContactWidget"},
789 {kind: "onyx.GroupboxHeader", content: "_userAccounts".loc()},
790 {name: "owner", label: "_owner".loc(), attr: "owner", defaultKind: "XV.UserAccountWidget"},
791 {name: "assignedTo", label: "_assignedTo".loc(), attr: "assignedTo", defaultKind: "XV.UserAccountWidget"},
792 {name: "user", label: "_user".loc(), attr: ["owner.username", "assignedTo.username"], defaultKind: "XV.UserAccountWidget"},
793 {kind: "onyx.GroupboxHeader", content: "_startDate".loc()},
794 {name: "fromStartDate", label: "_fromDate".loc(), attr: "startDate", operator: ">=",
795 filterLabel: "_from".loc() + " " + "_startDate".loc() + " " + "_date".loc(),
796 defaultKind: "XV.DateWidget"},
797 {name: "toStartDate", label: "_toDate".loc(), attr: "startDate", operator: "<=",
798 filterLabel: "_to".loc() + " " + "_startDate".loc() + " " + "_date".loc(),
799 defaultKind: "XV.DateWidget"},
800 {kind: "onyx.GroupboxHeader", content: "_assignDate".loc()},
801 {name: "fromAssignDate", label: "_fromDate".loc(), attr: "assignDate", operator: ">=",
802 filterLabel: "_from".loc() + " " + "_assignedDate".loc() + " " + "_date".loc(),
803 defaultKind: "XV.DateWidget"},
804 {name: "toAssignDate", label: "_toDate".loc(), attr: "assignDate", operator: "<=",
805 filterLabel: "_to".loc() + " " + "_assignedDate".loc() + " " + "_date".loc(),
806 defaultKind: "XV.DateWidget"},
807 {kind: "onyx.GroupboxHeader", content: "_targetClose".loc()},
808 {name: "fromTargetDate", label: "_fromDate".loc(), attr: "targetClose", operator: ">=",
809 filterLabel: "_from".loc() + " " + "_targetClose".loc() + " " + "_date".loc(),
810 defaultKind: "XV.DateWidget"},
811 {name: "toTargetDate", label: "_toDate".loc(), attr: "targetClose", operator: "<=",
812 filterLabel: "_to".loc() + " " + "_targetClose".loc() + " " + "_date".loc(),
813 defaultKind: "XV.DateWidget"},
814 {kind: "onyx.GroupboxHeader", content: "_actualDate".loc()},
815 {name: "fromActualDate", label: "_fromDate".loc(), attr: "actualDate", operator: ">=",
816 filterLabel: "_from".loc() + " " + "_actualDate".loc() + " " + "_date".loc(),
817 defaultKind: "XV.DateWidget"},
818 {name: "toActualDate", label: "_toDate".loc(), attr: "actualDate", operator: "<=",
819 filterLabel: "_to".loc() + " " + "_actualDate".loc() + " " + "_date".loc(),
820 defaultKind: "XV.DateWidget"}
824 // ..........................................................
829 name: "XV.PlannerCodeListParameters",
830 kind: "XV.ParameterWidget",
832 {kind: "onyx.GroupboxHeader", content: "_plannerCode".loc()},
833 {name: "code", label: "_code".loc(), attr: "code"}
837 // ..........................................................
842 name: "XV.ProjectListParameters",
843 kind: "XV.ParameterWidget",
844 characteristicsRole: "isProjects",
845 defaultParameters: function () {
851 {kind: "onyx.GroupboxHeader", content: "_project".loc()},
852 {name: "showCompleted", label: "_showCompleted".loc(), attr: "status", defaultKind: "XV.CheckboxWidget",
853 getParameter: function () {
855 if (!this.getValue()) {
857 attribute: this.getAttr(),
865 {name: "number", label: "_number".loc(), attr: "number"},
866 {name: "name", label: "_name".loc(), attr: "name"},
867 {name: "projectType", label: "_projectType".loc(), attr: "projectType", defaultKind: "XV.ProjectTypePicker"},
868 {name: "department", label: "_department".loc(), attr: "department", defaultKind: "XV.DepartmentWidget"},
869 {name: "account", label: "_account".loc(), attr: "account", defaultKind: "XV.AccountWidget"},
870 {name: "contact", label: "_contact".loc(), attr: "contact", defaultKind: "XV.ContactWidget"},
871 {name: "statusHeader", kind: "onyx.GroupboxHeader", content: "_status".loc()},
872 {name: "status", label: "_status".loc(), attr: "status",
873 defaultKind: "XV.ProjectStatusPicker"},
874 {kind: "onyx.GroupboxHeader", content: "_priority".loc()},
875 {name: "priorityEquals", label: "_equals".loc(), attr: "priority",
876 defaultKind: "XV.PriorityPicker"},
877 {name: "priorityAbove", label: "_above".loc(), attr: "priority",
878 filterLabel: "_priority".loc() + " " + "_above".loc(),
879 defaultKind: "XV.PriorityPicker",
880 getParameter: function () {
881 var value = this.getValue(),
885 attribute: "priority.order",
887 value: value.get("order")
892 {kind: "onyx.GroupboxHeader", content: "_userAccounts".loc()},
893 {name: "owner", label: "_owner".loc(), attr: "owner", defaultKind: "XV.UserAccountWidget"},
894 {name: "assignedTo", label: "_assignedTo".loc(), attr: "assignedTo", defaultKind: "XV.UserAccountWidget"},
895 {name: "user", label: "_user".loc(), attr: ["owner.username", "assignedTo.username"], defaultKind: "XV.UserAccountWidget"},
896 {kind: "onyx.GroupboxHeader", content: "_dueDate".loc()},
897 {name: "fromDueDate", label: "_fromDate".loc(), attr: "dueDate", operator: ">=",
898 filterLabel: "_from".loc() + " " + "_dueDate".loc() + " " + "_date".loc(),
899 defaultKind: "XV.DateWidget"},
900 {name: "toDueDate", label: "_toDate".loc(), attr: "dueDate", operator: "<=",
901 filterLabel: "_to".loc() + " " + "_dueDate".loc() + " " + "_date".loc(),
902 defaultKind: "XV.DateWidget"}
905 Special handling for status.
907 setParameterItemValues: function (items) {
908 this.inherited(arguments);
910 for (i = 0; i < items.length; i++) {
911 if (items[i].name === "status" &&
912 items[i].showing === false) {
913 this.$.showCompleted.hide();
914 this.$.statusHeader.hide();
921 // ..........................................................
926 name: "XV.ProspectListParameters",
927 kind: "XV.ParameterWidget",
929 {kind: "onyx.GroupboxHeader", content: "_contact".loc()},
930 {name: "isActive", attr: "isActive", label: "_showInactive".loc(), defaultKind: "XV.CheckboxWidget",
931 getParameter: function () {
933 if (!this.getValue()) {
935 attribute: this.getAttr(),
943 {name: "number", label: "_number".loc(), attr: "number"},
944 {name: "name", label: "_name".loc(), attr: "name"},
945 {kind: "onyx.GroupboxHeader", content: "_contact".loc()},
946 {name: "primaryEmail", label: "_primaryEmail".loc(), attr: "contact.primaryEmail"},
947 {name: "phone", label: "_phone".loc(), attr: ["contact.phone", "contact.alternate", "contact.fax"]},
948 {kind: "onyx.GroupboxHeader", content: "_address".loc()},
949 {name: "street", label: "_street".loc(), attr: ["contact.address.line1", "contact.address.line2", "contact.address.line3"]},
950 {name: "city", label: "_city".loc(), attr: "contact.address.city"},
951 {name: "state", label: "_state".loc(), attr: "contact.address.state"},
952 {name: "postalCode", label: "_postalCode".loc(), attr: "contact.address.postalCode"},
953 {name: "country", label: "_country".loc(), attr: "contact.address.country"}
957 // ..........................................................
958 // PURCHASE ORDER LIST
962 name: "XV.PurchaseOrderListItemParameters",
963 kind: "XV.ParameterWidget",
965 {kind: "onyx.GroupboxHeader", content: "_purchaseOrders".loc()},
966 {name: "showUnReleased", attr: "status", label: "_showUnReleased".loc(), defaultKind: "XV.CheckboxWidget",
967 getParameter: function () {
969 if (!this.getValue()) {
971 attribute: this.getAttr(),
979 {name: "showClosed", attr: "status", label: "_showClosed".loc(), defaultKind: "XV.CheckboxWidget",
980 getParameter: function () {
982 if (!this.getValue()) {
984 attribute: this.getAttr(),
992 {name: "number", label: "_number".loc(), attr: "number"},
993 {kind: "onyx.GroupboxHeader", content: "_vendor".loc()},
994 {name: "vendor", attr: "vendor.number", label: "_vendor".loc(), defaultKind: "XV.VendorWidget"},
995 {name: "vendorType", attr: "vendor.vendorType.code", label: "_vendorType".loc(), defaultKind: "XV.VendorTypePicker"},
996 {kind: "onyx.GroupboxHeader", content: "_purchaseOrderDate".loc()},
997 {name: "fromDate", label: "_fromDate".loc(),
998 filterLabel: "_date".loc() + " " + "_fromDate".loc(),
999 attr: "orderDate", operator: ">=",
1000 defaultKind: "XV.DateWidget"},
1001 {name: "toDate", label: "_toDate".loc(),
1002 filterLabel: "_date".loc() + " " + "_toDate".loc(),
1003 attr: "orderDate", operator: "<=",
1004 defaultKind: "XV.DateWidget"}
1008 // ..........................................................
1013 name: "XV.QuoteListParameters",
1014 kind: "XV.ParameterWidget",
1016 {kind: "onyx.GroupboxHeader", content: "_quote".loc()},
1017 {name: "showExpired", label: "_showExpired".loc(), attr: "expireDate", defaultKind: "XV.CheckboxWidget",
1018 getParameter: function () {
1020 if (!this.getValue()) {
1022 attribute: this.getAttr(),
1031 {name: "showClosed", label: "_showClosed".loc(), attr: "status", defaultKind: "XV.CheckboxWidget",
1032 getParameter: function () {
1034 if (!this.getValue()) {
1036 attribute: this.getAttr(),
1044 {name: "excludeProspects", label: "_excludeProspects".loc(), attr: "customer.status", defaultKind: "XV.CheckboxWidget",
1045 getParameter: function () {
1047 if (this.getValue()) {
1049 attribute: this.getAttr(),
1057 {name: "number", label: "_number".loc(), attr: "number"},
1058 {name: "salesRep", attr: "salesRep", label: "_salesRep".loc(), defaultKind: "XV.SalesRepPicker"},
1059 {kind: "onyx.GroupboxHeader", content: "_customer".loc()},
1060 {name: "customer", attr: "customer", label: "_customer".loc(), defaultKind: "XV.CustomerProspectWidget"},
1061 {name: "customerType", attr: "customer.customerType", label: "_customerType".loc(), defaultKind: "XV.CustomerTypePicker"},
1062 {name: "customerPurchaseOrderNumber", attr: "customerPurchaseOrderNumber",
1063 label: "_custPO".loc()},
1064 {kind: "onyx.GroupboxHeader", content: "_quoteDate".loc()},
1065 {name: "createdFromDate", label: "_fromDate".loc(),
1066 filterLabel: "_quoteDate".loc() + " " + "_fromDate".loc(),
1067 attr: "quoteDate", operator: ">=",
1068 defaultKind: "XV.DateWidget"},
1069 {name: "createdToDate", label: "_toDate".loc(),
1070 filterLabel: "_quoteDate".loc() + " " + "_toDate".loc(),
1071 attr: "quoteDate", operator: "<=",
1072 defaultKind: "XV.DateWidget"}
1076 // ..........................................................
1081 name: "XV.ReturnListParameters",
1082 kind: "XV.InvoiceListParameters",
1083 create: function () {
1084 this.inherited(arguments);
1085 // swap out the header text
1086 this.$.invoiceHeader.setContent("_return".loc());
1087 this.$.invoiceDateHeader.setContent("_returnDate".loc());
1088 // swap out date attribute
1089 this.$.fromDate.setAttr("returnDate");
1090 this.$.toDate.setAttr("returnDate");
1095 // ..........................................................
1100 name: "XV.SalesOrderListParameters",
1101 kind: "XV.ParameterWidget",
1103 {kind: "onyx.GroupboxHeader", content: "_quote".loc()},
1104 {name: "showClosed", label: "_showClosed".loc(), attr: "status", defaultKind: "XV.CheckboxWidget",
1105 getParameter: function () {
1107 if (!this.getValue()) {
1109 attribute: this.getAttr(),
1116 {name: "number", label: "_number".loc(), attr: "number"},
1117 {name: "salesRep", attr: "salesRep", label: "_salesRep".loc(), defaultKind: "XV.SalesRepPicker"},
1118 {kind: "onyx.GroupboxHeader", content: "_customer".loc()},
1119 {name: "customer", attr: "customer", label: "_customer".loc(), defaultKind: "XV.CustomerProspectWidget"},
1120 {name: "customerType", attr: "customer.customerType", label: "_customerType".loc(), defaultKind: "XV.CustomerTypePicker"},
1121 {name: "customerPurchaseOrderNumber", attr: "customerPurchaseOrderNumber",
1122 label: "_custPO".loc()},
1123 {kind: "onyx.GroupboxHeader", content: "_salesOrderDate".loc()},
1124 {name: "createdFromDate", label: "_fromDate".loc(),
1125 filterLabel: "_salesOrderDate".loc() + " " + "_fromDate".loc(),
1126 attr: "orderDate", operator: ">=",
1127 defaultKind: "XV.DateWidget"},
1128 {name: "createdToDate", label: "_toDate".loc(),
1129 filterLabel: "_orderDate".loc() + " " + "_toDate".loc(),
1130 attr: "orderDate", operator: "<=",
1131 defaultKind: "XV.DateWidget"}
1135 // ..........................................................
1140 name: "XV.SaleTypeListParameters",
1141 kind: "XV.ParameterWidget",
1143 {name: "isActive", attr: "isActive", label: "_showInactive".loc(), defaultKind: "XV.CheckboxWidget",
1144 getParameter: function () {
1146 if (!this.getValue()) {
1148 attribute: this.getAttr(),
1156 {kind: "onyx.GroupboxHeader", content: "_saleTypes".loc()},
1157 {name: "code", label: "_code".loc(), attr: "code"},
1158 {name: "description", label: "_description".loc(), attr: "description"}
1162 // ..........................................................
1167 name: "XV.SalesRepListParameters",
1168 kind: "XV.ParameterWidget",
1170 {name: "isActive", attr: "isActive", label: "_showInactive".loc(), defaultKind: "XV.CheckboxWidget",
1171 getParameter: function () {
1173 if (!this.getValue()) {
1175 attribute: this.getAttr(),
1183 {kind: "onyx.GroupboxHeader", content: "_salesRep".loc()},
1184 {name: "number", label: "_number".loc(), attr: "number"},
1185 {name: "name", label: "_name".loc(), attr: "name"},
1186 {name: "commission", label: "_commission".loc(), attr: "commission"}
1190 // ..........................................................
1195 name: "XV.SiteListParameters",
1196 kind: "XV.ParameterWidget",
1198 {name: "isActive", attr: "isActive", label: "_showInactive".loc(), defaultKind: "XV.CheckboxWidget",
1199 getParameter: function () {
1201 if (!this.getValue()) {
1203 attribute: this.getAttr(),
1211 {kind: "onyx.GroupboxHeader", content: "_site".loc()},
1212 {name: "code", label: "_code".loc(), attr: "code"}
1216 // ..........................................................
1221 name: "XV.ShiftListParameters",
1222 kind: "XV.ParameterWidget",
1224 {kind: "onyx.GroupboxHeader", content: "_shift".loc()},
1225 {name: "number", label: "_number".loc(), attr: "number"},
1226 {name: "name", label: "_code".loc(), attr: "name"}
1230 // ..........................................................
1235 name: "XV.ShipZoneListParameters",
1236 kind: "XV.ParameterWidget",
1238 {kind: "onyx.GroupboxHeader", content: "_shipZones".loc()},
1239 {name: "name", label: "_name".loc(), attr: "name"},
1240 {name: "description", label: "_description".loc(), attr: "description"}
1244 // ..........................................................
1249 name: "XV.SiteTypeListParameters",
1250 kind: "XV.ParameterWidget",
1252 {kind: "onyx.GroupboxHeader", content: "_siteType".loc()},
1253 {name: "name", label: "_name".loc(), attr: "name"}
1257 // ..........................................................
1262 name: "XV.TaxAssignmentListParameters",
1263 kind: "XV.ParameterWidget",
1265 {kind: "onyx.GroupboxHeader", content: "_taxAssignment".loc()},
1266 {name: "tax", label: "_tax".loc(), attr: "tax"},
1267 {name: "taxZone", label: "_taxZone".loc(), attr: "taxZone"},
1268 {name: "taxType", label: "_taxType".loc(), attr: "taxType"}
1272 // ..........................................................
1277 name: "XV.TaxAuthorityListParameters",
1278 kind: "XV.ParameterWidget",
1280 {kind: "onyx.GroupboxHeader", content: "_taxAuthority".loc()},
1281 {name: "code", label: "_code".loc(), attr: "code"},
1282 {name: "name", label: "_name".loc(), attr: "name"}
1287 // ..........................................................
1292 name: "XV.TaxCodeListParameters",
1293 kind: "XV.ParameterWidget",
1295 {kind: "onyx.GroupboxHeader", content: "_taxCode".loc()},
1296 {name: "code", label: "_code".loc(), attr: "code"},
1297 {name: "description", label: "_description".loc(), attr: "description"}
1301 // ..........................................................
1306 name: "XV.TaxClassListParameters",
1307 kind: "XV.ParameterWidget",
1309 {kind: "onyx.GroupboxHeader", content: "_taxClass".loc()},
1310 {name: "code", label: "_code".loc(), attr: "code"},
1311 {name: "description", label: "_description".loc(), attr: "description"}
1315 // ..........................................................
1320 name: "XV.TaxRateListParameters",
1321 kind: "XV.ParameterWidget",
1323 {kind: "onyx.GroupboxHeader", content: "_taxRate".loc()},
1324 {name: "tax", label: "_tax".loc(), attr: "tax.code"},
1325 {name: "percent", label: "_percent".loc(), attr: "percent"}
1329 // ..........................................................
1334 name: "XV.TaxTypeListParameters",
1335 kind: "XV.ParameterWidget",
1337 {kind: "onyx.GroupboxHeader", content: "_taxType".loc()},
1338 {name: "name", label: "_name".loc(), attr: "name"},
1339 {name: "description", label: "_description".loc(), attr: "description"}
1343 // ..........................................................
1348 name: "XV.TaxZoneListParameters",
1349 kind: "XV.ParameterWidget",
1351 {kind: "onyx.GroupboxHeader", content: "_taxZone".loc()},
1352 {name: "code", label: "_code".loc(), attr: "code"},
1353 {name: "description", label: "_description".loc(), attr: "description"}
1357 // ..........................................................
1362 name: "XV.TermsListParameters",
1363 kind: "XV.ParameterWidget",
1365 {kind: "onyx.GroupboxHeader", content: "_terms".loc()},
1366 {name: "code", label: "_code".loc(), attr: "code"},
1367 {name: "description", label: "_description".loc(), attr: "description"}
1371 // ..........................................................
1376 name: "XV.ToDoListParameters",
1377 kind: "XV.ParameterWidget",
1378 defaultParameters: function () {
1380 showInactive: false,
1381 user: XM.currentUser
1385 {kind: "onyx.GroupboxHeader", content: "_toDo".loc()},
1386 {name: "showInactive", label: "_showInactive".loc(), attr: "isActive", defaultKind: "XV.CheckboxWidget",
1387 getParameter: function () {
1389 if (!this.getValue()) {
1391 attribute: this.getAttr(),
1399 {name: "name", label: "_name".loc(), attr: "name"},
1400 {name: "description", label: "_description".loc(), attr: "description"},
1401 {kind: "onyx.GroupboxHeader", content: "_relationships".loc()},
1402 {name: "account", label: "_account".loc(), attr: "account", defaultKind: "XV.AccountWidget"},
1403 {name: "contact", label: "_contact".loc(), attr: "contact", defaultKind: "XV.ContactWidget"},
1404 {kind: "onyx.GroupboxHeader", content: "_userAccounts".loc()},
1405 {name: "owner", label: "_owner".loc(), attr: "owner", defaultKind: "XV.UserAccountWidget"},
1406 {name: "assignedTo", label: "_assignedTo".loc(), attr: "assignedTo", defaultKind: "XV.UserAccountWidget"},
1407 {name: "user", label: "_user".loc(), attr: ["owner.username", "assignedTo.username"], defaultKind: "XV.UserAccountWidget"},
1408 {kind: "onyx.GroupboxHeader", content: "_dueDate".loc()},
1409 {name: "fromDate", label: "_fromDate".loc(), attr: "dueDate", operator: ">=",
1410 filterLabel: "_from".loc() + " " + "_dueDate".loc() + " " + "_date".loc(),
1411 defaultKind: "XV.DateWidget"},
1412 {name: "toDate", label: "_toDate".loc(), attr: "dueDate", operator: "<=",
1413 filterLabel: "_to".loc() + " " + "_dueDate".loc() + " " + "_date".loc(),
1414 defaultKind: "XV.DateWidget"}
1418 // ..........................................................
1423 name: "XV.UrlListParameters",
1424 kind: "XV.ParameterWidget",
1426 {kind: "onyx.GroupboxHeader", content: "_url".loc()},
1427 {name: "name", label: "_name".loc(), attr: "name"},
1428 {name: "address", label: "_address".loc(), attr: "path"}
1432 // ..........................................................
1437 name: "XV.VendorListParameters",
1438 kind: "XV.ParameterWidget",
1440 {kind: "onyx.GroupboxHeader", content: "_vendor".loc()},
1441 {name: "isActive", attr: "isActive", label: "_showInactive".loc(), defaultKind: "XV.CheckboxWidget",
1442 getParameter: function () {
1444 if (!this.getValue()) {
1446 attribute: this.getAttr(),
1454 {name: "number", label: "_number".loc(), attr: "number"},
1455 {name: "name", label: "_name".loc(), attr: "name"},
1456 {name: "vendorType", attr: "vendorType.code", label: "_vendorType".loc(), defaultKind: "XV.VendorTypePicker"},
1457 {kind: "onyx.GroupboxHeader", content: "_contact".loc()},
1458 {name: "primaryEmail", label: "_primaryEmail".loc(), attr: "contact1.primaryEmail"},
1459 {name: "phone", label: "_phone".loc(), attr: ["contact1.phone", "contact1.alternate", "contact1.fax"]},
1460 {kind: "onyx.GroupboxHeader", content: "_address".loc()},
1461 {name: "street", label: "_street".loc(), attr: ["address.line1", "address.line2", "address.line3"]},
1462 {name: "city", label: "_city".loc(), attr: "address.city"},
1463 {name: "state", label: "_state".loc(), attr: "address.state"},
1464 {name: "postalCode", label: "_postalCode".loc(), attr: "address.postalCode"},
1465 {name: "country", label: "_country".loc(), attr: "address.country"}
1469 // ..........................................................
1474 name: "XV.VendorAddressParameters",
1475 kind: "XV.ParameterWidget",
1477 {kind: "onyx.GroupboxHeader", content: "_vendorAddress".loc()},
1478 {name: "vendor", label: "_vendor".loc(), attr: "vendor", defaultKind: "XV.VendorWidget"},
1479 {name: "code", label: "_code".loc(), attr: "code"},
1480 {name: "name", label: "_name".loc(), attr: "name"}