From: DemeritCowboy Date: Wed, 13 Nov 2019 01:44:06 +0000 (-0500) Subject: pull out to make more testable X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=8ed46a8d23a9a0138a660eb5805352d8f030a171;p=civicrm-core.git pull out to make more testable --- diff --git a/CRM/Case/XMLProcessor/Report.php b/CRM/Case/XMLProcessor/Report.php index 010d955552..e302f551a6 100644 --- a/CRM/Case/XMLProcessor/Report.php +++ b/CRM/Case/XMLProcessor/Report.php @@ -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() {