Icons for attachments
authorColeman Watts <coleman@civicrm.org>
Wed, 29 Mar 2017 18:11:36 +0000 (14:11 -0400)
committerColeman Watts <coleman@civicrm.org>
Wed, 29 Mar 2017 18:11:36 +0000 (14:11 -0400)
CRM/Core/BAO/File.php
templates/CRM/Form/attachment.tpl

index b0e5a65a5abf190f922ac26c75517d50f47e40f4..892ef1690f4ac262c33865e3057f0210aedabb63 100644 (file)
@@ -319,6 +319,7 @@ class CRM_Core_BAO_File extends CRM_Core_DAO_File {
       $result['url'] = CRM_Utils_System::url('civicrm/file', "reset=1&id={$dao->cfID}&eid={$dao->entity_id}");
       $result['href'] = "<a href=\"{$result['url']}\">{$result['cleanName']}</a>";
       $result['tag'] = CRM_Core_BAO_EntityTag::getTag($dao->cfID, 'civicrm_file');
+      $result['icon'] = CRM_Utils_File::getIconFromMimeType($dao->mime_type);
       if ($addDeleteArgs) {
         $result['deleteURLArgs'] = self::deleteURLArgs($dao->entity_table, $dao->entity_id, $dao->cfID);
       }
index e0681495504bfca51ec8b2caea166a364a02235f..988796e5360f60c484e8fe510dd775ce86278ee6 100644 (file)
@@ -31,7 +31,7 @@
           {foreach from=$currentAttachmentInfo key=attKey item=attVal}
                 <div id="attachStatusMesg" class="status hiddenElement"></div>
                 <div id="attachFileRecord_{$attVal.fileID}">
-                  <strong><a href="{$attVal.url}">{$attVal.cleanName}</a></strong>
+                  <strong><a href="{$attVal.url}"><i class="crm-i {$attVal.icon}"></i> {$attVal.cleanName}</a></strong>
                   {if $attVal.description}&nbsp;-&nbsp;{$attVal.description}{/if}
                   {if !empty($attVal.tag)}
                     <br />