Make send letter function available to searchkit, individual contributions
authoreileen <emcnaughton@wikimedia.org>
Thu, 29 Apr 2021 03:06:27 +0000 (15:06 +1200)
committereileen <emcnaughton@wikimedia.org>
Thu, 29 Apr 2021 03:06:27 +0000 (15:06 +1200)
CRM/Contribute/Form/Task/TaskTrait.php
CRM/Contribute/Task.php
templates/CRM/Contribute/Form/Task/PDFLetter.tpl

index 9f57723b72f7875c5d5d7676094509771e093ba9..2534bb0a551d2cd4afdd5d519e0cf90330af2121 100644 (file)
@@ -144,7 +144,7 @@ trait CRM_Contribute_Form_Task_TaskTrait {
    * @return false
    */
   public function isSingle() {
-    return $this->_single ?? FALSE;
+    return count($this->getIDs()) === 1;
   }
 
 }
index ffe0cab0c39af5457253bf55a6e48109054a57c3..b95755c4811196baeae222e3e4014c81f2a22714 100644 (file)
@@ -101,6 +101,11 @@ class CRM_Contribute_Task extends CRM_Core_Task {
           'title' => ts('Thank-you letters - print or email'),
           'class' => 'CRM_Contribute_Form_Task_PDFLetter',
           'result' => FALSE,
+          'url' => 'civicrm/contribute/task?reset=1&task=letter',
+          'key' => 'letter',
+          'name' => ts('Send Letter'),
+          'is_single_mode' => TRUE,
+          'title_single_mode' => ts('Thank-you letter - print or email'),
         ],
         self::PDF_INVOICE => [
           'title' => ts('Invoices - print or email'),
index fdd078a0f858c979b740a71e796e284393ca2b3e..22b090590e7e361d6dd2ea9efcdfcf037101bd8c 100644 (file)
     <table class="form-layout-compressed">
       <tr><td class="label-left">{$form.thankyou_update.html} {$form.thankyou_update.label}</td><td></td></tr>
       <tr><td class="label-left">{$form.receipt_update.html} {$form.receipt_update.label}</td><td></td></tr>
-      <tr>
-        <td class="label-left">{$form.group_by.label} {help id="id-contribution-grouping"}</td>
-        <td>{$form.group_by.html}</td>
-      </tr>
-      <tr>
-        <td class="label-left">{$form.group_by_separator.label}</td>
-        <td>{$form.group_by_separator.html}</td>
-      </tr>
+      {if !$single}
+        <tr>
+          <td class="label-left">{$form.group_by.label} {help id="id-contribution-grouping"}</td>
+          <td>{$form.group_by.html}</td>
+        </tr>
+        <tr>
+          <td class="label-left">{$form.group_by_separator.label}</td>
+          <td>{$form.group_by_separator.html}</td>
+        </tr>
+      {/if}
       <tr>
         <td class="label-left">{$form.email_options.label} {help id="id-contribution-email-print"}</td>
         <td>{$form.email_options.html}</td>