}
};
+ $scope.isForkable = function() {
+ return !$scope.caseType.id || $scope.caseType.is_forkable
+ };
+
$scope.isNewActivitySetAllowed = function(workflow) {
switch (workflow) {
case 'timeline':
};
$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) {
<div ng-include="partialUrl('caseTypeDetails.html')"></div>
- <h2>Roles</h2>
+ <h2 ng-show="isForkable()">Roles</h2>
- <div ng-include="partialUrl('rolesTable.html')"></div>
+ <div ng-show="isForkable()" ng-include="partialUrl('rolesTable.html')"></div>
- <h2>Activities</h2>
+ <h2 ng-show="isForkable()">Activities</h2>
- <div class="crmCaseType-acttab" ui-jq="tabs" ui-options="{show: true, hide: true}">
+ <div ng-show="isForkable()" class="crmCaseType-acttab" ui-jq="tabs" ui-options="{show: true, hide: true}">
<ul>
<li><a href="#acttab-actType">Activity Types</a></li>
<li ng-repeat="activitySet in caseType.definition.activitySets">