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 | ||
22bc3e48 TO |
18 | <div crm-ui-field="subform.msg_template_id" crm-title="ts('Template')" style="background: #bbf; width:100%; padding: 0.1em;" ng-if="fields.msg_template_id"> |
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> | |
30 | <a ng-click="saveTemplate(abtest.mailings.a)" class="crm-hover-button action-item" title="{{ts('Save As')}}"><span class="icon ui-icon-disk"></span></a> | |
31 | </div> | |
32 | </div> | |
aafc090b TO |
33 | <div crm-ui-field="subform.msg_template_idA" crm-title="ts('Template (A)')" style="background: #bbf; width:100%; padding: 0.1em;" ng-if="fields.msg_template_idA"> |
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> | |
45 | <a ng-click="saveTemplate(abtest.mailings.a)" class="crm-hover-button action-item" title="{{ts('Save As')}}"><span class="icon ui-icon-disk"></span></a> | |
46 | </div> | |
47 | </div> | |
48 | <div crm-ui-field="subform.msg_template_idB" crm-title="ts('Template (B)')" style="background: #bbf; width:100%; padding: 0.1em;" ng-if="fields.msg_template_idB"> | |
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> | |
60 | <a ng-click="saveTemplate(abtest.mailings.b)" class="crm-hover-button action-item" title="{{ts('Save As')}}"><span class="icon ui-icon-disk"></span></a> | |
61 | </div> | |
62 | </div> | |
63 | ||
64 | ||
22bc3e48 TO |
65 | <div crm-ui-field="subform.fromAddress" crm-title="ts('From')" ng-if="fields.fromAddress"> |
66 | <span ng-controller="EmailAddrCtrl" crm-mailing-from-address="fromPlaceholder" crm-mailing="abtest.mailings.a"> | |
67 | <select | |
68 | crm-ui-id="subform.fromAddress" | |
69 | name="fromAddress" | |
70 | ui-jq="select2" | |
71 | ui-options="{dropdownAutoWidth : true, allowClear: false, placeholder: ts('Email address')}" | |
72 | ng-model="fromPlaceholder.label" | |
73 | ng-options="frm.label as frm.label for frm in crmFromAddresses.getAll() | filter:{is_active:1} | orderBy:'weight'" | |
74 | required> | |
75 | <option value=""></option> | |
76 | </select> | |
77 | </span> | |
78 | </div> | |
79 | <div crm-ui-field="subform.fromAddressA" crm-title="ts('From (A)')" ng-if="fields.fromAddressA"> | |
80 | <span ng-controller="EmailAddrCtrl" crm-mailing-from-address="fromPlaceholder" crm-mailing="abtest.mailings.a"> | |
81 | <select | |
82 | crm-ui-id="subform.fromAddressA" | |
83 | name="fromAddressA" | |
84 | ui-jq="select2" | |
85 | ui-options="{dropdownAutoWidth : true, allowClear: false, placeholder: ts('Email address')}" | |
86 | ng-model="fromPlaceholder.label" | |
87 | ng-options="frm.label as frm.label for frm in crmFromAddresses.getAll() | filter:{is_active:1} | orderBy:'weight'" | |
88 | required> | |
89 | <option value=""></option> | |
90 | </select> | |
91 | </span> | |
92 | </div> | |
93 | <div crm-ui-field="subform.fromAddressB" crm-title="ts('From (B)')" ng-if="fields.fromAddressB"> | |
94 | <span ng-controller="EmailAddrCtrl" crm-mailing-from-address="fromPlaceholder" crm-mailing="abtest.mailings.b"> | |
95 | <select | |
96 | crm-ui-id="subform.fromAddressB" | |
97 | name="fromAddressB" | |
98 | ui-jq="select2" | |
99 | ui-options="{dropdownAutoWidth : true, allowClear: false, placeholder: ts('Email address')}" | |
100 | ng-model="fromPlaceholder.label" | |
101 | ng-options="frm.label as frm.label for frm in crmFromAddresses.getAll() | filter:{is_active:1} | orderBy:'weight'" | |
102 | required> | |
103 | <option value=""></option> | |
104 | </select> | |
105 | </span> | |
106 | </div> | |
aafc090b TO |
107 | |
108 | ||
22bc3e48 TO |
109 | <div crm-ui-field="subform.replyTo" crm-title="ts('Reply-To')" ng-show="crmMailingConst.enableReplyTo" ng-if="fields.replyTo"> |
110 | <span ng-controller="EmailAddrCtrl"> | |
111 | <select | |
112 | crm-ui-id="subform.replyTo" | |
113 | name="replyTo" | |
114 | ui-jq="select2" | |
115 | ui-options="{dropdownAutoWidth : true, allowClear: true, placeholder: ts('Email address')}" | |
116 | ng-model="abtest.mailings.a.replyto_email" | |
117 | ng-options="frm.label as frm.label for frm in crmFromAddresses.getAll() | filter:{is_active:1} | orderBy:'weight'" | |
118 | > | |
119 | <option value=""></option> | |
120 | </select> | |
121 | </span> | |
122 | </div> | |
aafc090b TO |
123 | <div crm-ui-field="subform.replyToA" crm-title="ts('Reply-To (A)')" ng-show="crmMailingConst.enableReplyTo" ng-if="fields.replyToA"> |
124 | <span ng-controller="EmailAddrCtrl"> | |
125 | <select | |
126 | crm-ui-id="subform.replyToA" | |
127 | name="replyToA" | |
128 | ui-jq="select2" | |
129 | ui-options="{dropdownAutoWidth : true, allowClear: true, placeholder: ts('Email address')}" | |
130 | ng-model="abtest.mailings.a.replyto_email" | |
131 | ng-options="frm.label as frm.label for frm in crmFromAddresses.getAll() | filter:{is_active:1} | orderBy:'weight'" | |
132 | > | |
133 | <option value=""></option> | |
134 | </select> | |
135 | </span> | |
136 | </div> | |
137 | <div crm-ui-field="subform.replyToB" crm-title="ts('Reply-To (B)')" ng-show="crmMailingConst.enableReplyTo" ng-if="fields.replyToB"> | |
138 | <span ng-controller="EmailAddrCtrl"> | |
139 | <select | |
140 | crm-ui-id="subform.replyToB" | |
141 | name="replyToB" | |
142 | ui-jq="select2" | |
143 | ui-options="{dropdownAutoWidth : true, allowClear: true, placeholder: ts('Email address')}" | |
144 | ng-model="abtest.mailings.b.replyto_email" | |
145 | ng-options="frm.label as frm.label for frm in crmFromAddresses.getAll() | filter:{is_active:1} | orderBy:'weight'" | |
146 | > | |
147 | <option value=""></option> | |
148 | </select> | |
149 | </span> | |
150 | </div> | |
151 | ||
152 | ||
22bc3e48 TO |
153 | <div crm-ui-field="subform.subject" crm-title="ts('Subject')" ng-if="fields.subject"> |
154 | <div style="float: right;"> | |
3cc9c048 | 155 | <input crm-mailing-token crm-for="subform.subject" /> |
22bc3e48 TO |
156 | </div> |
157 | <input | |
158 | crm-ui-id="subform.subject" | |
159 | type="text" | |
160 | class="crm-form-text" | |
161 | ng-model="abtest.mailings.a.subject" | |
162 | required | |
163 | placeholder="Subject" | |
164 | name="subject" /> | |
165 | </div> | |
166 | <div crm-ui-field="subform.subjectA" crm-title="ts('Subject (A)')" ng-if="fields.subjectA"> | |
167 | <div style="float: right;"> | |
3cc9c048 | 168 | <input crm-mailing-token crm-for="subform.subjectA" /> |
22bc3e48 TO |
169 | </div> |
170 | <input | |
171 | crm-ui-id="subform.subjectA" | |
172 | type="text" | |
173 | class="crm-form-text" | |
174 | ng-model="abtest.mailings.a.subject" | |
175 | required | |
176 | placeholder="Subject" | |
177 | name="subjectA" /> | |
178 | </div> | |
179 | <div crm-ui-field="subform.subjectB" crm-title="ts('Subject (B)')" ng-if="fields.subjectB"> | |
180 | <div style="float: right;"> | |
3cc9c048 | 181 | <input crm-mailing-token crm-for="subform.subjectB" /> |
22bc3e48 TO |
182 | </div> |
183 | <input | |
184 | crm-ui-id="subform.subjectB" | |
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> |