From: Tim Otten Date: Mon, 26 May 2014 21:05:25 +0000 (-0700) Subject: CRM-14483 - crmCaseType - Support for adding relationship-types X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=8c7e0ae83b37d4a68a916350df5b5d783539533d;p=civicrm-core.git CRM-14483 - crmCaseType - Support for adding relationship-types --- diff --git a/CRM/Case/Info.php b/CRM/Case/Info.php index 7067b2b7cb..8bd728d2c7 100644 --- a/CRM/Case/Info.php +++ b/CRM/Case/Info.php @@ -68,11 +68,15 @@ class CRM_Case_Info extends CRM_Core_Component_Info { // Need full OptionValue records $actStatuses = civicrm_api3('OptionValue', 'get', array('option_group_id' => 'activity_status')); $actTypes = civicrm_api3('OptionValue', 'get', array('option_group_id' => 'activity_type')); + $relTypes = civicrm_api3('RelationshipType', 'get', array()); + CRM_Core_Resources::singleton()->addSetting(array( 'crmCaseType' => array( 'actStatuses' => array_values($actStatuses['values']), 'actTypes' => array_values($actTypes['values']), + 'relTypes' => array_values($relTypes['values']), //CRM_Core_PseudoConstant::activityType(TRUE, TRUE, FALSE, 'name'), + ), )); return $result; diff --git a/js/angular-crmCaseType.js b/js/angular-crmCaseType.js index 35037757b3..7f2fe2dc1b 100644 --- a/js/angular-crmCaseType.js +++ b/js/angular-crmCaseType.js @@ -61,6 +61,7 @@ $scope.activityStatuses = CRM.crmCaseType.actStatuses; $scope.activityTypes = CRM.crmCaseType.actTypes; $scope.activityTypeNames = _.pluck(CRM.crmCaseType.actTypes, 'name'); + $scope.relationshipTypeNames = _.pluck(CRM.crmCaseType.relTypes, 'label_b_a'); // label_b_a is CRM_Case_XMLProcessor::REL_TYPE_CNAME $scope.workflows = { 'timeline': 'Timeline', @@ -108,6 +109,13 @@ } }; + /// Add a new role + $scope.addRole = function(roles, roleName) { + roles.push({ + name: roleName + }); + }; + $scope.onManagerChange = function(managerRole) { angular.forEach($scope.caseType.definition.caseRoles, function(caseRole) { if (caseRole != managerRole) { diff --git a/partials/crmCaseType/rolesTable.html b/partials/crmCaseType/rolesTable.html index 52e63e178e..614c788075 100644 --- a/partials/crmCaseType/rolesTable.html +++ b/partials/crmCaseType/rolesTable.html @@ -23,4 +23,16 @@ Required vars: caseType + + + + +
+ + +