CRM-8338 removed CRM_Contact_Form_Task_Label::mergeSameHousehold(), made obsolete...
authorDave Jenkins <davej+git@circle-interactive.co.uk>
Wed, 9 Oct 2013 22:30:48 +0000 (23:30 +0100)
committerDave Jenkins <davej+git@circle-interactive.co.uk>
Wed, 9 Oct 2013 22:30:48 +0000 (23:30 +0100)
----------------------------------------
* CRM-8338: Mailing Label Household Merge requires Household to be selected as well as individuals
  http://issues.civicrm.org/jira/browse/CRM-8338

CRM/Contact/Form/Task/Label.php

index deebe1898db27cf6e97d383cd66edb191c383d72..d36c4efd6fc1c70107725d70c8455d560c87ff31 100644 (file)
@@ -480,36 +480,5 @@ class CRM_Contact_Form_Task_Label extends CRM_Contact_Form_Task {
       $rows[$data['ID']]['addressee'] = $rows[$data['ID']]['addressee_display'] = $rows[$data['ID']]['display_name'] = $processedNames;
     }
   }
-
-  function mergeSameHousehold(&$rows) {
-    # group selected contacts by type
-    $individuals = array();
-    $households = array();
-    foreach ($rows as $contact_id => $row) {
-      if ($row['contact_type'] == 'Household') {
-        $households[$contact_id] = $row;
-      }
-      elseif ($row['contact_type'] == 'Individual') {
-        $individuals[$contact_id] = $row;
-      }
-    }
-
-    # exclude individuals belonging to selected households
-    foreach ($households as $household_id => $row) {
-      $dao = new CRM_Contact_DAO_Relationship();
-      $dao->contact_id_b = $household_id;
-      $dao->find();
-      while ($dao->fetch()) {
-        $individual_id = $dao->contact_id_a;
-        if (array_key_exists($individual_id, $individuals)) {
-          unset($individuals[$individual_id]);
-        }
-      }
-    }
-
-    # merge back individuals and households
-    $rows = array_merge($individuals, $households);
-    return $rows;
-  }
 }