Merge pull request #1406 from kurund/webtest-fixes
[civicrm-core.git] / CRM / Case / BAO / Case.php
index 904e0bee92ecb874972c1443dde3da9c624f0f59..96eb28eb6b225ead557e322458ad36a63e22ba5a 100644 (file)
@@ -34,7 +34,7 @@
  */
 
 /**
- * This class contains the funtions for Case Management
+ * This class contains the functions for Case Management
  *
  */
 class CRM_Case_BAO_Case extends CRM_Case_DAO_Case {
@@ -1604,7 +1604,7 @@ SELECT case_status.label AS case_status, status_id, case_type.label AS case_type
   }
 
   /**
-   * Function to retrive the scheduled activity type and date
+   * Function to retrieve the scheduled activity type and date
    *
    * @param  array $cases  Array of contact and case id
    *
@@ -1814,7 +1814,7 @@ SELECT case_status.label AS case_status, status_id, case_type.label AS case_type
    *
    * @param int $caseID case id
    * @param int $relationshipId relationship id
-   * @param int $relContactId case role assigne contactId.
+   * @param int $relContactId case role assignee contactId.
    *
    * @return void on success creates activity and case activity
    *
@@ -3216,5 +3216,25 @@ WHERE id IN (' . implode(',', $copiedActivityIds) . ')';
 
     return $clients;
   }
+
+  /**
+   * Get options for a given case field.
+   * @see CRM_Core_DAO::buildOptions
+   *
+   * @param String $fieldName
+   * @param String $context: @see CRM_Core_DAO::buildOptionsContext
+   * @param Array  $props: whatever is known about this dao object
+   */
+  public static function buildOptions($fieldName, $context = NULL, $props = array()) {
+    $className = __CLASS__;
+    $params = array();
+    switch ($fieldName) {
+      // This field is not part of this object but the api supports it
+      case 'medium_id':
+        $className = 'CRM_Activity_BAO_Activity';
+        break;
+    }
+    return CRM_Core_PseudoConstant::get($className, $fieldName, $params, $context);
+  }
 }