From b40b41145c6925a347580f50d0100cb9ae2b1320 Mon Sep 17 00:00:00 2001 From: Tim Otten Date: Tue, 12 Aug 2014 00:07:49 -0700 Subject: [PATCH] CRM-15097 - crmCaseType - If a case-type isn't forkable, then don't allow editing of its definition. --- js/angular-crmCaseType.js | 8 ++++++++ partials/crmCaseType/edit.html | 8 ++++---- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/js/angular-crmCaseType.js b/js/angular-crmCaseType.js index 8f579356b1..3238260a7a 100644 --- a/js/angular-crmCaseType.js +++ b/js/angular-crmCaseType.js @@ -216,6 +216,10 @@ } }; + $scope.isForkable = function() { + return !$scope.caseType.id || $scope.caseType.is_forkable + }; + $scope.isNewActivitySetAllowed = function(workflow) { switch (workflow) { case 'timeline': @@ -280,6 +284,10 @@ }; $scope.$watch('locks.caseTypeName', updateCaseTypeName); $scope.$watch('caseType.title', updateCaseTypeName); + + if (!$scope.isForkable()) { + CRM.alert(ts('The CiviCase XML file for this case-type prohibits editing the definition.')); + } }); crmCaseType.controller('CaseTypeListCtrl', function($scope, crmApi, caseTypes) { diff --git a/partials/crmCaseType/edit.html b/partials/crmCaseType/edit.html index 8fed0ebed4..987223201c 100644 --- a/partials/crmCaseType/edit.html +++ b/partials/crmCaseType/edit.html @@ -15,13 +15,13 @@ Required vars: caseType
-

Roles

+

Roles

-
+
-

Activities

+

Activities

-
+