CRM-15107 - Add button to update smart group counts
authorColeman Watts <coleman@civicrm.org>
Fri, 15 Aug 2014 15:27:33 +0000 (16:27 +0100)
committerColeman Watts <coleman@civicrm.org>
Fri, 15 Aug 2014 15:27:33 +0000 (16:27 +0100)
CRM/Group/Page/Group.php
templates/CRM/Group/Form/Search.tpl
templates/CRM/Group/Page/Group.hlp

index bb74bcf460818f5d6556c7502015fd19c0cdd7b6..545e3150d33f9c3b08184a59f49e4ebd398c904d 100644 (file)
@@ -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();
   }
 
index 60a6e70c6733cb5ddcad30cb06fd28118c191fce..d366446b16a4342cc53bdfb8fa7998bd08527df6 100644 (file)
@@ -66,7 +66,9 @@
   </tr>
 </table>
 </div>
-<br/>
+<div class="css_right">
+  <a class="crm-hover-button" href="{crmURL q="reset=1&update_smart_groups=1"}">{ts}Update Smart Group Counts{/ts}</a> {help id="update_smart_groups"}
+</div>
 <table class="crm-group-selector">
   <thead>
     <tr>
index 4d92cea6704f5a3d4aa55c25aa749abce526ac46..2af87ef0ac2dc9f7387db3956f71b2e5a7b51d06 100644 (file)
 {htxt id="id-group-organization"}
 <p>{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}</p>
 {/htxt}
+
+{htxt id="update_smart_groups-title"}
+  {ts}Update Smart Group Counts{/ts}
+{/htxt}
+{htxt id="update_smart_groups"}
+  <p>
+    {ts}Update this page with current statistics on the number of contacts in each smart group.{/ts}
+  </p>
+{/htxt}