CRM-12426
authoryashodha <yashodha.chaku@webaccess.co.in>
Mon, 29 Apr 2013 17:52:09 +0000 (23:22 +0530)
committeryashodha <yashodha.chaku@webaccess.co.in>
Mon, 29 Apr 2013 17:52:09 +0000 (23:22 +0530)
CRM/Event/BAO/Event.php

index 759b9cf48fd596608c3013043e53ac083c1b5966..e9c460bd32344605641c5463ab3f22e9c0f1f653 100644 (file)
@@ -1357,6 +1357,7 @@ WHERE civicrm_event.is_active = 1
       $imProviders   = CRM_Core_PseudoConstant::IMProvider();
       //start of code to set the default values
       foreach ($fields as $name => $field) {
+        $skip = FALSE;
         // skip fields that should not be displayed separately
         if ($field['skipDisplay']) {
           continue;
@@ -1532,10 +1533,11 @@ WHERE  id = $cfID
                   $customVal = (float )($params[$name]);
                 }
                 elseif ($dao->data_type == 'Date') {
-                  $date = CRM_Utils_Date::format($params[$name], NULL, 'invalidDate');
-                  if ($date != 'invalidDate') {
-                    $customVal = $date;
+                  $customVal = $displayValue = $params[$name];
+                  if (!empty($params[$name . '_time'])) {
+                    $customVal = $displayValue = $params[$name] . ' ' . $params[$name . '_time'];
                   }
+                  $skip = TRUE;
                 }
                 else {
                   $customVal = $params[$name];
@@ -1544,8 +1546,9 @@ WHERE  id = $cfID
                 $returnProperties = array($name => 1);
                 $query            = new CRM_Contact_BAO_Query($params, $returnProperties, $fields);
                 $options          = &$query->_options;
-                $displayValue     = CRM_Core_BAO_CustomField::getDisplayValue($customVal, $cfID, $options);
-
+                if (!$skip) {
+                  $displayValue     = CRM_Core_BAO_CustomField::getDisplayValue($customVal, $cfID, $options);
+                }
                 //Hack since we dont have function to check empty.
                 //FIXME in 2.3 using crmIsEmptyArray()
                 $customValue = TRUE;