}
if ($form->_cid) {
$activity = CRM_Activity_BAO_Activity::create($activityParams);
+ if (!empty($form->_caseId)) {
+ $caseActivityParams = array('activity_id' => $activity->id, 'case_id' => $form->_caseId);
+ CRM_Case_BAO_Case::processCaseActivity($caseActivityParams);
+ }
}
else {
// create Print PDF activity for each selected contact. CRM-6886
$('#format_id', $form).on('change', function() {
selectFormat($(this).val());
});
+ // After the pdf downloads, the user has to manually close the dialog (which would be nice to fix)
+ // But at least we can trigger the underlying list of activities to refresh
+ $form.closest('.ui-dialog-content.crm-ajax-container').on('dialogbeforeclose', function() {
+ $(this).trigger('crmFormSuccess');
+ });
});
var currentWidth;