Permalink
Browse files

issue #19735: Add customer specific relations for certain objects bec…

…ause backbone relational is now much more sensitive to names and relations being re-used in other places.
  • Loading branch information...
1 parent 31ced7e commit 87bd438e23a4519715978b4fc52afc3926e9dba7 John Rogelstad committed Mar 16, 2013
@@ -1524,9 +1524,9 @@ trailing:true white:true*/
{kind: "onyx.GroupboxHeader", content: "_overview".loc()},
{kind: "XV.ScrollableGroupbox", name: "mainGroup", fit: true,
classes: "in-panel", components: [
- {kind: "XV.CheckboxWidget", attr: "isActive"},
{kind: "XV.InputWidget", attr: "name"},
{kind: "XV.InputWidget", attr: "description"},
+ {kind: "XV.CheckboxWidget", attr: "isActive"},
{kind: "XV.PriorityPicker", attr: "priority"},
{kind: "onyx.GroupboxHeader", content: "_schedule".loc()},
{kind: "XV.DateWidget", attr: "dueDate"},
@@ -0,0 +1,67 @@
+/*jshint indent:2, curly:true eqeqeq:true, immed:true, latedef:true,
+newcap:true, noarg:true, regexp:true, undef:true, strict:true, trailing:true
+white:true*/
+/*global XT:true, XM:true, Backbone:true, _:true, console:true */
+
+(function () {
+ "use strict";
+
+ XT.extensions.crm.initCustomerModels = function () {
+ /**
+ @class
+
+ @extends XM.Model
+ */
+ XM.CustomerContactRelation = XM.Info.extend(
+ /** @scope XM.CustomerContactRelation.prototype */ {
+
+ recordType: 'XM.CustomerContactRelation',
+
+ editableModel: 'XM.Contact'
+
+ });
+
+ /**
+ @class
+
+ @extends XM.Model
+ */
+ XM.CustomerToDoRelation = XM.Info.extend(
+ /** @scope XM.CustomerToDoRelation.prototype */ {
+
+ recordType: 'XM.CustomerToDoRelation',
+
+ editableModel: 'XM.ToDo'
+
+ });
+
+ /**
+ @class
+
+ @extends XM.Model
+ */
+ XM.CustomerIncidentRelation = XM.Info.extend(
+ /** @scope XM.CustomerIncidentRelation.prototype */ {
+
+ recordType: 'XM.CustomerIncidentRelation',
+
+ editableModel: 'XM.Incident'
+
+ });
+
+ /**
+ @class
+
+ @extends XM.Model
+ */
+ XM.CustomerOpportunityRelation = XM.Info.extend(
+ /** @scope XM.CustomerOpportunityRelation.prototype */ {
+
+ recordType: 'XM.CustomerOpportunityRelation',
+
+ editableModel: 'XM.Opportunity'
+
+ });
+ };
+
+}());
@@ -3,6 +3,7 @@ depends(
"configure.js",
"account.js",
"contact.js",
+ "customer.js",
"incident.js",
"opportunity.js",
"to_do.js",
@@ -115,6 +115,11 @@ trailing:true white:true*/
];
XV.appendExtension("XV.CustomerWorkspace", extensions);
+
+ XV.registerModelWorkspace("XM.CustomerContactRelation", "XV.ContactWorkspace");
+ XV.registerModelWorkspace("XM.CustomerIncidentRelation", "XV.IncidentWorkspace");
+ XV.registerModelWorkspace("XM.CustomerOpportunityRelation", "XV.OpportunityWorkspace");
+ XV.registerModelWorkspace("XM.CustomerToDoRelation", "XV.ToDoWorkspace");
// ..........................................................
// INCIDENT
@@ -156,67 +156,6 @@
{
"context": "crm",
"nameSpace": "XM",
- "type": "Customer",
- "table": "crmacct",
- "isExtension": true,
- "isChild": true,
- "comment": "Extended by Crm",
- "relations": [
- {
- "column": "crmacct_cust_id",
- "inverse": "id"
- }
- ],
- "properties": [
- {
- "name": "account",
- "attr": {
- "type": "Number",
- "column": "crmacct_id"
- }
- },
- {
- "name": "contactRelations",
- "toMany": {
- "isNested": true,
- "type": "ContactRelation",
- "column": "crmacct_id",
- "inverse": "account"
- }
- },
- {
- "name": "incidentRelations",
- "toMany": {
- "isNested": true,
- "type": "IncidentRelation",
- "column": "crmacct_id",
- "inverse": "account"
- }
- },
- {
- "name": "opportunityRelations",
- "toMany": {
- "isNested": true,
- "type": "OpportunityRelation",
- "column": "crmacct_id",
- "inverse": "account"
- }
- },
- {
- "name": "toDoRelations",
- "toMany": {
- "isNested": true,
- "type": "ToDoRelation",
- "column": "crmacct_id",
- "inverse": "account"
- }
- }
- ],
- "isSystem": true
- },
- {
- "context": "crm",
- "nameSpace": "XM",
"type": "ToDo",
"table": "todoitem",
"isExtension": true,
Oops, something went wrong.

0 comments on commit 87bd438

Please sign in to comment.