From aa1a7c2e1818720ca7336b0c803fc7049d7925bc Mon Sep 17 00:00:00 2001 From: Tim Otten Date: Wed, 21 May 2014 18:47:11 -0700 Subject: [PATCH] CRM-14725 - Implement "Save" button --- js/angular-crmCaseType.js | 6 +++++- partials/crmCaseType/edit.html | 1 + 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/js/angular-crmCaseType.js b/js/angular-crmCaseType.js index e66faf1251..c400ae61ff 100644 --- a/js/angular-crmCaseType.js +++ b/js/angular-crmCaseType.js @@ -29,7 +29,7 @@ }; }); - crmCaseType.controller('CaseTypeCtrl', function($scope) { + crmCaseType.controller('CaseTypeCtrl', function($scope, crmApi) { $scope.partialUrl = partialUrl; $scope.activityStatuses = CRM.crmCaseType.actStatuses; @@ -171,6 +171,10 @@ console.log($scope.caseType); }; + $scope.save = function() { + crmApi('CaseType', 'create', $scope.caseType, true); + }; + $scope.$watchCollection('caseType.definition.activitySets', function() { _.defer(function() { $('.crmCaseType-acttab').tabs('refresh'); diff --git a/partials/crmCaseType/edit.html b/partials/crmCaseType/edit.html index 8e7536ea82..eacbf5578c 100644 --- a/partials/crmCaseType/edit.html +++ b/partials/crmCaseType/edit.html @@ -46,4 +46,5 @@ Required vars: caseType + -- 2.25.1