Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Issue 19453: Changed QuoteStatus to a mix-in in the Quote model.

  • Loading branch information...
commit 06758b0f04bb33da8382f2b3fa2b6ed56ae1b863 1 parent b5a5533
Linda Nichols authored
View
38 enyo-client/application/source/models/quote.js
@@ -5,6 +5,27 @@ white:true*/
(function () {
"use strict";
+
+ /**
+ @namespace
+
+ A mixin shared by project models that share common project status
+ functionality.
+ */
+ XM.QuoteStatus = {
+ /** @scope XM.ProjectStatus */
+
+ /**
+ Returns project status as a localized string.
+
+ @returns {String}
+ */
+ getProjectStatusString: function () {
+ var K = XM.Quote,
+ status = this.get("status");
+ return status === K.OPEN_STATUS ? "_open".loc() : "_closed".loc();
+ }
+ };
/**
@class
@@ -492,17 +513,6 @@ white:true*/
},
/**
- Returns quote status as a localized string.
-
- @returns {String}
- */
- getQuoteStatusString: function () {
- var K = this.getClass(),
- status = this.get("status");
- return status === K.OPEN_STATUS ? "_open".loc() : "_closed".loc();
- },
-
- /**
If the user changed the freight determine whether they want the automatic calculation
turned on or off as a result of their change. This function will trigger a `notify` call
asking the question, which must be answered via the attached callback to complete the process.
@@ -818,6 +828,9 @@ white:true*/
}
});
+
+ // Add in quote status mixin
+ XM.Quote = XM.Quote.extend(XM.QuoteStatus);
// ..........................................................
// CLASS METHODS
@@ -1752,6 +1765,9 @@ white:true*/
}
});
+
+ // Add in quote status mixin
+ XM.QuoteListItem = XM.QuoteListItem.extend(XM.QuoteStatus);
/**
@class
View
12 enyo-client/application/source/widgets/parameter.js
@@ -545,27 +545,27 @@ trailing:true white:true*/
return param;
}
},
- {name: "excludeProspects", label: "_excludeProspects".loc(), attr: "customer.status", defaultKind: "XV.CheckboxWidget",
+ {name: "showClosed", label: "_showClosed".loc(), attr: "status", defaultKind: "XV.CheckboxWidget",
getParameter: function () {
var param;
- if (this.getValue()) {
+ if (!this.getValue()) {
param = {
attribute: this.getAttr(),
operator: '!=',
- value: "P"
+ value: 'C'
};
}
return param;
}
},
- {name: "showClosed", label: "_showClosed".loc(), attr: "status", defaultKind: "XV.CheckboxWidget",
+ {name: "excludeProspects", label: "_excludeProspects".loc(), attr: "customer.status", defaultKind: "XV.CheckboxWidget",
getParameter: function () {
var param;
- if (!this.getValue()) {
+ if (this.getValue()) {
param = {
attribute: this.getAttr(),
operator: '!=',
- value: 'C'
+ value: "P"
};
}
return param;
Please sign in to comment.
Something went wrong with that request. Please try again.