CRM-15857 - Move "Dedupe by email" into a dialog
authorTim Otten <totten@civicrm.org>
Fri, 13 Feb 2015 18:46:10 +0000 (10:46 -0800)
committerTim Otten <totten@civicrm.org>
Fri, 13 Feb 2015 18:46:10 +0000 (10:46 -0800)
js/angular-crmMailing.js
partials/crmMailing/dialog/recipientOptions.html [new file with mode: 0644]
partials/crmMailing/recipients.html

index 68c351dd6887669e56f40891eb65f845d4a57611..5623e42fa9a0d474192ed99d4ccb232fb26ebc14 100644 (file)
       };
       dialogService.open('recipDialog', '~/crmMailing/dialog/recipients.html', model, options);
     };
+
+    // Open a dialog for editing the advanced recipient options.
+    $scope.editOptions = function editOptions(mailing) {
+      var options = {
+        autoOpen: false,
+        modal: true,
+        title: ts('Edit Options')
+      };
+      dialogService.open('previewComponentDialog', '~/crmMailing/dialog/recipientOptions.html', mailing, options);
+    };
   });
 
   // Controller for the "Preview Recipients" dialog
     $scope.ts = CRM.ts(null);
   });
 
+  // Controller for the "Recipients: Edit Options" dialog
+  // Note: Expects $scope.model to be a mailing object.
+  angular.module('crmMailing').controller('EditRecipOptionsDialogCtrl', function EditRecipOptionsDialogCtrl($scope) {
+    $scope.ts = CRM.ts(null);
+  });
+
   // Controller for the "Preview Mailing Component" segment
   // which displays header/footer/auto-responder
   angular.module('crmMailing').controller('PreviewComponentCtrl', function PreviewComponentCtrl($scope, dialogService) {
diff --git a/partials/crmMailing/dialog/recipientOptions.html b/partials/crmMailing/dialog/recipientOptions.html
new file mode 100644 (file)
index 0000000..ad898f3
--- /dev/null
@@ -0,0 +1,20 @@
+<div ng-controller="EditRecipOptionsDialogCtrl">
+  <div class="crm-block" ng-form="responseForm" crm-ui-id-scope>
+    <div class="crm-group">
+      <!-- FIXME: ts is not working here. -->
+      <div crm-ui-field crm-title="'Dedupe by email'" crm-layout="checkbox">
+        <input
+          type='checkbox'
+          ng-model='model.dedupe_email'
+          ng-true-value="'1'"
+          ng-false-value="'0'"
+          />
+      </div>
+      <div class="crm-section" id="help">
+        <p>{{ts('Multiple people -- such as spouses, parents, or children -- may sometimes share the same email address.')}}</p>
+        <p>{{ts('To send only one message to the shared address, enable this option. Mail-merge tokens will be filled for only one person.')}}</p>
+        <p>{{ts('To send separate messages for each person, disable this option. Mail-merge tokens will be filled separately for each person.')}}</p>
+      </div>
+    </div>
+  </div>
+</div>
index 90d1918540e797355418c851cfe4064bd47664f7..9d14bc25c091ad2faaf6fca2fe68c2dc5a4db0c8 100644 (file)
@@ -3,17 +3,6 @@
     <div class='crmMailing-recip-est'>
       <a href="" ng-click="previewRecipients()">{{getRecipientsEstimate()}}</a>
     </div>
-    <div>
-      <input
-        type='checkbox'
-        ng-model='mailing.dedupe_email'
-        ng-true-value="'1'"
-        ng-false-value="'0'"
-        id="recipients-dedupe-email"/>
-      <label for="recipients-dedupe-email">
-        {{ts('Dedupe')}}
-      </label>
-    </div>
   </div>
   <select
     crm-mailing-recipients
@@ -25,4 +14,7 @@
     ng-required="true"
     multiple>
   </select>
+  <a ng-click="editOptions(mailing)" class="crm-hover-button" title="{{ts('Edit Options')}}">
+    <span class="icon ui-icon-wrench"></span>
+  </a>
 </div>