CRM-13244 - ActionSchedule - Extract entity-specific logic for tokens and dropdowns.
authorTim Otten <totten@civicrm.org>
Mon, 27 Jul 2015 07:24:52 +0000 (00:24 -0700)
committerTim Otten <totten@civicrm.org>
Sun, 27 Sep 2015 01:53:43 +0000 (21:53 -0400)
commit50a2375554b2a33cacebbe3822ff3c84f60fb9e9
treed2b0b77c386da256d1416ebf2b291df0b9ed9bcc
parentf42ab010fa9738bebd0eca2f426213f7e75c47db
CRM-13244 - ActionSchedule - Extract entity-specific logic for tokens and dropdowns.

The `ActionSchedule` BAO had a ton of duplicate, helter-skelter code for
looking up specific details about specific entities and mappings.  The
mapping class (`CRM_Core_DAO_ActionMapping`) had an anemic model.  The
mapping records could be modified in the DB, but in practice this was
pointless because they depended on so many hard-coded lookups.  And there
were some confusing variable names (sel1, sel2, sel3, etc) and
variable-shuffling.

This revision moves several entity-specific bits into new classes
(`Civi\ActionSchedule\Mapping` and `CRM_Core_ActionScheduleTmp`), abandons
the pretense of DB editing, centralizes mapping-related lookups, and replaces
various references to `CRM_Core_DAO_ActionMapping`.

This is envisioned as an intermediate step; the two classes are still a bit
heavy (mixing together logic for unrelated entities) and should be split
further.
CRM/Admin/Form/ScheduleReminders.php
CRM/Core/ActionScheduleTmp.php [new file with mode: 0644]
CRM/Core/BAO/ActionSchedule.php
CRM/Event/BAO/Event.php
CRM/Event/Form/ManageEvent/TabHeader.php
CRM/Event/Page/ManageEvent.php
Civi/ActionSchedule/Mapping.php [new file with mode: 0644]
Civi/Core/Container.php
tests/phpunit/api/v3/ActionScheduleTest.php