Merge pull request #10272 from eileenmcnaughton/search_contacts
[civicrm-core.git] / CRM / Case / Audit / Audit.php
index e2b6685a8e9abed8b1a4cc792bae509511d47d44..1928fa4e4383cc5da7686e2a1a4a44ad64cd1a42 100644 (file)
@@ -9,7 +9,7 @@ class CRM_Case_Audit_Audit {
 
   /**
    * @param $xmlString
-   * @param $confFilename
+   * @param string $confFilename
    */
   public function __construct($xmlString, $confFilename) {
     $this->xmlString = $xmlString;
@@ -49,11 +49,11 @@ class CRM_Case_Audit_Audit {
 
         $ifBlankReplacements = array();
 
-        $completed  = FALSE;
+        $completed = FALSE;
         $sortValues = array('1970-01-01');
-        $category   = '';
+        $category = '';
         $fieldindex = 1;
-        $fields     = $activity->getElementsByTagName("Field");
+        $fields = $activity->getElementsByTagName("Field");
         foreach ($fields as $field) {
           $datatype_elements = $field->getElementsByTagName("Type");
           $datatype = $datatype_elements->item(0)->nodeValue;
@@ -99,7 +99,10 @@ class CRM_Case_Audit_Audit {
               //CRM-4570
               if ($printReport) {
                 if (!in_array($label, array(
-                  'Activity Type', 'Status'))) {
+                  'Activity Type',
+                  'Status',
+                ))
+                ) {
                   $caseActivities[$activityindex][$fieldindex] = array();
                   $caseActivities[$activityindex][$fieldindex]['label'] = $label;
                   $caseActivities[$activityindex][$fieldindex]['datatype'] = $datatype;
@@ -182,7 +185,6 @@ class CRM_Case_Audit_Audit {
    *
    * This is intended to be called as a sort callback function, returning whether an activity's date is earlier or later than another's.
    * The type of date to use is specified in the config.
-   *
    */
 
   /**
@@ -199,7 +201,7 @@ class CRM_Case_Audit_Audit {
     }
 
     if ($aval < $bval) {
-      return - 1;
+      return -1;
     }
     elseif ($aval > $bval) {
       return 1;
@@ -210,20 +212,19 @@ class CRM_Case_Audit_Audit {
   }
 
   /**
-   * @param $xmlString
-   * @param $clientID
-   * @param $caseID
+   * @param string $xmlString
+   * @param int $clientID
+   * @param int $caseID
    * @param bool $printReport
    *
    * @return mixed
    */
-  static
-  function run($xmlString, $clientID, $caseID, $printReport = FALSE) {
+  public static function run($xmlString, $clientID, $caseID, $printReport = FALSE) {
     /*
-$fh = fopen('C:/temp/audit2.xml', 'w');
-fwrite($fh, $xmlString);
-fclose($fh);
-*/
+    $fh = fopen('C:/temp/audit2.xml', 'w');
+    fwrite($fh, $xmlString);
+    fclose($fh);
+     */
 
     $audit = new CRM_Case_Audit_Audit($xmlString, 'audit.conf.xml');
     $activities = $audit->getActivities($printReport);
@@ -241,4 +242,5 @@ fclose($fh);
     }
     return $contents;
   }
+
 }