forked from CiviWare/com.dpci.constituentsonly
		
	Fixed display when non-default view is selected
This commit is contained in:
		@@ -171,14 +171,19 @@ class CRM_ConstituentsOnly_BAO_ConstituentsOnly {
 | 
				
			|||||||
        }
 | 
					        }
 | 
				
			||||||
      }
 | 
					      }
 | 
				
			||||||
      if (in_array($url, ['civicrm/contact/search/builder']) || !empty($request['uf_group_id'])) {
 | 
					      if (in_array($url, ['civicrm/contact/search/builder']) || !empty($request['uf_group_id'])) {
 | 
				
			||||||
 | 
					        $returnProperties = CRM_Core_Session::singleton()->get('return_properties_search');
 | 
				
			||||||
 | 
					        if (!empty($returnProperties)) {
 | 
				
			||||||
          foreach ($headers as $header) {
 | 
					          foreach ($headers as $header) {
 | 
				
			||||||
            if (!empty($header['sort'])) {
 | 
					            if (!empty($header['sort'])) {
 | 
				
			||||||
            $returnProperties[$header['sort']] = 1;
 | 
					              $headerName = str_replace('`', '', $header['sort']);
 | 
				
			||||||
 | 
					              $returnProperties[$headerName] = 1;
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
          }
 | 
					          }
 | 
				
			||||||
          $returnProperties['contact_sub_type'] = 1;
 | 
					          $returnProperties['contact_sub_type'] = 1;
 | 
				
			||||||
          $returnProperties['contact_type'] = 1;
 | 
					          $returnProperties['contact_type'] = 1;
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					      }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
      $queryParams = CRM_Contact_BAO_Query::convertFormValues($formValues);
 | 
					      $queryParams = CRM_Contact_BAO_Query::convertFormValues($formValues);
 | 
				
			||||||
      $selector = new CRM_Contact_Selector(
 | 
					      $selector = new CRM_Contact_Selector(
 | 
				
			||||||
        '',
 | 
					        '',
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -13,6 +13,7 @@ class CRM_ConstituentsOnly_BAO_Query extends CRM_Contact_BAO_Query_Interface {
 | 
				
			|||||||
   *
 | 
					   *
 | 
				
			||||||
   */
 | 
					   */
 | 
				
			||||||
  public function select(&$query) {
 | 
					  public function select(&$query) {
 | 
				
			||||||
 | 
					    CRM_Core_Session::singleton()->set('return_properties_search', $query->_returnProperties);
 | 
				
			||||||
    // hack for profile search
 | 
					    // hack for profile search
 | 
				
			||||||
    $url = CRM_Utils_Array::value('q', $_GET);
 | 
					    $url = CRM_Utils_Array::value('q', $_GET);
 | 
				
			||||||
    if (in_array($url, ['civicrm/profile', 'civicrm/contact/search/builder'])) {
 | 
					    if (in_array($url, ['civicrm/profile', 'civicrm/contact/search/builder'])) {
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user