CRM-15706 - Add help to various MailingUI fields
authorColeman Watts <coleman@civicrm.org>
Tue, 17 Mar 2015 19:47:07 +0000 (15:47 -0400)
committerColeman Watts <coleman@civicrm.org>
Thu, 19 Mar 2015 15:39:48 +0000 (11:39 -0400)
js/angular-crm-ui.js
js/angular-crmMailing/directives.js
js/angular-crmMailingAB/directives.js
partials/crmMailing/headerFooter.html
partials/crmMailing/mailing.html
partials/crmMailing/summary.html
partials/crmMailingAB/joint-mailing.html
partials/crmMailingAB/setup.html
templates/CRM/Mailing/MailingUI.hlp [new file with mode: 0644]

index 2ae109d1a0a574fbdd8bef535ae64a273ff25c92..e59e7427c3b3f973a76c1eb1d5822cf9e11784ea 100644 (file)
         require: '^crmUiIdScope',
         restrict: 'EA',
         scope: {
-          // {title, name, help}
+          // {title, name, help, helpFile}
           crmUiField: '='
         },
         templateUrl: function(tElement, tAttrs){
         transclude: true,
         link: function (scope, element, attrs, crmUiIdCtrl) {
           $(element).addClass('crm-section');
-          scope.crmUiHelpFile = scope.$parent.crmUiHelpFile; // propagate default
+          // Inherit helpFile from parent scope if not specified
+          scope.crmUiHelpFile = scope.crmUiField.helpFile || scope.$parent.crmUiHelpFile;
         }
       };
     })
index 646d285848c6a9975cd11ff176dff946357b5617..80a022a32703d29ac22452b12efcce36cda4d0fa 100644 (file)
@@ -28,7 +28,7 @@
           });
           scope.crmMailingConst = CRM.crmMailing;
           scope.ts = CRM.ts(null);
-          scope.crmUiHelpFile = 'CRM/Mailing/Form/Upload';
+          scope.crmUiHelpFile = 'CRM/Mailing/MailingUI';
           scope[directiveName] = attr[directiveName] ? scope.$parent.$eval(attr[directiveName]) : {};
           $q.when(crmMetadata.getFields('Mailing'), function(fields) {
             scope.mailingFields = fields;
index d5f170c58f7ee0100ca54d95d16f02fd2add047e..7cf79d731311a0dbdb8b307b3479787b983d0ece 100644 (file)
@@ -21,6 +21,7 @@
           scope.crmMailingConst = CRM.crmMailing;
           scope.crmMailingABCriteria = crmMailingABCriteria;
           scope.ts = CRM.ts(null);
+          scope.crmUiHelpFile = 'CRM/Mailing/MailingUI';
 
           var fieldsModel = $parse(attr[directiveName]);
           scope.fields = fieldsModel(scope.$parent);
index 165ecd9812de8caab8f74fe4369f1e805c996dc8..2e611c5a6c34968ee44f1ff79f81152ee908a045 100644 (file)
@@ -4,7 +4,7 @@ Required vars: mailing, crmMailingConst
 -->
 <div class="crm-block"  ng-form="subform" crm-ui-id-scope>
   <div class="crm-group" ng-controller="EmailBodyCtrl">
-    <div crm-ui-field="{name: 'subform.header_id', title: ts('Mailing Header')}">
+    <div crm-ui-field="{name: 'subform.header_id', title: ts('Mailing Header'), help: 'header'}">
       <select
         crm-ui-id="subform.header_id"
         name="header_id"
@@ -16,7 +16,7 @@ Required vars: mailing, crmMailingConst
         <option value=""></option>
       </select>
     </div>
-    <div crm-ui-field="{name: 'subform.footer_id', title: ts('Mailing Footer')}">
+    <div crm-ui-field="{name: 'subform.footer_id', title: ts('Mailing Footer'), help: 'footer'}">
       <select
         crm-ui-id="subform.footer_id"
         name="footer_id"
index 4521b29593060cd489e166b6a009544bbdbfc54d..f9393d9a3aa776c05b498635465cc1c3b6312fa4 100644 (file)
@@ -21,7 +21,7 @@ It could perhaps be thinned by 30-60% by making more directives.
         <a crm-icon="disk" ng-click="saveTemplate(mailing)" class="crm-hover-button" title="{{ts('Save As')}}"></a>
       </div>
     </div>
-    <div crm-ui-field="{name: 'subform.fromAddress', title: ts('From'), help: 'id-from_email'}">
+    <div crm-ui-field="{name: 'subform.fromAddress', title: ts('From'), help: 'from_email'}">
       <div ng-controller="EmailAddrCtrl" crm-mailing-from-address="fromPlaceholder" crm-mailing="mailing">
         <select
           crm-ui-id="subform.fromAddress"
index 42421103a732e61679c8ff01d7b714c67a3fc0f2..ac96c69c28265adad64717d54f577d8ce9926ed6 100644 (file)
@@ -5,7 +5,7 @@ FIXME: Don't hardcode table-based layout!
 -->
 <div class="crm-block" ng-form="subform" crm-ui-id-scope>
   <div class="crm-group">
-    <div crm-ui-field="{name: 'subform.mailingName', title: ts('Mailing Name')}">
+    <div crm-ui-field="{name: 'subform.mailingName', title: ts('Mailing Name'), help: 'name'}">
       <div>
         <input
           crm-ui-id="subform.mailingName"
@@ -17,7 +17,7 @@ FIXME: Don't hardcode table-based layout!
           name="mailingName" />
       </div>
     </div>
-    <div crm-ui-field="{name: 'subform.campaign', title: ts('Campaign')}" ng-show="crmMailingConst.campNames.length > 0">
+    <div crm-ui-field="{name: 'subform.campaign', title: ts('Campaign'), help: 'id-campaign_id', helpFile: 'CRM/Campaign/Form/addCampaignToComponent'}" ng-show="crmMailingConst.campNames.length > 0">
       <select
         crm-ui-id="subform.campaign"
         name="campaign"
index 82aa5c4e500911a928b11d5ea7e3bdd109c6a2eb..3786a13b8d621d6e5ffbd7310eeb846384199bc9 100644 (file)
@@ -62,7 +62,7 @@ processed by Angular; if false, the field will be hidden and completely ignored
     </div>
 
 
-    <div crm-ui-field="{name: 'subform.fromAddress', title: ts('From')}" ng-if="fields.fromAddress">
+    <div crm-ui-field="{name: 'subform.fromAddress', title: ts('From'), help: 'from_email'}" ng-if="fields.fromAddress">
       <span ng-controller="EmailAddrCtrl" crm-mailing-from-address="fromPlaceholder" crm-mailing="abtest.mailings.a">
         <select
           crm-ui-id="subform.fromAddress"
@@ -75,7 +75,7 @@ processed by Angular; if false, the field will be hidden and completely ignored
         </select>
       </span>
     </div>
-    <div crm-ui-field="{name: 'subform.fromAddressA', title: ts('From (A)')}" ng-if="fields.fromAddressA">
+    <div crm-ui-field="{name: 'subform.fromAddressA', title: ts('From (A)'), help: 'from_email'}" ng-if="fields.fromAddressA">
       <span ng-controller="EmailAddrCtrl" crm-mailing-from-address="fromPlaceholder" crm-mailing="abtest.mailings.a">
         <select
           crm-ui-id="subform.fromAddressA"
@@ -88,7 +88,7 @@ processed by Angular; if false, the field will be hidden and completely ignored
         </select>
       </span>
     </div>
-    <div crm-ui-field="{name: 'subform.fromAddressB', title: ts('From (B)')}" ng-if="fields.fromAddressB">
+    <div crm-ui-field="{name: 'subform.fromAddressB', title: ts('From (B)'), help: 'from_email'}" ng-if="fields.fromAddressB">
       <span ng-controller="EmailAddrCtrl" crm-mailing-from-address="fromPlaceholder" crm-mailing="abtest.mailings.b">
         <select
           crm-ui-id="subform.fromAddressB"
index 2e30dd8dcadaeedc0aaa2c1181634362d9c1f49f..80f76a2983ded700c23cbd34897379e363ab6b17 100644 (file)
@@ -4,7 +4,7 @@
       {{ts('A/B testing allows you to send two test mailings to a random subset of your recipients. After collecting and
       comparing metrics, the more successful mailing will be sent to the remaining recipients.')}}
     </div>
-    <div crm-ui-field="{name: 'setupForm.abName', title: ts('Name')}" ng-if="fields.abName">
+    <div crm-ui-field="{name: 'setupForm.abName', title: ts('Name'), help: 'name'}" ng-if="fields.abName">
       <input
         crm-ui-id="setupForm.abName"
         name="abName"
@@ -13,7 +13,7 @@
         placeholder="A/B Test Name"
         required/>
     </div>
-    <div crm-ui-field="{name: 'setupForm.campaign', title: ts('Campaign')}" ng-show="crmMailingConst.campNames.length > 0"
+    <div crm-ui-field="{name: 'setupForm.campaign', title: ts('Campaign'), help: 'id-campaign_id', helpFile: 'CRM/Campaign/Form/addCampaignToComponent'}" ng-show="crmMailingConst.campNames.length > 0"
          ng-if="fields.campaign">
       <select
         crm-ui-id="setupForm.campaign"
diff --git a/templates/CRM/Mailing/MailingUI.hlp b/templates/CRM/Mailing/MailingUI.hlp
new file mode 100644 (file)
index 0000000..fa1cf8f
--- /dev/null
@@ -0,0 +1,62 @@
+{*
+ +--------------------------------------------------------------------+
+ | CiviCRM version 4.4                                                |
+ +--------------------------------------------------------------------+
+ | Copyright CiviCRM LLC (c) 2004-2013                                |
+ +--------------------------------------------------------------------+
+ | This file is a part of CiviCRM.                                    |
+ |                                                                    |
+ | CiviCRM is free software; you can copy, modify, and distribute it  |
+ | under the terms of the GNU Affero General Public License           |
+ | Version 3, 19 November 2007 and the CiviCRM Licensing Exception.   |
+ |                                                                    |
+ | CiviCRM is distributed in the hope that it will be useful, but     |
+ | WITHOUT ANY WARRANTY; without even the implied warranty of         |
+ | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.               |
+ | See the GNU Affero General Public License for more details.        |
+ |                                                                    |
+ | You should have received a copy of the GNU Affero General Public   |
+ | License and the CiviCRM Licensing Exception along                  |
+ | with this program; if not, contact CiviCRM LLC                     |
+ | at info[AT]civicrm[DOT]org. If you have questions about the        |
+ | GNU Affero General Public License or the licensing of CiviCRM,     |
+ | see the CiviCRM license FAQ at http://civicrm.org/licensing        |
+ +--------------------------------------------------------------------+
+*}
+{htxt id="name"}
+  <p>
+    {ts}Assign a unique name to each of your mailings. Select a naming convention that will help keep your mailings organized and easy to find when you want to review and compare mailing results. For example, if you do a monthly general-interest newsletter - you might use the following naming convention:{/ts}
+  </p><p>
+  <strong>{ts}General Monthly Newsletter: 200709{/ts}</strong>
+</p>
+{/htxt}
+
+{htxt id ="from_email"}
+  <p>{ts}Select the "FROM" Email Address for this mailing from the dropdown list. Available email addresses are configurable by users with Administer CiviCRM permission. EXAMPLE: "Client Services" &lt;clientservices@example.org&gt;{/ts}</p>
+{if call_user_func(array('CRM_Core_Permission','check'), 'administer CiviCRM') }
+  {capture assign="fromConfig"}{crmURL p="civicrm/admin/options/from_email_address" q="reset=1"}{/capture}
+  <p>{ts 1=$fromConfig}Go to <a href='%1'>Administer CiviCRM &raquo; Communications &raquo; FROM Email Addresses</a> to add or edit email addresses. Make sure these email addresses are valid email accounts with your email service provider.{/ts}</p>
+{else}
+  {ts}Contact your site administrator if you need to use a "FROM" Email Address which is not in the dropdown list.{/ts}
+{/if}
+{/htxt}
+
+{htxt id="html"}
+  <p>{ts}You can choose to send BOTH an <strong>HTML</strong> and a plain <strong>TEXT</strong> version of your mailing, OR you can send a <strong>TEXT</strong> version only.{/ts}</p>
+  <p>{ts}If you create only an <strong>HTML</strong> version, CiviMail will automatically create a <strong>TEXT</strong> version for your recipients who have chosen NOT to receive HTML email.{/ts}</p>
+  <h1>{ts}Required Elements{/ts}</h1>
+  <p>{ts}CiviMail email messages must include an <strong>opt-out</strong> link ("Opt out via web page"), and the <strong>postal address</strong> of your organization. These elements help reduce the chances of your email being categorized as SPAM. They can be included in the main message body OR in a re-usable <strong>message footer</strong>. Refer to the online documentation for details on how to include required links and contact information as well as sample messages.{/ts} {docURL page="Sample CiviMail Messages" resource="wiki"}</p>
+{/htxt}
+
+{htxt id="text"}
+  <p>{ts}You can send your email as a simple text-only message, as an HTML formatted message, or both. Text-only messages are sufficient for most email communication - and some recipients may prefer not to receive HTML formatted messages.{/ts}</p>
+  <p>{ts}HTML messages have more visual impact, allow you to include images, and may be more readable if you are including links to website pages. However, different email programs may interpret HTML formats differently - so use this option cautiously unless you have a template format that has been tested with different web and desktop email programs.{/ts}</p>
+{/htxt}
+
+{htxt id="header"}
+  <p>{ts}You may choose to include a pre-configured Header block above your message.{/ts}</p>
+{/htxt}
+
+{htxt id="footer"}
+  <p>{ts}You may choose to include a pre-configured Footer block below your message. This is a good place to include the required unsubscribe, opt-out and postal address tokens.{/ts}</p>
+{/htxt}
\ No newline at end of file