This repository has been archived on 2026-07-19. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
espocrm-base/application/Espo/Modules/Crm/Resources/metadata/entityDefs/Call.json
T
2018-10-29 11:44:12 +02:00

241 lines
7.8 KiB
JSON

{
"fields": {
"name": {
"type": "varchar",
"required": true,
"trim": true
},
"status": {
"type": "enum",
"options": ["Planned", "Held", "Not Held"],
"default": "Planned",
"view": "views/fields/enum-styled",
"style": {
"Held": "success"
},
"audited": true
},
"dateStart": {
"type": "datetime",
"required": true,
"default": "javascript: return this.dateTime.getNow(15);",
"audited": true
},
"dateEnd": {
"type": "datetime",
"required": true,
"after": "dateStart"
},
"duration": {
"type": "duration",
"start": "dateStart",
"end": "dateEnd",
"options": [300, 600, 900, 1800, 2700, 3600, 7200],
"default": 300,
"notStorable": true,
"select": "TIMESTAMPDIFF(SECOND, call.date_start, call.date_end)",
"orderBy": "duration {direction}"
},
"reminders": {
"type": "jsonArray",
"notStorable": true,
"view": "crm:views/meeting/fields/reminders",
"layoutListDisabled": true
},
"direction": {
"type": "enum",
"options": ["Outbound", "Inbound"],
"default": "Outbound"
},
"description": {
"type": "text"
},
"parent": {
"type": "linkParent",
"entityList": ["Account", "Lead", "Contact", "Opportunity", "Case"]
},
"account": {
"type": "link",
"readOnly": true
},
"acceptanceStatus": {
"type": "enum",
"notStorable": true,
"options": ["None", "Accepted", "Tentative", "Declined"],
"layoutDetailDisabled": true,
"layoutMassUpdateDisabled": true,
"where": {
"=": {
"leftJoins": ["users", "contacts", "leads"],
"sql": "contactsMiddle.status = {value} OR leadsMiddle.status = {value} OR usersMiddle.status = {value}",
"distinct": true
},
"<>": "call.id NOT IN (SELECT call_id FROM call_contact WHERE deleted = 0 AND status = {value}) AND call.id NOT IN (SELECT call_id FROM call_user WHERE deleted = 0 AND status = {value}) AND call.id NOT IN (SELECT call_id FROM call_lead WHERE deleted = 0 AND status = {value})",
"IN": {
"leftJoins": ["users", "leads", "contacts"],
"sql": "contactsMiddle.status IN {value} OR leadsMiddle.status IN {value} OR usersMiddle.status IN {value}",
"distinct": true
},
"NOT IN": "call.id NOT IN (SELECT call_id FROM call_contact WHERE deleted = 0 AND status IN {value}) AND call.id NOT IN (SELECT call_id FROM call_user WHERE deleted = 0 AND status IN {value}) AND call.id NOT IN (SELECT call_id FROM call_lead WHERE deleted = 0 AND status IN {value})",
"IS NULL": {
"leftJoins": ["users", "contacts", "leads"],
"sql": "contactsMiddle.status IS NULL AND leadsMiddle.status IS NULL AND usersMiddle.status IS NULL",
"distinct": true
},
"IS NOT NULL": "call.id NOT IN (SELECT call_id FROM call_contact WHERE deleted = 0 AND status IS NULL) OR call.id NOT IN (SELECT call_id FROM call_user WHERE deleted = 0 AND status IS NULL) OR call.id NOT IN (SELECT call_id FROM call_lead WHERE deleted = 0 AND status IS NULL)"
},
"view": "crm:views/meeting/fields/acceptance-status"
},
"users": {
"type": "linkMultiple",
"layoutDetailDisabled": true,
"layoutListDisabled": true,
"view": "crm:views/meeting/fields/users",
"columns": {
"status": "acceptanceStatus"
},
"additionalAttributeList": ["columns"],
"orderBy": "name"
},
"contacts": {
"type": "linkMultiple",
"layoutDetailDisabled": true,
"layoutListDisabled": true,
"view": "crm:views/call/fields/contacts",
"columns": {
"status": "acceptanceStatus"
},
"additionalAttributeList": ["columns"],
"orderBy": "name"
},
"leads": {
"type": "linkMultiple",
"layoutDetailDisabled": true,
"layoutListDisabled": true,
"view": "crm:views/call/fields/leads",
"columns": {
"status": "acceptanceStatus"
},
"additionalAttributeList": ["columns"],
"orderBy": "name"
},
"createdAt": {
"type": "datetime",
"readOnly": true
},
"modifiedAt": {
"type": "datetime",
"readOnly": true
},
"createdBy": {
"type": "link",
"readOnly": true,
"view": "views/fields/user"
},
"modifiedBy": {
"type": "link",
"readOnly": true,
"view": "views/fields/user"
},
"phoneNumbersMap": {
"type": "jsonObject",
"notStorable": true,
"disabled": true
},
"assignedUser": {
"type": "link",
"required": true,
"view": "views/fields/assigned-user"
},
"teams": {
"type": "linkMultiple",
"view": "views/fields/teams"
}
},
"links": {
"account": {
"type": "belongsTo",
"entity": "Account"
},
"createdBy": {
"type": "belongsTo",
"entity": "User"
},
"modifiedBy": {
"type": "belongsTo",
"entity": "User"
},
"assignedUser": {
"type": "belongsTo",
"entity": "User"
},
"teams": {
"type": "hasMany",
"entity": "Team",
"relationName": "entityTeam",
"layoutRelationshipsDisabled": true
},
"users": {
"type": "hasMany",
"entity": "User",
"foreign": "calls",
"additionalColumns": {
"status": {
"type": "varchar",
"len": "36",
"default": "None"
}
}
},
"contacts": {
"type": "hasMany",
"entity": "Contact",
"foreign": "calls",
"additionalColumns": {
"status": {
"type": "varchar",
"len": "36",
"default": "None"
}
}
},
"leads": {
"type": "hasMany",
"entity": "Lead",
"foreign": "calls",
"additionalColumns": {
"status": {
"type": "varchar",
"len": "36",
"default": "None"
}
}
},
"parent": {
"type": "belongsToParent",
"foreign": "calls"
}
},
"collection": {
"orderBy": "dateStart",
"order": "desc"
},
"indexes": {
"dateStartStatus": {
"columns": ["dateStart", "status"]
},
"dateStart": {
"columns": ["dateStart", "deleted"]
},
"status": {
"columns": ["status", "deleted"]
},
"assignedUser": {
"columns": ["assignedUserId", "deleted"]
},
"assignedUserStatus": {
"columns": ["assignedUserId", "status"]
}
}
}