Details
Description
When viewing an activity ( civicrm/activity/view? ..... ) , the information now included is basic. For Bulk Email type activities, it makes sense to include click-through and open rate information about this contact for this particular mailing.
Another place where additional information about open- and click-through information would be useful is on the contact record's Activities tab. I <a href ='http://wiki.civicrm.org/confluence/display/CRMDOC41/Customizing+the+Activities+subtab+of+the+View+Contact+pages+using+template+files'>described how to add a column to this page in the wiki</a>
http://wiki.civicrm.org/confluence/display/CRMDOC41/Customizing+the+Activities+subtab+of+the+View+Contact+pages+using+template+files
... but the was really focused on how to add a column with X information.
I realized that CRM_Mailing_Event_BAO_Opened::getRows and CRM_Mailing_Event_BAO_TrackableURLOpen:getRows were very close to returning the query result I sought. I added contact_id as an argument and in the WHERE clause in these two functions. Combining this with the instructions in the wiki article above can improve the information on the view activity pages for bulk emails.
I am packaging these changes together into a patch file. If the Powers That B are so inclined, these can be incorporated into a future release. If not, no big deal, this patch can still be applied to custom templates and custom php directories.
Files affected are:
CRM/Activity/BAO/Activity.php
CRM/Mailling/Event/BAO/Opened.php
CRM/Mailing/Event/BAO/TrackableURLOpen.php
CRM/Activity/Form/ActivityView.php
CRM/Activity/Page/AJAX.php
and
templates/CRM/Activity/Form/ActivityView.tpl