var uidCount = 0;
- var partialUrl = function (relPath) {
- return '~/crmUi/' + relPath;
- };
-
angular.module('crmUi', [])
// example <div crm-ui-accordion crm-title="ts('My Title')" crm-collapsed="true">...content...</div>
.directive('crmUiField', function() {
// Note: When writing new templates, the "label" position is particular. See/patch "var label" below.
var templateUrls = {
- default: partialUrl('field.html'),
- checkbox: partialUrl('field-cb.html')
+ default: '~/crmUi/field.html',
+ checkbox: '~/crmUi/field-cb.html'
};
return {
scope: {
crmUiTabSet: '@'
},
- templateUrl: partialUrl('tabset.html'),
+ templateUrl: '~/crmUi/tabset.html',
transclude: true,
controllerAs: 'crmUiTabSetCtrl',
controller: function($scope, $parse) {
scope: {
crmUiWizard: '@'
},
- templateUrl: partialUrl('wizard.html'),
+ templateUrl: '~/crmUi/wizard.html',
transclude: true,
controllerAs: 'crmUiWizardCtrl',
controller: function($scope, $parse) {
/// crmFile: Manage file attachments
(function (angular, $, _) {
- var partialUrl = function (relPath) {
- return '~/crmAttachment/' + relPath;
- };
angular.module('crmAttachment', ['angularFileUpload']);
var model = $parse(attr.crmAttachments);
scope.att = model(scope.$parent);
scope.ts = CRM.ts(null);
- scope.inclUrl = partialUrl('attachments.html');
+ scope.inclUrl = '~/crmAttachment/attachments.html';
// delay rendering of child tree until after model has been populated
scope.ready = true;
(function(angular, $, _) {
- var partialUrl = function(relPath) {
- return '~/crmCaseType/' + relPath;
- };
-
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!
crmCaseType.config(['$routeProvider',
function($routeProvider) {
$routeProvider.when('/caseType', {
- templateUrl: partialUrl('list.html'),
+ templateUrl: '~/crmCaseType/list.html',
controller: 'CaseTypeListCtrl',
resolve: {
caseTypes: function($route, crmApi) {
}
});
$routeProvider.when('/caseType/:id', {
- templateUrl: partialUrl('edit.html'),
+ templateUrl: '~/crmCaseType/edit.html',
controller: 'CaseTypeCtrl',
resolve: {
apiCalls: function($route, crmApi) {
});
crmCaseType.controller('CaseTypeCtrl', function($scope, crmApi, apiCalls) {
- $scope.partialUrl = partialUrl;
var ts = $scope.ts = CRM.ts(null);
$scope.activityStatuses = _.values(apiCalls.actStatuses.values);
*/
$scope.activityTableTemplate = function(activitySet) {
if (activitySet.timeline) {
- return partialUrl('timelineTable.html');
+ return '~/crmCaseType/timelineTable.html';
} else if (activitySet.sequence) {
- return partialUrl('sequenceTable.html');
+ return '~/crmCaseType/sequenceTable.html';
} else {
return '';
}
(function (angular, $, _) {
- var partialUrl = function partialUrl(relPath) {
- return '~/crmMailing/' + relPath;
- };
angular.module('crmMailing', [
'crmUtil', 'crmAttachment', 'ngRoute', 'ui.utils', 'crmUi', 'dialogService'
});
var editorPaths = {
- '': partialUrl('edit.html'),
- '/unified': partialUrl('edit-unified.html'),
- '/unified2': partialUrl('edit-unified2.html'),
- '/wizard': partialUrl('edit-wizard.html')
+ '': '~/crmMailing/edit.html',
+ '/unified': '~/crmMailing/edit-unified.html',
+ '/unified2': '~/crmMailing/edit-unified2.html',
+ '/wizard': '~/crmMailing/edit-wizard.html'
};
angular.forEach(editorPaths, function(editTemplate, pathSuffix) {
$routeProvider.when('/mailing/new' + pathSuffix, {
$scope.attachments.load();
$scope.crmMailingConst = CRM.crmMailing;
- $scope.partialUrl = partialUrl;
var ts = $scope.ts = CRM.ts(null);
$scope.isSubmitted = function isSubmitted() {
1: $scope.getRecipientsEstimate()
})
};
- dialogService.open('recipDialog', partialUrl('dialog/recipients.html'), model, options);
+ dialogService.open('recipDialog', '~/crmMailing/dialog/recipients.html', model, options);
};
});
modal: true,
title: title // component[0].name
};
- dialogService.open('previewComponentDialog', partialUrl('dialog/previewComponent.html'), component[0], options);
+ dialogService.open('previewComponentDialog', '~/crmMailing/dialog/previewComponent.html', component[0], options);
};
});
modal: true,
title: ts('Save Template')
};
- return dialogService.open('saveTemplateDialog', partialUrl('dialog/saveTemplate.html'), model, options)
+ return dialogService.open('saveTemplateDialog', '~/crmMailing/dialog/saveTemplate.html', model, options)
.then(function (item) {
mailing.msg_template_id = item.id;
return item;
(function (angular, $, _) {
- var partialUrl = function (relPath) {
- return '~/crmMailing/' + relPath;
- };
// The following directives have the same simple implementation -- load
// a template and export a "mailing" object into scope.
var simpleBlocks = {
- crmMailingBlockHeaderFooter: partialUrl('headerFooter.html'),
- crmMailingBlockMailing: partialUrl('mailing.html'),
- crmMailingBlockPublication: partialUrl('publication.html'),
- crmMailingBlockResponses: partialUrl('responses.html'),
- crmMailingBlockRecipients: partialUrl('recipients.html'),
- crmMailingBlockSchedule: partialUrl('schedule.html'),
- crmMailingBlockSummary: partialUrl('summary.html'),
- crmMailingBlockTracking: partialUrl('tracking.html'),
- crmMailingBodyHtml: partialUrl('body_html.html'),
- crmMailingBodyText: partialUrl('body_text.html')
+ crmMailingBlockHeaderFooter: '~/crmMailing/headerFooter.html',
+ crmMailingBlockMailing: '~/crmMailing/mailing.html',
+ crmMailingBlockPublication: '~/crmMailing/publication.html',
+ crmMailingBlockResponses: '~/crmMailing/responses.html',
+ crmMailingBlockRecipients: '~/crmMailing/recipients.html',
+ crmMailingBlockSchedule: '~/crmMailing/schedule.html',
+ crmMailingBlockSummary: '~/crmMailing/summary.html',
+ crmMailingBlockTracking: '~/crmMailing/tracking.html',
+ crmMailingBodyHtml: '~/crmMailing/body_html.html',
+ crmMailingBodyText: '~/crmMailing/body_text.html'
};
_.each(simpleBlocks, function(templateUrl, directiveName){
angular.module('crmMailing').directive(directiveName, function ($parse) {
// note: the directive defines a variable called "preview" with any inputs supplied by the user (e.g. the target recipient for an example mailing)
angular.module('crmMailing').directive('crmMailingBlockPreview', function ($parse) {
return {
- templateUrl: partialUrl('preview.html'),
+ templateUrl: '~/crmMailing/preview.html',
link: function (scope, elm, attr) {
var mailingModel = $parse(attr.crmMailing);
scope.mailing = mailingModel(scope);
scope: {
crmMailing: '@'
},
- templateUrl: partialUrl('review.html'),
+ templateUrl: '~/crmMailing/review.html',
link: function (scope, elm, attr) {
var mailingModel = $parse(attr.crmMailing);
scope.mailing = mailingModel(scope.$parent);
crmAvailMailings: '@', // available mailings
crmMailing: '@' // the mailing for which we are choosing recipients
},
- templateUrl: partialUrl('directive/recipients.html'),
+ templateUrl: '~/crmMailing/directive/recipients.html',
link: function (scope, element, attrs) {
scope.mailing = scope.$parent.$eval(attrs.crmMailing);
scope.groups = scope.$parent.$eval(attrs.crmAvailGroups);
(function (angular, $, _) {
- var partialUrl = function (relPath) {
- return '~/crmMailing/' + relPath;
- };
// The representation of from/reply-to addresses is inconsistent in the mailing data-model,
// so the UI must do some adaptation. The crmFromAddresses provides a richer way to slice/dice
// @return Promise
preview: function preview(mailing, mode) {
var templates = {
- html: partialUrl('dialog/previewHtml.html'),
- text: partialUrl('dialog/previewText.html'),
- full: partialUrl('dialog/previewFull.html')
+ html: '~/crmMailing/dialog/previewHtml.html',
+ text: '~/crmMailing/dialog/previewText.html',
+ full: '~/crmMailing/dialog/previewFull.html'
};
var result = null;
var p = crmMailingMgr
(function (angular, $, _) {
- var partialUrl = function (relPath, module) {
- if (!module) {
- module = 'crmMailingAB';
- }
- return '~/' + module + '/' + relPath;
- };
-
angular.module('crmMailingAB', ['ngRoute', 'ui.utils', 'ngSanitize', 'crmUi', 'crmAttachment', 'crmMailing', 'crmD3']);
angular.module('crmMailingAB').config([
'$routeProvider',
function ($routeProvider) {
$routeProvider.when('/abtest', {
- templateUrl: partialUrl('list.html'),
+ templateUrl: '~/crmMailingAB/list.html',
controller: 'CrmMailingABListCtrl',
resolve: {
mailingABList: function ($route, crmApi) {
}
});
$routeProvider.when('/abtest/:id', {
- templateUrl: partialUrl('edit.html'),
+ templateUrl: '~/crmMailingAB/edit.html',
controller: 'CrmMailingABEditCtrl',
resolve: {
abtest: function ($route, CrmMailingAB) {
}
});
$routeProvider.when('/abtest/:id/report', {
- templateUrl: partialUrl('report.html'),
+ templateUrl: '~/crmMailingAB/report.html',
controller: 'CrmMailingABReportCtrl',
resolve: {
abtest: function ($route, CrmMailingAB) {
var ts = $scope.ts = CRM.ts(null);
$scope.crmMailingABCriteria = crmMailingABCriteria;
$scope.crmMailingConst = CRM.crmMailing;
- $scope.partialUrl = partialUrl;
$scope.isSubmitted = function isSubmitted() {
return _.size(abtest.mailings.a.jobs) > 0 || _.size(abtest.mailings.b.jobs) > 0;
1: mailingName.toUpperCase()
})
};
- return dialogService.open('selectWinnerDialog', partialUrl('selectWinner.html'), model, options);
+ return dialogService.open('selectWinnerDialog', '~/crmMailingAB/selectWinner.html', model, options);
};
});
(function (angular, $, _) {
- var partialUrl = function (relPath) {
- return '~/crmMailingAB/' + relPath;
- };
// example:
// scope.myAbtest = new CrmMailingAB();
// <crm-mailing-ab-block-mailing="{fromAddressA: 1, fromAddressB: 1}" crm-abtest="myAbtest" />
var simpleDirectives = {
- crmMailingAbBlockMailing: partialUrl('joint-mailing.html'),
- crmMailingAbBlockSetup: partialUrl('setup.html')
+ crmMailingAbBlockMailing: '~/crmMailingAB/joint-mailing.html',
+ crmMailingAbBlockSetup: '~/crmMailingAB/setup.html'
};
_.each(simpleDirectives, function (templateUrl, directiveName) {
angular.module('crmMailingAB').directive(directiveName, function ($parse, crmMailingABCriteria) {
return {
require: '?ngModel',
scope: {},
- templateUrl: partialUrl('slider.html'),
+ templateUrl: '~/crmMailingAB/slider.html',
link: function (scope, element, attrs, ngModel) {
var TEST_MIN = 1, TEST_MAX = 50;
var sliders = $('.slider-test,.slider-win', element);
</span>
</div>
- <div ng-include="partialUrl('caseTypeDetails.html')"></div>
+ <div ng-include="'~/crmCaseType/caseTypeDetails.html'"></div>
<h2 ng-show="isForkable()">Roles</h2>
- <div ng-show="isForkable()" ng-include="partialUrl('rolesTable.html')"></div>
+ <div ng-show="isForkable()" ng-include="'~/crmCaseType/rolesTable.html'"></div>
<h2 ng-show="isForkable()">Activities</h2>
</ul>
<div id="acttab-actType">
- <div ng-include="partialUrl('activityTypesTable.html')"></div>
+ <div ng-include="'~/crmCaseType/activityTypesTable.html'"></div>
</div>
<div ng-repeat="activitySet in caseType.definition.activitySets" id="acttab-{{$index}}">
<div class="crm-accordion-wrapper collapsed">
<div class="crm-accordion-header">Advanced</div>
- <div class="crm-accordion-body" ng-include="partialUrl('activitySetDetails.html')"></div>
+ <div class="crm-accordion-body" ng-include="'~/crmCaseType/activitySetDetails.html'"></div>
</div>
</div>
</div>
</span>
</div>
</div>
-</form>
\ No newline at end of file
+</form>