X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=js%2Fangular-crmCaseType.js;h=c7cfd6570e7fc53f02820168510ee921705eb801;hb=a20ef478f8872a281aaf56dac32c780769c95617;hp=d9504a7943d86d0a8b0827df4c997bb9a059e377;hpb=35520f2fe451af60d257213acf58d2afd5249123;p=civicrm-core.git diff --git a/js/angular-crmCaseType.js b/js/angular-crmCaseType.js index d9504a7943..c7cfd6570e 100644 --- a/js/angular-crmCaseType.js +++ b/js/angular-crmCaseType.js @@ -14,7 +14,11 @@ weight: "1", definition: { activityTypes: [ - {name: 'Open Case', max_instances: 1 } + {name: 'Open Case', max_instances: 1}, + {name: 'Email'}, + {name: 'Follow up'}, + {name: 'Meeting'}, + {name: 'Phone Call'} ], activitySets: [ { @@ -129,7 +133,7 @@ $scope.activityTypes = apiCalls.actTypes.values; $scope.activityTypeNames = _.pluck(apiCalls.actTypes.values, 'name'); $scope.relationshipTypeNames = _.pluck(apiCalls.relTypes.values, CRM.crmCaseType.REL_TYPE_CNAME); // CRM_Case_XMLProcessor::REL_TYPE_CNAME - $scope.locks = {caseTypeName: true}; + $scope.locks = {caseTypeName: true, activitySetName: true}; $scope.workflows = { 'timeline': 'Timeline', @@ -227,11 +231,19 @@ case 'sequence': return 0 == _.where($scope.caseType.definition.activitySets, {sequence: '1'}).length; default: - if (console && console.log) console.log('Denied access to unrecognized workflow: (' + workflow + ')'); + CRM.console('warn', 'Denied access to unrecognized workflow: (' + workflow + ')'); return false; } }; + $scope.isActivityRemovable = function(activitySet, activity) { + if (activitySet.name == 'standard_timeline' && activity.name == 'Open Case') { + return false; + } else { + return true; + } + }; + $scope.isValidName = function(name) { return !name || name.match(/^[a-zA-Z0-9_]+$/); }; @@ -332,4 +344,4 @@ }; }); -})(angular, CRM.$, CRM._); \ No newline at end of file +})(angular, CRM.$, CRM._);