CRM-17606 - Add 'Print Document' button on manage case screen
authorColeman Watts <coleman@civicrm.org>
Wed, 25 Nov 2015 22:28:15 +0000 (17:28 -0500)
committerColeman Watts <coleman@civicrm.org>
Wed, 25 Nov 2015 22:28:15 +0000 (17:28 -0500)
CRM/Case/Form/CaseView.php
templates/CRM/Case/Form/CaseView.tpl

index 76bbe9a53bc3609ecc71bdc496c9df740ea009f7..3932eed6c8be61463cd0ea17d8bfc8c1837bec86 100644 (file)
@@ -232,6 +232,11 @@ class CRM_Case_Form_CaseView extends CRM_Core_Form {
     $emailActivityType = array_search('Email', $allActTypes);
     $pdfActivityType = array_search('Print PDF Letter', $allActTypes);
 
+    if ($pdfActivityType) {
+      $this->assign('exportDoc', CRM_Utils_System::url('civicrm/activity/pdf/add',
+        "action=add&context=standalone&reset=1&cid={$this->_contactID}&caseid={$this->_caseID}&atype=$pdfActivityType"));
+    }
+
     // remove Open Case activity type since we're inside an existing case
     if ($openActTypeId = array_search('Open Case', $allActTypes)) {
       unset($aTypes[$openActTypeId]);
index 373ba9c0b626c652d73272f737e7b7138bbaebc4..ba477db777894b8fde99366d5172985272297f5d 100644 (file)
           <a class="crm-hover-button action-item no-popup" href="{crmURL p='civicrm/case/report/print' q="all=1&redact=0&cid=$contactID&caseID=$caseId&asn=standard_timeline"}"><i class="crm-i fa-print"></i> {ts}Print Report{/ts}</a>
         {/if}
 
+        {if !empty($exportDoc)}
+          <a class="crm-hover-button action-item" href="{$exportDoc}"><i class="crm-i fa-file-pdf-o"></i> {ts}Export Document{/ts}</a>
+        {/if}
+
         {if $mergeCases}
           <a href="#mergeCasesDialog" class="action-item no-popup crm-hover-button case-miniform"><i class="crm-i fa-compress"></i> {ts}Merge Case{/ts}</a>
           {$form._qf_CaseView_next_merge_case.html}