From 35e8e5925c91f063325e155e6e9dc44266a23e72 Mon Sep 17 00:00:00 2001 From: eileenmcnaugton Date: Sun, 7 Aug 2016 19:42:00 +1200 Subject: [PATCH] CRM-19068 comment fixes & remove unused variables --- CRM/Contact/BAO/GroupNesting.php | 17 +++++++++-------- CRM/Contact/Form/Task/SaveSearch.php | 9 +++------ CRM/Group/Form/Edit.php | 3 +-- 3 files changed, 13 insertions(+), 16 deletions(-) diff --git a/CRM/Contact/BAO/GroupNesting.php b/CRM/Contact/BAO/GroupNesting.php index 209afb79ff..1870c08342 100644 --- a/CRM/Contact/BAO/GroupNesting.php +++ b/CRM/Contact/BAO/GroupNesting.php @@ -41,14 +41,12 @@ class CRM_Contact_BAO_GroupNesting extends CRM_Contact_DAO_GroupNesting implemen private $_lastParentlessGroup; - private $_styleLabels; - private $_styleIndent; private $_alreadyStyled = FALSE; /** - * Class constructor. + * Get the number of levels of nesting. * * @param bool $styleLabels * @param string $styleIndent @@ -285,6 +283,8 @@ class CRM_Contact_BAO_GroupNesting extends CRM_Contact_DAO_GroupNesting implemen * Id of the group to add the child to. * @param int $childID * Id of the new child group. + * + * @return \CRM_Contact_DAO_GroupNesting */ public static function add($parentID, $childID) { // TODO: Add checks here to make sure invalid nests can't be created @@ -294,9 +294,7 @@ class CRM_Contact_BAO_GroupNesting extends CRM_Contact_DAO_GroupNesting implemen } /** - * Removes a child group identified by $childGroupId from the group - * identified by $groupId; does not delete child group, just the - * association between the two + * Removes a child group from it's parent. * * @param $parentID * The id of the group to remove the child from. @@ -314,6 +312,8 @@ class CRM_Contact_BAO_GroupNesting extends CRM_Contact_DAO_GroupNesting implemen * identified by $groupId; does not delete child group, just the * association between the two * + * @param int $parentID + * The id of the group to remove the child from. * @param int $childID * The id of the child group being removed. */ @@ -327,9 +327,10 @@ class CRM_Contact_BAO_GroupNesting extends CRM_Contact_DAO_GroupNesting implemen * Returns true if the association between parent and child is present, * false otherwise. * - * @param $parentID + * @param int $parentID * The parent id of the association. - * @param $childID + * + * @param int $childID * The child id of the association. * * @return bool diff --git a/CRM/Contact/Form/Task/SaveSearch.php b/CRM/Contact/Form/Task/SaveSearch.php index e0f5610199..e4ef5cb020 100644 --- a/CRM/Contact/Form/Task/SaveSearch.php +++ b/CRM/Contact/Form/Task/SaveSearch.php @@ -79,16 +79,13 @@ class CRM_Contact_Form_Task_SaveSearch extends CRM_Contact_Form_Task { * - displaying elements for saving the search */ public function buildQuickForm() { - // get the qill + // @todo sync this more with CRM_Group_Form_Edit. $query = new CRM_Contact_BAO_Query($this->get('queryParams')); - $qill = $query->qill(); + $this->assign('qill', $query->qill()); // Values from the search form $formValues = $this->controller->exportValues(); - // need to save qill for the smarty template - $this->assign('qill', $qill); - // the name and description are actually stored with the group and not the saved search $this->add('text', 'title', ts('Name'), CRM_Core_DAO::getAttribute('CRM_Contact_DAO_Group', 'title'), TRUE @@ -231,7 +228,7 @@ class CRM_Contact_Form_Task_SaveSearch extends CRM_Contact_Form_Task { $params['id'] = CRM_Contact_BAO_SavedSearch::getName($this->_id, 'id'); } - $group = CRM_Contact_BAO_Group::create($params); + CRM_Contact_BAO_Group::create($params); // CRM-9464 $this->_id = $savedSearch->id; diff --git a/CRM/Group/Form/Edit.php b/CRM/Group/Form/Edit.php index 1f09110cf5..2537155e96 100644 --- a/CRM/Group/Form/Edit.php +++ b/CRM/Group/Form/Edit.php @@ -237,7 +237,7 @@ class CRM_Group_Form_Edit extends CRM_Core_Form { ); $groupTypes = CRM_Core_OptionGroup::values('group_type', TRUE); - $config = CRM_Core_Config::singleton(); + if (isset($this->_id) && !empty($this->_groupValues['saved_search_id'])) { unset($groupTypes['Access Control']); } @@ -396,7 +396,6 @@ WHERE title = %1 } $params['group_type'] = $groupTypeIds; - $customFields = CRM_Core_BAO_CustomField::getFields('Group'); $params['custom'] = CRM_Core_BAO_CustomField::postProcess($params, $this->_id, 'Group' -- 2.25.1