Merge pull request #15142 from eileenmcnaughton/pradeep2
[civicrm-core.git] / CRM / Case / BAO / Case.php
index fa542ac761f0b564dfc525d1155fa186654f53f9..f947784c068b93e06a4bf0c76b162afacf7ae44a 100644 (file)
@@ -2084,28 +2084,6 @@ HERESQL;
           continue;
         }
 
-        // CRM-11662 Copy Case custom data
-        $extends = array('case');
-        $groupTree = CRM_Core_BAO_CustomGroup::getGroupDetail(NULL, NULL, $extends);
-        if ($groupTree) {
-          foreach ($groupTree as $groupID => $group) {
-            $table[$groupTree[$groupID]['table_name']] = array('entity_id');
-            foreach ($group['fields'] as $fieldID => $field) {
-              $table[$groupTree[$groupID]['table_name']][] = $groupTree[$groupID]['fields'][$fieldID]['column_name'];
-            }
-          }
-
-          foreach ($table as $tableName => $tableColumns) {
-            $insert = 'INSERT INTO ' . $tableName . ' (' . implode(', ', $tableColumns) . ') ';
-            $tableColumns[0] = $mainCaseId;
-            $select = 'SELECT ' . implode(', ', $tableColumns);
-            $from = ' FROM ' . $tableName;
-            $where = " WHERE {$tableName}.entity_id = {$otherCaseId}";
-            $query = $insert . $select . $from . $where;
-            $dao = CRM_Core_DAO::executeQuery($query);
-          }
-        }
-
         $mainCaseIds[] = $mainCaseId;
         //insert record for case contact.
         $otherCaseContact = new CRM_Case_DAO_CaseContact();
@@ -2942,7 +2920,7 @@ WHERE id IN (' . implode(',', $copiedActivityIds) . ')';
    */
   public static function createCaseViewsQuery($section = 'upcoming') {
     $sql = "";
-    $scheduled_id = CRM_Core_Pseudoconstant::getKey('CRM_Activity_BAO_Activity', 'activity_status_id', 'Scheduled');
+    $scheduled_id = CRM_Core_PseudoConstant::getKey('CRM_Activity_BAO_Activity', 'activity_status_id', 'Scheduled');
     switch ($section) {
       case 'upcoming':
         $sql = "CREATE OR REPLACE VIEW `civicrm_view_case_activity_upcoming`