From 5d973e24e301b910645afd368bab97c87a4a23f0 Mon Sep 17 00:00:00 2001 From: Tim Otten Date: Wed, 7 May 2014 15:04:32 -0700 Subject: [PATCH] CRM-14483 - Only allow addition of "Sequence" if we don't have a sequence already --- js/angular-crmCaseType.js | 12 ++++++++++++ partials/crmCaseType/edit.html | 4 ++-- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/js/angular-crmCaseType.js b/js/angular-crmCaseType.js index fbb319a2ab..ecaa871968 100644 --- a/js/angular-crmCaseType.js +++ b/js/angular-crmCaseType.js @@ -96,6 +96,18 @@ } }; + $scope.isNewActivitySetAllowed = function(workflow) { + switch (workflow) { + case 'timeline': + return true; + case 'pipeline': + return 0 == _.where($scope.caseType.definition.activitySets, {pipeline: '1'}).length; + default: + if (console && console.log) console.log('Denied access to unrecognized workflow: (' + workflow + ')'); + return false; + } + }; + $scope.getWorkflowName = function(activitySet) { var result = 'Unknown'; _.each($scope.workflows, function(value, key) { diff --git a/partials/crmCaseType/edit.html b/partials/crmCaseType/edit.html index 9a27e3f1d6..8e7536ea82 100644 --- a/partials/crmCaseType/edit.html +++ b/partials/crmCaseType/edit.html @@ -26,8 +26,8 @@ Required vars: caseType -- 2.25.1