Fixes the following issues with case type management:
authorRené Olivo <minet.ws@gmail.com>
Sat, 11 Aug 2018 23:17:23 +0000 (23:17 +0000)
committerRené Olivo <minet.ws@gmail.com>
Thu, 20 Sep 2018 02:21:41 +0000 (02:21 +0000)
* When selecting default assignees by relationships, it will only display active relationship types.
* It also handles activity types that have been deleted. Without taking this into consideration,
the screen would break if it encounters a missing activity type.

ang/crmCaseType.js

index 12500df6154ca3eab8d5f03e7d4cc6e2cd042ed1..9540bb065c32d96a38f41f72f70daf17e7bccc7b 100644 (file)
@@ -76,6 +76,7 @@
             }];
             reqs.relTypes = ['RelationshipType', 'get', {
               sequential: 1,
+              is_active: 1,
               options: {
                 sort: CRM.crmCaseType.REL_TYPE_CNAME,
                 limit: 0
       _.each($scope.caseType.definition.activitySets, function (set) {
         _.each(set.activityTypes, function (type, name) {
           var isDefaultAssigneeTypeUndefined = _.isUndefined(type.default_assignee_type);
-          type.label = $scope.activityTypes[type.name].label;
+          var typeDefinition = $scope.activityTypes[type.name];
+          type.label = (typeDefinition && typeDefinition.label) || type.name;
 
           if (isDefaultAssigneeTypeUndefined) {
             type.default_assignee_type = defaultAssigneeDefaultValue.value;