- selectedCaseType: function($route, crmApi) {
- if ( $route.current.params.id !== 'new') {
- return crmApi('CaseType', 'getsingle', {id: $route.current.params.id});
- }
- else {
- return { title: "", name: "", is_active: "1", weight: "1",
- definition: _.extend({}, newCaseTypeDefinitionTemplate) };
+ apiCalls: function($route, crmApi) {
+ var reqs = {};
+ reqs.actStatuses = ['OptionValue', 'get', {
+ option_group_id: 'activity_status'
+ }];
+ reqs.actTypes = ['OptionValue', 'get', {
+ option_group_id: 'activity_type',
+ options: {
+ sort: 'name',
+ limit: 0
+ }
+ }];
+ reqs.relTypes = ['RelationshipType', 'get', {
+ options: {
+ sort: CRM.crmCaseType.REL_TYPE_CNAME,
+ limit: 0
+ }
+ }];
+ if ($route.current.params.id !== 'new') {
+ reqs.caseType = ['CaseType', 'getsingle', {
+ id: $route.current.params.id
+ }];