projects
/
civicrm-core.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
test failure fix2
[civicrm-core.git]
/
js
/
angular-crmCaseType.js
diff --git
a/js/angular-crmCaseType.js
b/js/angular-crmCaseType.js
index d27c9655e55af073b551bfeda55cce4d7d69f025..f8ae9551485c1dc873472ecf6a9b5ea8111264ab 100644
(file)
--- a/
js/angular-crmCaseType.js
+++ b/
js/angular-crmCaseType.js
@@
-1,10
+1,10
@@
(function(angular, $, _) {
var partialUrl = function(relPath) {
(function(angular, $, _) {
var partialUrl = function(relPath) {
- return CRM.resourceUrls
['civicrm']
+ '/partials/crmCaseType/' + relPath;
+ return CRM.resourceUrls
.civicrm
+ '/partials/crmCaseType/' + relPath;
};
};
- var crmCaseType = angular.module('crmCaseType', ['ngRoute', 'ui.utils', 'crmUi', 'unsavedChanges']);
+ var crmCaseType = angular.module('crmCaseType', ['ngRoute', 'ui.utils', 'crmUi', 'unsavedChanges'
, 'crmUtil'
]);
// Note: This template will be passed to cloneDeep(), so don't put any funny stuff in here!
var newCaseTypeTemplate = {
// Note: This template will be passed to cloneDeep(), so don't put any funny stuff in here!
var newCaseTypeTemplate = {
@@
-222,7
+222,7
@@
};
$scope.isForkable = function() {
};
$scope.isForkable = function() {
- return !$scope.caseType.id || $scope.caseType.is_forkable
+ return !$scope.caseType.id || $scope.caseType.is_forkable
;
};
$scope.isNewActivitySetAllowed = function(workflow) {
};
$scope.isNewActivitySetAllowed = function(workflow) {
@@
-230,7
+230,7
@@
case 'timeline':
return true;
case 'sequence':
case 'timeline':
return true;
case 'sequence':
- return 0 == _.where($scope.caseType.definition.activitySets, {sequence: '1'}).length;
+ return 0 ==
=
_.where($scope.caseType.definition.activitySets, {sequence: '1'}).length;
default:
CRM.console('warn', 'Denied access to unrecognized workflow: (' + workflow + ')');
return false;
default:
CRM.console('warn', 'Denied access to unrecognized workflow: (' + workflow + ')');
return false;
@@
-278,8
+278,8
@@
$scope.save = function() {
var result = crmApi('CaseType', 'create', $scope.caseType, true);
$scope.save = function() {
var result = crmApi('CaseType', 'create', $scope.caseType, true);
- result.
success
(function(data) {
- if (data.is_error ==
0
) {
+ result.
then
(function(data) {
+ if (data.is_error ==
= 0 || data.is_error == '0'
) {
$scope.caseType.id = data.id;
window.location.href = '#/caseType';
}
$scope.caseType.id = data.id;
window.location.href = '#/caseType';
}