CRM-19068 comment fixes & remove unused variables
authoreileenmcnaugton <eileen@fuzion.co.nz>
Sun, 7 Aug 2016 07:42:00 +0000 (19:42 +1200)
committereileenmcnaugton <eileen@fuzion.co.nz>
Sun, 7 Aug 2016 22:17:03 +0000 (10:17 +1200)
CRM/Contact/BAO/GroupNesting.php
CRM/Contact/Form/Task/SaveSearch.php
CRM/Group/Form/Edit.php

index 209afb79ff51e6bb11655bcd247424c4803dbcbc..1870c0834205164be0cd44cf2d72954d7e46c485 100644 (file)
@@ -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
index e0f56101993a2dfc1687074550d08841cdbc4ba6..e4ef5cb0202b04e6ac5132b454a0b3b243e27c43 100644 (file)
@@ -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;
index 1f09110cf54b15336a495f656b217d839632f330..2537155e9603a30966161484961673de3ecdaf73 100644 (file)
@@ -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'