<!--
-Required vars: abtest
+Required vars: abtest, fields
+
Note: Much of this file is duplicated in crmMailing and crmMailingAB with variations on placement/title/binding.
It could perhaps be thinned by 30-60% by making more directives.
+
+This template follows a basic pattern. For each included field, there are three variants, as in this example:
+ - fromAddress: The default From: address shared by both mailings (representatively mapped to mailing A)
+ - fromAddressA: The From: address for mailing A
+ - fromAddressB: The From: address for mailing B
+Each variant is guarded with "ng-if='fields.fieldName'"; if true, the field will be displayed and
+processed by Angular; if false, the field will be hidden and completely ignored by Angular.
-->
<div class="crm-block" ng-form="subform" crm-ui-id-scope>
<div class="crm-group">
+
+
<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">
<div ng-controller="MsgTemplateCtrl">
<select
<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>
</div>
</div>
+ <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">
+ <div ng-controller="MsgTemplateCtrl">
+ <select
+ crm-ui-id="subform.msg_template_idA"
+ name="msg_template_idA"
+ crm-ui-select="{dropdownAutoWidth : true, allowClear: true, placeholder: ts('Message Template')}"
+ ng-model="abtest.mailings.a.msg_template_id"
+ ng-change="loadTemplate(abtest.mailings.a, abtest.mailings.a.msg_template_id)"
+ >
+ <option value=""></option>
+ <option ng-repeat="frm in crmMsgTemplates.getAll() | orderBy:'msg_title'" ng-value="frm.id">{{frm.msg_title}}</option>
+ </select>
+ <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>
+ </div>
+ </div>
+ <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">
+ <div ng-controller="MsgTemplateCtrl">
+ <select
+ crm-ui-id="subform.msg_template_idB"
+ name="msg_template_idB"
+ crm-ui-select="{dropdownAutoWidth : true, allowClear: true, placeholder: ts('Message Template')}"
+ ng-model="abtest.mailings.b.msg_template_id"
+ ng-change="loadTemplate(abtest.mailings.b, abtest.mailings.b.msg_template_id)"
+ >
+ <option value=""></option>
+ <option ng-repeat="frm in crmMsgTemplates.getAll() | orderBy:'msg_title'" ng-value="frm.id">{{frm.msg_title}}</option>
+ </select>
+ <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>
+ </div>
+ </div>
+
+
<div crm-ui-field="subform.fromAddress" crm-title="ts('From')" ng-if="fields.fromAddress">
<span ng-controller="EmailAddrCtrl" crm-mailing-from-address="fromPlaceholder" crm-mailing="abtest.mailings.a">
<select
</select>
</span>
</div>
+
+
<div crm-ui-field="subform.replyTo" crm-title="ts('Reply-To')" ng-show="crmMailingConst.enableReplyTo" ng-if="fields.replyTo">
<span ng-controller="EmailAddrCtrl">
<select
</select>
</span>
</div>
+ <div crm-ui-field="subform.replyToA" crm-title="ts('Reply-To (A)')" ng-show="crmMailingConst.enableReplyTo" ng-if="fields.replyToA">
+ <span ng-controller="EmailAddrCtrl">
+ <select
+ crm-ui-id="subform.replyToA"
+ name="replyToA"
+ ui-jq="select2"
+ ui-options="{dropdownAutoWidth : true, allowClear: true, placeholder: ts('Email address')}"
+ ng-model="abtest.mailings.a.replyto_email"
+ ng-options="frm.label as frm.label for frm in crmFromAddresses.getAll() | filter:{is_active:1} | orderBy:'weight'"
+ >
+ <option value=""></option>
+ </select>
+ </span>
+ </div>
+ <div crm-ui-field="subform.replyToB" crm-title="ts('Reply-To (B)')" ng-show="crmMailingConst.enableReplyTo" ng-if="fields.replyToB">
+ <span ng-controller="EmailAddrCtrl">
+ <select
+ crm-ui-id="subform.replyToB"
+ name="replyToB"
+ ui-jq="select2"
+ ui-options="{dropdownAutoWidth : true, allowClear: true, placeholder: ts('Email address')}"
+ ng-model="abtest.mailings.b.replyto_email"
+ ng-options="frm.label as frm.label for frm in crmFromAddresses.getAll() | filter:{is_active:1} | orderBy:'weight'"
+ >
+ <option value=""></option>
+ </select>
+ </span>
+ </div>
+
+
<!--
<div crm-ui-field="subform.recipients" crm-title="ts('Recipients')">
<div ng-controller="EditRecipCtrl">
</div>
</div>
-->
+
+
<div crm-ui-field="subform.subject" crm-title="ts('Subject')" ng-if="fields.subject">
<div style="float: right;">
<input crm-mailing-token crm-for="subject" />