From 6454484c7cdc37dd18d7e0f582f81b4ec477d4d7 Mon Sep 17 00:00:00 2001 From: "deb.monish" Date: Mon, 15 Jan 2018 11:15:47 +0530 Subject: [PATCH] CRM-21654: Support custom file field on Batch Entry Profile --- CRM/Batch/Form/Entry.php | 5 +---- templates/CRM/Batch/Form/Entry.tpl | 7 ++++++- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/CRM/Batch/Form/Entry.php b/CRM/Batch/Form/Entry.php index 1934bcc60f..7e58b23d08 100644 --- a/CRM/Batch/Form/Entry.php +++ b/CRM/Batch/Form/Entry.php @@ -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]); } diff --git a/templates/CRM/Batch/Form/Entry.tpl b/templates/CRM/Batch/Form/Entry.tpl index 573db8755f..017938abdc 100644 --- a/templates/CRM/Batch/Form/Entry.tpl +++ b/templates/CRM/Batch/Form/Entry.tpl @@ -118,7 +118,12 @@ {/if} {else} -
{$form.field.$rowNumber.$n.html}
+
+ {$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} +
{/if} {/foreach} -- 2.25.1