Details
Description
(This should be written as a patch for CiviCRM 4.4. It's an offshoot of HR-238.)
As a bit of background, note the main call-path for Activity.get API is:
civicrm_api3_activity_get(...)
=> _civicrm_api3_basic_get(...)
=> _civicrm_api3_dao_set_filter(...)
For implementing the target_contact_id filter, one idea discussed tonight with Eileen on IRC:
- Modify _civicrm_api3_dao_set_filter() to call $dao->setApiFilter($params)
- Add CRM_Core_DAO::setApiFilter($params) – which does nothing
- Add CRM_Activity_BAO_Activity:setApiFilter($params) – which checks for $params['target_contact_id'] and calls $this->joinAdd() and $this->whereAdd()
- Add unit-tests to core for cases with (a) no matching activities, (b) a matching activity where the target_contact_id is the only target contact, (c) a matching activity with additional (irrelevant) target contacts.
- Make sure the unit-test api_v3_ActivityGetAbsencesTest::testGetTarget() passes
Attachments
Issue Links
- supplements
-
HR-238 Load real data in absence-request widget
- Done/Fixed