CRM-21654: Support custom file field on Batch Entry Profile
authordeb.monish <monish.deb@jmaconsulting.biz>
Mon, 15 Jan 2018 05:45:47 +0000 (11:15 +0530)
committerdeb.monish <monish.deb@jmaconsulting.biz>
Fri, 9 Feb 2018 03:35:39 +0000 (09:05 +0530)
CRM/Batch/Form/Entry.php
templates/CRM/Batch/Form/Entry.tpl

index 1934bcc60f6e623e0ff9b57c348e68936e4c7954..7e58b23d08c29c86b0a023bb5ca736c61268ee81 100644 (file)
@@ -153,11 +153,8 @@ class CRM_Batch_Form_Entry extends CRM_Core_Form {
 
     // remove file type field and then limit fields
     $suppressFields = FALSE;
-    $removehtmlTypes = array('File');
     foreach ($this->_fields as $name => $field) {
-      if ($cfID = CRM_Core_BAO_CustomField::getKeyID($name) &&
-        in_array($this->_fields[$name]['html_type'], $removehtmlTypes)
-      ) {
+      if ($cfID = CRM_Core_BAO_CustomField::getKeyID($name) && $this->_fields[$name]['html_type'] == 'Autocomplete-Select') {
         $suppressFields = TRUE;
         unset($this->_fields[$name]);
       }
index 573db8755f5cccb0f27faebe1f013009ee25bf98..017938abdc992c36b4ea8f05859ec5ae9785281c 100644 (file)
                {/if}
              </div>
           {else}
-            <div class="compressed crm-grid-cell">{$form.field.$rowNumber.$n.html}</div>
+            <div class="compressed crm-grid-cell">
+              {$form.field.$rowNumber.$n.html}
+              {if $fields.$n.html_type eq 'File' && !empty($form.field.$rowNumber.$fieldName.value.size)}
+                {ts}Attached{/ts}: {$form.field.$rowNumber.$fieldName.value.name}
+              {/if}
+            </div>
           {/if}
         {/foreach}
       </div>