Skip to content

Commit

Permalink
Merge pull request #16670 from demeritcowboy/audit-tpl-3
Browse files Browse the repository at this point in the history
dev/core#1366 - case audit printReport parameter is no longer used
  • Loading branch information
eileenmcnaughton authored Mar 29, 2020
2 parents f932111 + 67f8a3e commit 8d557f6
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 12 deletions.
17 changes: 6 additions & 11 deletions CRM/Case/Audit/Audit.php
Original file line number Diff line number Diff line change
Expand Up @@ -221,25 +221,20 @@ public function compareActivities($a, $b) {
* @param string $xmlString
* @param int $clientID
* @param int $caseID
* @param bool $printReport
*
* @return mixed
*/
public static function run($xmlString, $clientID, $caseID, $printReport = FALSE) {
public static function run($xmlString, $clientID, $caseID) {
$audit = new CRM_Case_Audit_Audit($xmlString, 'audit.conf.xml');
$activities = $audit->getActivities($printReport);
$activities = $audit->getActivities(TRUE);

$template = CRM_Core_Smarty::singleton();
$template->assign_by_ref('activities', $activities);

if ($printReport) {
$reportDate = CRM_Utils_Date::customFormat(date('Y-m-d H:i'));
$template->assign('reportDate', $reportDate);
$contents = $template->fetch('CRM/Case/Audit/Report.tpl');
}
else {
$contents = $template->fetch('CRM/Case/Audit/Audit.tpl');
}
$reportDate = CRM_Utils_Date::customFormat(date('Y-m-d H:i'));
$template->assign('reportDate', $reportDate);
$contents = $template->fetch('CRM/Case/Audit/Report.tpl');

return $contents;
}

Expand Down
2 changes: 1 addition & 1 deletion CRM/Case/XMLProcessor/Report.php
Original file line number Diff line number Diff line change
Expand Up @@ -984,7 +984,7 @@ public static function printCaseReport() {
$params,
$report
);
$printReport = CRM_Case_Audit_Audit::run($contents, $clientID, $caseID, TRUE);
$printReport = CRM_Case_Audit_Audit::run($contents, $clientID, $caseID);
echo $printReport;
CRM_Utils_System::civiExit();
}
Expand Down

0 comments on commit 8d557f6

Please sign in to comment.