From 29ba7662da068deeeeb43b0716457320b59ba93c Mon Sep 17 00:00:00 2001 From: "Donald A. Lobo" Date: Fri, 22 Mar 2013 17:11:20 -0700 Subject: [PATCH] CRM-12195 --- CRM/Contact/Form/Search/Custom/Group.php | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/CRM/Contact/Form/Search/Custom/Group.php b/CRM/Contact/Form/Search/Custom/Group.php index fa3d932bd5..bfc95e9eba 100644 --- a/CRM/Contact/Form/Search/Custom/Group.php +++ b/CRM/Contact/Form/Search/Custom/Group.php @@ -120,7 +120,7 @@ class CRM_Contact_Form_Search_Custom_Group extends CRM_Contact_Form_Search_Custo '1' => ts('Show contacts that meet the Groups criteria AND the Tags criteria'), '0' => ts('Show contacts that meet the Groups criteria OR the Tags criteria'), ); - $form->addRadio('andOr', ts('AND/OR'), $andOr, TRUE, '
', TRUE); + $form->addRadio('andOr', ts('AND/OR'), $andOr, NULL, '
', TRUE); $int = &$form->addElement('advmultiselect', 'includeTags', ts('Include Tag(s)') . ' ', $tags, @@ -163,8 +163,16 @@ class CRM_Contact_Form_Search_Custom_Group extends CRM_Contact_Form_Search_Custo * Set search form field defaults here. */ function setDefaultValues() { - return - array( 'andOr' => '1' ); + $defaults = array( 'andOr' => '1' ); + + if (!empty($this->_formValues)) { + $defaults['andOr'] = CRM_Utils_Array::value('andOr', $this->_formValues, '1'); + + $defaults['includeGroups'] = CRM_Utils_Array::value('includeGroups', $this->_formValues); + $defaults['excludeGroups'] = CRM_Utils_Array::value('excludeGroups', $this->_formValues); + } + + return $defaults; } function all( -- 2.25.1