From b65e12f3b68441882e02233dd8ec86d8f3937054 Mon Sep 17 00:00:00 2001 From: Coleman Watts Date: Fri, 15 Aug 2014 16:27:33 +0100 Subject: [PATCH] CRM-15107 - Add button to update smart group counts --- CRM/Group/Page/Group.php | 5 +++++ templates/CRM/Group/Form/Search.tpl | 4 +++- templates/CRM/Group/Page/Group.hlp | 9 +++++++++ 3 files changed, 17 insertions(+), 1 deletion(-) diff --git a/CRM/Group/Page/Group.php b/CRM/Group/Page/Group.php index bb74bcf460..545e3150d3 100644 --- a/CRM/Group/Page/Group.php +++ b/CRM/Group/Page/Group.php @@ -145,6 +145,11 @@ class CRM_Group_Page_Group extends CRM_Core_Page_Basic { } $this->assign('showOrgInfo', $showOrgInfo); + // Refresh smart group cache + if (!empty($_GET['update_smart_groups'])) { + CRM_Contact_BAO_GroupContactCache::loadAll(); + } + $this->search(); } diff --git a/templates/CRM/Group/Form/Search.tpl b/templates/CRM/Group/Form/Search.tpl index 60a6e70c67..d366446b16 100644 --- a/templates/CRM/Group/Form/Search.tpl +++ b/templates/CRM/Group/Form/Search.tpl @@ -66,7 +66,9 @@ -
+
+ {ts}Update Smart Group Counts{/ts} {help id="update_smart_groups"} +
diff --git a/templates/CRM/Group/Page/Group.hlp b/templates/CRM/Group/Page/Group.hlp index 4d92cea670..2af87ef0ac 100644 --- a/templates/CRM/Group/Page/Group.hlp +++ b/templates/CRM/Group/Page/Group.hlp @@ -63,3 +63,12 @@ {htxt id="id-group-organization"}

{ts}Some organizations find it useful to be able to connect Organization contacts to Groups (one-to-one relationship) to represent a multi-org hierarchy. The org contact holds info about the org itself (name, location, etc.) and the group holds other sub-groups/contacts related to that group (employees, alumni, online activists, members, etc.).{/ts}

{/htxt} + +{htxt id="update_smart_groups-title"} + {ts}Update Smart Group Counts{/ts} +{/htxt} +{htxt id="update_smart_groups"} +

+ {ts}Update this page with current statistics on the number of contacts in each smart group.{/ts} +

+{/htxt} -- 2.25.1