pull out to make more testable
authorDemeritCowboy <demeritcowboy@hotmail.com>
Wed, 13 Nov 2019 01:44:06 +0000 (20:44 -0500)
committerDemeritCowboy <demeritcowboy@hotmail.com>
Wed, 13 Nov 2019 03:39:02 +0000 (22:39 -0500)
CRM/Case/XMLProcessor/Report.php

index 010d9555520dfe700509778d611eaa2a2566975a..e302f551a6847efd2e1edc2683c61234b7c3625e 100644 (file)
@@ -738,6 +738,24 @@ LIMIT  1
    */
   public static function getCaseReport($clientID, $caseID, $activitySetName, $params, $form) {
 
+    $template = self::populateCaseReportTemplate($clientID, $caseID, $activitySetName, $params, $form);
+
+    // now run the template
+    $contents = $template->fetch('CRM/Case/XMLProcessor/Report.tpl');
+    return $contents;
+  }
+
+  /**
+   * @param int $clientID
+   * @param int $caseID
+   * @param string $activitySetName
+   * @param array $params
+   * @param CRM_Core_Form $form
+   *
+   * @return CRM_Core_Smarty
+   */
+  public static function populateCaseReportTemplate($clientID, $caseID, $activitySetName, $params, $form) {
+
     $template = CRM_Core_Smarty::singleton();
 
     $template->assign('caseId', $caseID);
@@ -794,9 +812,7 @@ LIMIT  1
     $form->getActivities($clientID, $caseID, $activityTypes, $activities);
     $template->assign_by_ref('activities', $activities);
 
-    // now run the template
-    $contents = $template->fetch('CRM/Case/XMLProcessor/Report.tpl');
-    return $contents;
+    return $template;
   }
 
   public static function printCaseReport() {