Additional changes and notices fix for CRM-15540
authorRohan Katkar <rohan.katkar@webaccessglobal.com>
Fri, 31 Oct 2014 07:19:20 +0000 (12:49 +0530)
committerRohan Katkar <rohan.katkar@webaccessglobal.com>
Fri, 31 Oct 2014 07:19:20 +0000 (12:49 +0530)
CRM/Activity/Form/Task/Batch.php

index d5891ee822bb9dd96c1c1da22682521e85cb4c45..5cd91baf545f25574c85ba6cf2b9b3696753abd5 100755 (executable)
@@ -83,6 +83,16 @@ class CRM_Activity_Form_Task_Batch extends CRM_Activity_Form_Task {
     $contactDetails = CRM_Contact_BAO_Contact_Utils::contactDetails($this->_activityHolderIds,
       'Activity', $returnProperties
     );
+    $readOnlyFields['assignee_display_name'] = ts('Assigned To');
+    if(!empty($contactDetails)) {
+      foreach($contactDetails as $key => $value){
+        $assignee = CRM_Activity_BAO_ActivityAssignment::retrieveAssigneeIdsByActivityId($key);
+        foreach($assignee as $keys => $values) {
+          $assigneeContact[] = CRM_Contact_BAO_Contact::displayname($values);
+        }
+        $contactDetails[$key]['assignee_display_name'] = !empty($assigneeContact) ? implode(';', $assigneeContact) : NULL;
+      }
+    }
     $this->assign('contactDetails', $contactDetails);
     $this->assign('readOnlyFields', $readOnlyFields);
   }
@@ -119,7 +129,7 @@ class CRM_Activity_Form_Task_Batch extends CRM_Activity_Form_Task {
       }
 
       //fix to reduce size as we are using this field in grid
-      if (is_array($field['attributes']) && $this->_fields[$name]['attributes']['size'] > 19) {
+      if (is_array($field['attributes']) && !empty($this->_fields[$name]['attributes']['size']) && $this->_fields[$name]['attributes']['size'] > 19) {
         //shrink class to "form-text-medium"
         $this->_fields[$name]['attributes']['size'] = 19;
       }
@@ -232,7 +242,7 @@ class CRM_Activity_Form_Task_Batch extends CRM_Activity_Form_Task {
         );
         $value['id'] = $key;
 
-        if ($value['activity_date_time']) {
+        if (!empty($value['activity_date_time'])) {
           $value['activity_date_time'] = CRM_Utils_Date::processDate($value['activity_date_time'], $value['activity_date_time_time']);
         }