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" | |
23 | crm-ui-select="{dropdownAutoWidth : true, allowClear: true, placeholder: ts('Message Template')}" | |
24 | ng-model="abtest.mailings.a.msg_template_id" | |
25 | ng-change="loadTemplate(abtest.mailings.a, abtest.mailings.a.msg_template_id)" | |
26 | > | |
27 | <option value=""></option> | |
28 | <option ng-repeat="frm in crmMsgTemplates.getAll() | orderBy:'msg_title'" ng-value="frm.id">{{frm.msg_title}}</option> | |
29 | </select> | |
77ec5a8d | 30 | <a crm-icon="fa-floppy-o" ng-click="saveTemplate(abtest.mailings.a)" class="crm-hover-button" title="{{ts('Save As')}}"></a> |
22bc3e48 TO |
31 | </div> |
32 | </div> | |
c4256f35 | 33 | <div crm-ui-field="{name: 'subform.msg_template_idA', title: ts('Template (A)')}" ng-if="fields.msg_template_idA"> |
aafc090b TO |
34 | <div ng-controller="MsgTemplateCtrl"> |
35 | <select | |
36 | crm-ui-id="subform.msg_template_idA" | |
37 | name="msg_template_idA" | |
38 | crm-ui-select="{dropdownAutoWidth : true, allowClear: true, placeholder: ts('Message Template')}" | |
39 | ng-model="abtest.mailings.a.msg_template_id" | |
40 | ng-change="loadTemplate(abtest.mailings.a, abtest.mailings.a.msg_template_id)" | |
41 | > | |
42 | <option value=""></option> | |
43 | <option ng-repeat="frm in crmMsgTemplates.getAll() | orderBy:'msg_title'" ng-value="frm.id">{{frm.msg_title}}</option> | |
44 | </select> | |
77ec5a8d | 45 | <a crm-icon="fa-floppy-o" ng-click="saveTemplate(abtest.mailings.a)" class="crm-hover-button" title="{{ts('Save As')}}"></a> |
aafc090b TO |
46 | </div> |
47 | </div> | |
c4256f35 | 48 | <div crm-ui-field="{name: 'subform.msg_template_idB', title: ts('Template (B)')}" ng-if="fields.msg_template_idB"> |
aafc090b TO |
49 | <div ng-controller="MsgTemplateCtrl"> |
50 | <select | |
51 | crm-ui-id="subform.msg_template_idB" | |
52 | name="msg_template_idB" | |
53 | crm-ui-select="{dropdownAutoWidth : true, allowClear: true, placeholder: ts('Message Template')}" | |
54 | ng-model="abtest.mailings.b.msg_template_id" | |
55 | ng-change="loadTemplate(abtest.mailings.b, abtest.mailings.b.msg_template_id)" | |
56 | > | |
57 | <option value=""></option> | |
58 | <option ng-repeat="frm in crmMsgTemplates.getAll() | orderBy:'msg_title'" ng-value="frm.id">{{frm.msg_title}}</option> | |
59 | </select> | |
77ec5a8d | 60 | <a crm-icon="fa-floppy-o" ng-click="saveTemplate(abtest.mailings.b)" class="crm-hover-button" title="{{ts('Save As')}}"></a> |
aafc090b TO |
61 | </div> |
62 | </div> | |
63 | ||
64 | ||
1ce7f3e4 | 65 | <div crm-ui-field="{name: 'subform.fromAddress', title: ts('From'), help: hs('from_email')}" ng-if="fields.fromAddress"> |
22bc3e48 TO |
66 | <span ng-controller="EmailAddrCtrl" crm-mailing-from-address="fromPlaceholder" crm-mailing="abtest.mailings.a"> |
67 | <select | |
68 | crm-ui-id="subform.fromAddress" | |
495f197a | 69 | crm-ui-select="{dropdownAutoWidth : true, allowClear: false, placeholder: ts('Email address')}" |
22bc3e48 | 70 | name="fromAddress" |
22bc3e48 | 71 | ng-model="fromPlaceholder.label" |
22bc3e48 TO |
72 | required> |
73 | <option value=""></option> | |
495f197a | 74 | <option ng-repeat="frm in crmFromAddresses.getAll() | filter:{is_active:1} | orderBy:'weight'" value="{{frm.label}}">{{frm.label}}</option> |
22bc3e48 TO |
75 | </select> |
76 | </span> | |
77 | </div> | |
1ce7f3e4 | 78 | <div crm-ui-field="{name: 'subform.fromAddressA', title: ts('From (A)'), help: hs('from_email')}" ng-if="fields.fromAddressA"> |
22bc3e48 TO |
79 | <span ng-controller="EmailAddrCtrl" crm-mailing-from-address="fromPlaceholder" crm-mailing="abtest.mailings.a"> |
80 | <select | |
81 | crm-ui-id="subform.fromAddressA" | |
495f197a | 82 | crm-ui-select="{dropdownAutoWidth : true, allowClear: false, placeholder: ts('Email address')}" |
22bc3e48 | 83 | name="fromAddressA" |
22bc3e48 | 84 | ng-model="fromPlaceholder.label" |
22bc3e48 TO |
85 | required> |
86 | <option value=""></option> | |
495f197a | 87 | <option ng-repeat="frm in crmFromAddresses.getAll() | filter:{is_active:1} | orderBy:'weight'" value="{{frm.label}}">{{frm.label}}</option> |
22bc3e48 TO |
88 | </select> |
89 | </span> | |
90 | </div> | |
1ce7f3e4 | 91 | <div crm-ui-field="{name: 'subform.fromAddressB', title: ts('From (B)'), help: hs('from_email')}" ng-if="fields.fromAddressB"> |
22bc3e48 TO |
92 | <span ng-controller="EmailAddrCtrl" crm-mailing-from-address="fromPlaceholder" crm-mailing="abtest.mailings.b"> |
93 | <select | |
94 | crm-ui-id="subform.fromAddressB" | |
495f197a | 95 | crm-ui-select="{dropdownAutoWidth : true, allowClear: false, placeholder: ts('Email address')}" |
22bc3e48 | 96 | name="fromAddressB" |
22bc3e48 | 97 | ng-model="fromPlaceholder.label" |
22bc3e48 TO |
98 | required> |
99 | <option value=""></option> | |
495f197a | 100 | <option ng-repeat="frm in crmFromAddresses.getAll() | filter:{is_active:1} | orderBy:'weight'" value="{{frm.label}}">{{frm.label}}</option> |
22bc3e48 TO |
101 | </select> |
102 | </span> | |
103 | </div> | |
aafc090b TO |
104 | |
105 | ||
c4256f35 | 106 | <div crm-ui-field="{name: 'subform.replyTo', title: ts('Reply-To')}" ng-show="crmMailingConst.enableReplyTo" ng-if="fields.replyTo"> |
22bc3e48 TO |
107 | <span ng-controller="EmailAddrCtrl"> |
108 | <select | |
109 | crm-ui-id="subform.replyTo" | |
495f197a | 110 | crm-ui-select="{dropdownAutoWidth : true, allowClear: true, placeholder: ts('Email address')}" |
22bc3e48 | 111 | name="replyTo" |
495f197a | 112 | ng-change="checkReplyToChange(abtest.mailings.a)" |
22bc3e48 | 113 | ng-model="abtest.mailings.a.replyto_email" |
22bc3e48 TO |
114 | > |
115 | <option value=""></option> | |
495f197a | 116 | <option ng-repeat="frm in crmFromAddresses.getAll() | filter:{is_active:1} | orderBy:'weight'" value="{{frm.label}}">{{frm.label}}</option> |
22bc3e48 TO |
117 | </select> |
118 | </span> | |
119 | </div> | |
c4256f35 | 120 | <div crm-ui-field="{name: 'subform.replyToA', title: ts('Reply-To (A)')}" ng-show="crmMailingConst.enableReplyTo" ng-if="fields.replyToA"> |
aafc090b TO |
121 | <span ng-controller="EmailAddrCtrl"> |
122 | <select | |
123 | crm-ui-id="subform.replyToA" | |
495f197a | 124 | crm-ui-select="{dropdownAutoWidth : true, allowClear: true, placeholder: ts('Email address')}" |
aafc090b | 125 | name="replyToA" |
495f197a | 126 | ng-change="checkReplyToChange(abtest.mailings.a)" |
aafc090b | 127 | ng-model="abtest.mailings.a.replyto_email" |
aafc090b TO |
128 | > |
129 | <option value=""></option> | |
495f197a | 130 | <option ng-repeat="frm in crmFromAddresses.getAll() | filter:{is_active:1} | orderBy:'weight'" value="{{frm.label}}">{{frm.label}}</option> |
aafc090b TO |
131 | </select> |
132 | </span> | |
133 | </div> | |
c4256f35 | 134 | <div crm-ui-field="{name: 'subform.replyToB', title: ts('Reply-To (B)')}" ng-show="crmMailingConst.enableReplyTo" ng-if="fields.replyToB"> |
aafc090b TO |
135 | <span ng-controller="EmailAddrCtrl"> |
136 | <select | |
137 | crm-ui-id="subform.replyToB" | |
495f197a | 138 | crm-ui-select="{dropdownAutoWidth : true, allowClear: true, placeholder: ts('Email address')}" |
aafc090b | 139 | name="replyToB" |
495f197a | 140 | ng-change="checkReplyToChange(abtest.mailings.b)" |
aafc090b | 141 | ng-model="abtest.mailings.b.replyto_email" |
aafc090b TO |
142 | > |
143 | <option value=""></option> | |
495f197a | 144 | <option ng-repeat="frm in crmFromAddresses.getAll() | filter:{is_active:1} | orderBy:'weight'" value="{{frm.label}}">{{frm.label}}</option> |
aafc090b TO |
145 | </select> |
146 | </span> | |
147 | </div> | |
148 | ||
149 | ||
c4256f35 | 150 | <div crm-ui-field="{name: 'subform.subject', title: ts('Subject')}" ng-if="fields.subject"> |
22bc3e48 | 151 | <div style="float: right;"> |
617b1b16 | 152 | <input crm-mailing-token on-select="$broadcast('insert:subject', token.name)" tabindex="-1"/> |
22bc3e48 TO |
153 | </div> |
154 | <input | |
155 | crm-ui-id="subform.subject" | |
f8f85764 | 156 | crm-ui-insert-rx="insert:subject" |
22bc3e48 TO |
157 | type="text" |
158 | class="crm-form-text" | |
159 | ng-model="abtest.mailings.a.subject" | |
160 | required | |
161 | placeholder="Subject" | |
162 | name="subject" /> | |
163 | </div> | |
c4256f35 | 164 | <div crm-ui-field="{name: 'subform.subjectA', title: ts('Subject (A)')}" ng-if="fields.subjectA"> |
22bc3e48 | 165 | <div style="float: right;"> |
617b1b16 | 166 | <input crm-mailing-token on-select="$broadcast('insert:subjectA', token.name)" tabindex="-1"/> |
22bc3e48 TO |
167 | </div> |
168 | <input | |
169 | crm-ui-id="subform.subjectA" | |
f8f85764 | 170 | crm-ui-insert-rx="insert:subjectA" |
22bc3e48 TO |
171 | type="text" |
172 | class="crm-form-text" | |
173 | ng-model="abtest.mailings.a.subject" | |
174 | required | |
175 | placeholder="Subject" | |
176 | name="subjectA" /> | |
177 | </div> | |
c4256f35 | 178 | <div crm-ui-field="{name: 'subform.subjectB', title: ts('Subject (B)')}" ng-if="fields.subjectB"> |
22bc3e48 | 179 | <div style="float: right;"> |
617b1b16 | 180 | <input crm-mailing-token on-select="$broadcast('insert:subjectB', token.name)" tabindex="-1"/> |
22bc3e48 TO |
181 | </div> |
182 | <input | |
183 | crm-ui-id="subform.subjectB" | |
f8f85764 | 184 | crm-ui-insert-rx="insert:subjectB" |
22bc3e48 TO |
185 | type="text" |
186 | class="crm-form-text" | |
187 | ng-model="abtest.mailings.b.subject" | |
188 | required | |
189 | placeholder="Subject" | |
190 | name="subjectB" /> | |
191 | </div> | |
192 | </div> | |
193 | </div> |