dev/core#770 - View Case Activity page displays disabled custom fields
authorJitendra Purohit <jitendra@fuzion.co.nz>
Fri, 1 Mar 2019 07:09:41 +0000 (12:39 +0530)
committerJitendra Purohit <jitendra@fuzion.co.nz>
Sat, 2 Mar 2019 06:21:29 +0000 (11:51 +0530)
CRM/Case/XMLProcessor/Report.php

index 4adab97876e92e4e5b59d05cffc7e31e8721423c..aa0b6c0b521545846baaed0745c49a2c979f750c 100644 (file)
@@ -581,10 +581,11 @@ WHERE      a.id = %1
   /**
    * @param int $activityTypeID
    * @param null $dateFormat
+   * @param bool $onlyActive
    *
    * @return mixed
    */
-  public function getActivityTypeCustomSQL($activityTypeID, $dateFormat = NULL) {
+  public function getActivityTypeCustomSQL($activityTypeID, $dateFormat = NULL, $onlyActive = TRUE) {
     static $cache = array();
 
     if (is_null($activityTypeID)) {
@@ -608,6 +609,9 @@ WHERE  cf.custom_group_id = cg.id
 AND    cg.extends = 'Activity'
 AND " . CRM_Core_Permission::customGroupClause(CRM_Core_Permission::VIEW, 'cg.');
 
+      if ($onlyActive) {
+        $query .= " AND cf.is_active = 1 ";
+      }
       if ($activityTypeID) {
         $query .= "AND ( cg.extends_entity_column_value IS NULL OR cg.extends_entity_column_value LIKE '%" . CRM_Core_DAO::VALUE_SEPARATOR . "%1" . CRM_Core_DAO::VALUE_SEPARATOR . "%' )";
       }