Commit | Line | Data |
---|---|---|
22bc3e48 | 1 | <!-- |
aafc090b TO |
2 | Required vars: abtest, fields |
3 | ||
22bc3e48 TO |
4 | Note: Much of this file is duplicated in crmMailing and crmMailingAB with variations on placement/title/binding. |
5 | It could perhaps be thinned by 30-60% by making more directives. | |
aafc090b TO |
6 | |
7 | This template follows a basic pattern. For each included field, there are three variants, as in this example: | |
8 | - fromAddress: The default From: address shared by both mailings (representatively mapped to mailing A) | |
9 | - fromAddressA: The From: address for mailing A | |
10 | - fromAddressB: The From: address for mailing B | |
11 | Each variant is guarded with "ng-if='fields.fieldName'"; if true, the field will be displayed and | |
12 | processed by Angular; if false, the field will be hidden and completely ignored by Angular. | |
22bc3e48 TO |
13 | --> |
14 | <div class="crm-block" ng-form="subform" crm-ui-id-scope> | |
15 | <div class="crm-group"> | |
aafc090b TO |
16 | |
17 | ||
c4256f35 | 18 | <div crm-ui-field="{name: 'subform.msg_template_id', title: ts('Template')}" ng-if="fields.msg_template_id"> |
22bc3e48 TO |
19 | <div ng-controller="MsgTemplateCtrl"> |
20 | <select | |
21 | crm-ui-id="subform.msg_template_id" | |
22 | name="msg_template_id" | |
d93f9a50 | 23 | class="fa-clipboard" |
22bc3e48 TO |
24 | crm-ui-select="{dropdownAutoWidth : true, allowClear: true, placeholder: ts('Message Template')}" |
25 | ng-model="abtest.mailings.a.msg_template_id" | |
26 | ng-change="loadTemplate(abtest.mailings.a, abtest.mailings.a.msg_template_id)" | |
27 | > | |
28 | <option value=""></option> | |
29 | <option ng-repeat="frm in crmMsgTemplates.getAll() | orderBy:'msg_title'" ng-value="frm.id">{{frm.msg_title}}</option> | |
30 | </select> | |
77ec5a8d | 31 | <a crm-icon="fa-floppy-o" ng-click="saveTemplate(abtest.mailings.a)" class="crm-hover-button" title="{{ts('Save As')}}"></a> |
22bc3e48 TO |
32 | </div> |
33 | </div> | |
c4256f35 | 34 | <div crm-ui-field="{name: 'subform.msg_template_idA', title: ts('Template (A)')}" ng-if="fields.msg_template_idA"> |
aafc090b TO |
35 | <div ng-controller="MsgTemplateCtrl"> |
36 | <select | |
37 | crm-ui-id="subform.msg_template_idA" | |
38 | name="msg_template_idA" | |
d93f9a50 | 39 | class="fa-clipboard" |
aafc090b TO |
40 | crm-ui-select="{dropdownAutoWidth : true, allowClear: true, placeholder: ts('Message Template')}" |
41 | ng-model="abtest.mailings.a.msg_template_id" | |
42 | ng-change="loadTemplate(abtest.mailings.a, abtest.mailings.a.msg_template_id)" | |
43 | > | |
44 | <option value=""></option> | |
45 | <option ng-repeat="frm in crmMsgTemplates.getAll() | orderBy:'msg_title'" ng-value="frm.id">{{frm.msg_title}}</option> | |
46 | </select> | |
77ec5a8d | 47 | <a crm-icon="fa-floppy-o" ng-click="saveTemplate(abtest.mailings.a)" class="crm-hover-button" title="{{ts('Save As')}}"></a> |
aafc090b TO |
48 | </div> |
49 | </div> | |
c4256f35 | 50 | <div crm-ui-field="{name: 'subform.msg_template_idB', title: ts('Template (B)')}" ng-if="fields.msg_template_idB"> |
aafc090b TO |
51 | <div ng-controller="MsgTemplateCtrl"> |
52 | <select | |
53 | crm-ui-id="subform.msg_template_idB" | |
54 | name="msg_template_idB" | |
d93f9a50 | 55 | class="fa-clipboard" |
aafc090b TO |
56 | crm-ui-select="{dropdownAutoWidth : true, allowClear: true, placeholder: ts('Message Template')}" |
57 | ng-model="abtest.mailings.b.msg_template_id" | |
58 | ng-change="loadTemplate(abtest.mailings.b, abtest.mailings.b.msg_template_id)" | |
59 | > | |
60 | <option value=""></option> | |
61 | <option ng-repeat="frm in crmMsgTemplates.getAll() | orderBy:'msg_title'" ng-value="frm.id">{{frm.msg_title}}</option> | |
62 | </select> | |
77ec5a8d | 63 | <a crm-icon="fa-floppy-o" ng-click="saveTemplate(abtest.mailings.b)" class="crm-hover-button" title="{{ts('Save As')}}"></a> |
aafc090b TO |
64 | </div> |
65 | </div> | |
66 | ||
67 | ||
1ce7f3e4 | 68 | <div crm-ui-field="{name: 'subform.fromAddress', title: ts('From'), help: hs('from_email')}" ng-if="fields.fromAddress"> |
22bc3e48 TO |
69 | <span ng-controller="EmailAddrCtrl" crm-mailing-from-address="fromPlaceholder" crm-mailing="abtest.mailings.a"> |
70 | <select | |
71 | crm-ui-id="subform.fromAddress" | |
495f197a | 72 | crm-ui-select="{dropdownAutoWidth : true, allowClear: false, placeholder: ts('Email address')}" |
22bc3e48 | 73 | name="fromAddress" |
22bc3e48 | 74 | ng-model="fromPlaceholder.label" |
22bc3e48 TO |
75 | required> |
76 | <option value=""></option> | |
495f197a | 77 | <option ng-repeat="frm in crmFromAddresses.getAll() | filter:{is_active:1} | orderBy:'weight'" value="{{frm.label}}">{{frm.label}}</option> |
22bc3e48 TO |
78 | </select> |
79 | </span> | |
80 | </div> | |
1ce7f3e4 | 81 | <div crm-ui-field="{name: 'subform.fromAddressA', title: ts('From (A)'), help: hs('from_email')}" ng-if="fields.fromAddressA"> |
22bc3e48 TO |
82 | <span ng-controller="EmailAddrCtrl" crm-mailing-from-address="fromPlaceholder" crm-mailing="abtest.mailings.a"> |
83 | <select | |
84 | crm-ui-id="subform.fromAddressA" | |
495f197a | 85 | crm-ui-select="{dropdownAutoWidth : true, allowClear: false, placeholder: ts('Email address')}" |
22bc3e48 | 86 | name="fromAddressA" |
22bc3e48 | 87 | ng-model="fromPlaceholder.label" |
22bc3e48 TO |
88 | required> |
89 | <option value=""></option> | |
495f197a | 90 | <option ng-repeat="frm in crmFromAddresses.getAll() | filter:{is_active:1} | orderBy:'weight'" value="{{frm.label}}">{{frm.label}}</option> |
22bc3e48 TO |
91 | </select> |
92 | </span> | |
93 | </div> | |
1ce7f3e4 | 94 | <div crm-ui-field="{name: 'subform.fromAddressB', title: ts('From (B)'), help: hs('from_email')}" ng-if="fields.fromAddressB"> |
22bc3e48 TO |
95 | <span ng-controller="EmailAddrCtrl" crm-mailing-from-address="fromPlaceholder" crm-mailing="abtest.mailings.b"> |
96 | <select | |
97 | crm-ui-id="subform.fromAddressB" | |
495f197a | 98 | crm-ui-select="{dropdownAutoWidth : true, allowClear: false, placeholder: ts('Email address')}" |
22bc3e48 | 99 | name="fromAddressB" |
22bc3e48 | 100 | ng-model="fromPlaceholder.label" |
22bc3e48 TO |
101 | required> |
102 | <option value=""></option> | |
495f197a | 103 | <option ng-repeat="frm in crmFromAddresses.getAll() | filter:{is_active:1} | orderBy:'weight'" value="{{frm.label}}">{{frm.label}}</option> |
22bc3e48 TO |
104 | </select> |
105 | </span> | |
106 | </div> | |
aafc090b TO |
107 | |
108 | ||
c4256f35 | 109 | <div crm-ui-field="{name: 'subform.replyTo', title: ts('Reply-To')}" ng-show="crmMailingConst.enableReplyTo" ng-if="fields.replyTo"> |
22bc3e48 TO |
110 | <span ng-controller="EmailAddrCtrl"> |
111 | <select | |
112 | crm-ui-id="subform.replyTo" | |
495f197a | 113 | crm-ui-select="{dropdownAutoWidth : true, allowClear: true, placeholder: ts('Email address')}" |
22bc3e48 | 114 | name="replyTo" |
495f197a | 115 | ng-change="checkReplyToChange(abtest.mailings.a)" |
22bc3e48 | 116 | ng-model="abtest.mailings.a.replyto_email" |
22bc3e48 TO |
117 | > |
118 | <option value=""></option> | |
495f197a | 119 | <option ng-repeat="frm in crmFromAddresses.getAll() | filter:{is_active:1} | orderBy:'weight'" value="{{frm.label}}">{{frm.label}}</option> |
22bc3e48 TO |
120 | </select> |
121 | </span> | |
122 | </div> | |
c4256f35 | 123 | <div crm-ui-field="{name: 'subform.replyToA', title: ts('Reply-To (A)')}" ng-show="crmMailingConst.enableReplyTo" ng-if="fields.replyToA"> |
aafc090b TO |
124 | <span ng-controller="EmailAddrCtrl"> |
125 | <select | |
126 | crm-ui-id="subform.replyToA" | |
495f197a | 127 | crm-ui-select="{dropdownAutoWidth : true, allowClear: true, placeholder: ts('Email address')}" |
aafc090b | 128 | name="replyToA" |
495f197a | 129 | ng-change="checkReplyToChange(abtest.mailings.a)" |
aafc090b | 130 | ng-model="abtest.mailings.a.replyto_email" |
aafc090b TO |
131 | > |
132 | <option value=""></option> | |
495f197a | 133 | <option ng-repeat="frm in crmFromAddresses.getAll() | filter:{is_active:1} | orderBy:'weight'" value="{{frm.label}}">{{frm.label}}</option> |
aafc090b TO |
134 | </select> |
135 | </span> | |
136 | </div> | |
c4256f35 | 137 | <div crm-ui-field="{name: 'subform.replyToB', title: ts('Reply-To (B)')}" ng-show="crmMailingConst.enableReplyTo" ng-if="fields.replyToB"> |
aafc090b TO |
138 | <span ng-controller="EmailAddrCtrl"> |
139 | <select | |
140 | crm-ui-id="subform.replyToB" | |
495f197a | 141 | crm-ui-select="{dropdownAutoWidth : true, allowClear: true, placeholder: ts('Email address')}" |
aafc090b | 142 | name="replyToB" |
495f197a | 143 | ng-change="checkReplyToChange(abtest.mailings.b)" |
aafc090b | 144 | ng-model="abtest.mailings.b.replyto_email" |
aafc090b TO |
145 | > |
146 | <option value=""></option> | |
495f197a | 147 | <option ng-repeat="frm in crmFromAddresses.getAll() | filter:{is_active:1} | orderBy:'weight'" value="{{frm.label}}">{{frm.label}}</option> |
aafc090b TO |
148 | </select> |
149 | </span> | |
150 | </div> | |
151 | ||
152 | ||
c4256f35 | 153 | <div crm-ui-field="{name: 'subform.subject', title: ts('Subject')}" ng-if="fields.subject"> |
22bc3e48 | 154 | <div style="float: right;"> |
4476cb76 | 155 | <input crm-mailing-token on-select="$broadcast('insert:subject', token.name)" tabindex="-1"> |
22bc3e48 TO |
156 | </div> |
157 | <input | |
158 | crm-ui-id="subform.subject" | |
f8f85764 | 159 | crm-ui-insert-rx="insert:subject" |
22bc3e48 TO |
160 | type="text" |
161 | class="crm-form-text" | |
162 | ng-model="abtest.mailings.a.subject" | |
163 | required | |
164 | placeholder="Subject" | |
4476cb76 | 165 | name="subject" > |
22bc3e48 | 166 | </div> |
c4256f35 | 167 | <div crm-ui-field="{name: 'subform.subjectA', title: ts('Subject (A)')}" ng-if="fields.subjectA"> |
22bc3e48 | 168 | <div style="float: right;"> |
4476cb76 | 169 | <input crm-mailing-token on-select="$broadcast('insert:subjectA', token.name)" tabindex="-1"> |
22bc3e48 TO |
170 | </div> |
171 | <input | |
172 | crm-ui-id="subform.subjectA" | |
f8f85764 | 173 | crm-ui-insert-rx="insert:subjectA" |
22bc3e48 TO |
174 | type="text" |
175 | class="crm-form-text" | |
176 | ng-model="abtest.mailings.a.subject" | |
177 | required | |
178 | placeholder="Subject" | |
4476cb76 | 179 | name="subjectA" > |
22bc3e48 | 180 | </div> |
c4256f35 | 181 | <div crm-ui-field="{name: 'subform.subjectB', title: ts('Subject (B)')}" ng-if="fields.subjectB"> |
22bc3e48 | 182 | <div style="float: right;"> |
4476cb76 | 183 | <input crm-mailing-token on-select="$broadcast('insert:subjectB', token.name)" tabindex="-1"> |
22bc3e48 TO |
184 | </div> |
185 | <input | |
186 | crm-ui-id="subform.subjectB" | |
f8f85764 | 187 | crm-ui-insert-rx="insert:subjectB" |
22bc3e48 TO |
188 | type="text" |
189 | class="crm-form-text" | |
190 | ng-model="abtest.mailings.b.subject" | |
191 | required | |
192 | placeholder="Subject" | |
4476cb76 | 193 | name="subjectB" > |
22bc3e48 TO |
194 | </div> |
195 | </div> | |
196 | </div> |