(function(angular, $, _) {
- var partialsUrl = CRM.resourceUrls['civicrm'] + '/partials/crmCaseType';
+ var partialUrl = function(relPath) {
+ return CRM.resourceUrls['civicrm'] + '/partials/crmCaseType/' + relPath;
+ } ;
+
var crmCaseType = angular.module('crmCaseType', ['ngRoute', 'ui.utils']);
crmCaseType.config(['$routeProvider',
function($routeProvider) {
$routeProvider.when('/caseType/:id', {
- templateUrl: partialsUrl + '/edit.html',
+ templateUrl: partialUrl('edit.html'),
controller: 'CaseTypeCtrl'
});
}
]);
crmCaseType.controller('CaseTypeCtrl', function($scope) {
- $scope.partialsUrl = partialsUrl;
+ $scope.partialUrl = partialUrl;
$scope.workflows = {
'timeline': 'Timeline',
*/
$scope.activityTableTemplate = function(activitySet) {
if (activitySet.timeline) {
- return partialsUrl + '/timelineTable.html';
+ return partialUrl('timelineTable.html');
} else if (activitySet.pipeline) {
- return partialsUrl + '/pipelineTable.html';
+ return partialUrl('pipelineTable.html');
} else {
return '';
}
Required vars: caseType
-->
<div class="crm-block crm-form-block crmCaseType">
- <div ng-include="partialsUrl + '/caseTypeDetails.html'"></div>
+ <div ng-include="partialUrl('caseTypeDetails.html')"></div>
<h2>Roles</h2>
- <div ng-include="partialsUrl + '/rolesTable.html'"></div>
+ <div ng-include="partialUrl('rolesTable.html')"></div>
<h2>Activities</h2>
</ul>
<div id="acttab-actType">
- <div ng-include="partialsUrl + '/activityTypesTable.html'"></div>
+ <div ng-include="partialUrl('activityTypesTable.html')"></div>
</div>
<div ng-repeat="activitySet in caseType.definition.activitySets" id="acttab-{{$index}}">
<div ui-jq="accordion" ui-options="{collapsible: true, active: false, heightStyle: 'fill'}">
<h3>Advanced</h3>
- <div ng-include="partialsUrl + '/activitySetDetails.html'" style="display:none;"></div>
+ <div ng-include="partialUrl('activitySetDetails.html')" style="display:none;"></div>
</div>
</div>
</div>