CRM-13573 : fix to process search criteria on page load as well
authorPratik Joshi <pratik.joshi@webaccess.co.in>
Mon, 14 Oct 2013 11:11:18 +0000 (16:41 +0530)
committerPratik Joshi <pratik.joshi@webaccess.co.in>
Mon, 14 Oct 2013 11:11:18 +0000 (16:41 +0530)
----------------------------------------
* CRM-13573: Manage Groups display shows disabled groups on initial display - but disabled groups option is NOT selected
  http://issues.civicrm.org/jira/browse/CRM-13573

templates/CRM/Group/Form/Search.tpl

index 7d256fa00f873ec5676e078867cd430a85578bd5..570a40e5b03381fdf4bf0ca7bce9e5473dd40053 100644 (file)
@@ -91,7 +91,7 @@
 {literal}
 <script type="text/javascript">
 cj( function() {
-  buildGroupSelector( false );
+  buildGroupSelector( true );
   cj('#_qf_Search_refresh').click( function() {
     buildGroupSelector( true );
   });
@@ -99,7 +99,9 @@ cj( function() {
 
 function buildGroupSelector( filterSearch ) {
     if ( filterSearch ) {
-        crmGroupSelector.fnDestroy();
+        if (typeof crmGroupSelector !== 'undefined') {
+          crmGroupSelector.fnDestroy();
+        }
         var parentsOnly = 0;
         var ZeroRecordText = '<div class="status messages">{/literal}{ts escape="js"}No matching Groups found for your search criteria. Suggestions:{/ts}{literal}<div class="spacer"></div><ul><li>{/literal}{ts escape="js"}Check your spelling.{/ts}{literal}</li><li>{/literal}{ts escape="js"}Try a different spelling or use fewer letters.{/ts}{literal}</li><li>{/literal}{ts escape="js"}Make sure you have enough privileges in the access control system.{/ts}{literal}</li></ul></div>';
     } else {