diff --git a/include/class.forms.php b/include/class.forms.php index 1915257b7faf6d3c38480545781f7aca7ffbe821..fc279282a2cfaa6e3137344da144949003594d08 100644 --- a/include/class.forms.php +++ b/include/class.forms.php @@ -3426,7 +3426,7 @@ class FileUploadField extends FormField { function display($value) { $links = array(); foreach ($this->getAttachments() as $a) { - $links[] = sprintf('<a class="no-pjax" href="%s">%s</a>', + $links[] = sprintf('<a class="no-pjax" href="%s"><i class="icon-paperclip icon-flip-horizontal"></i> %s</a>', Format::htmlchars($a->file->getDownloadUrl()), Format::htmlchars($a->getFilename())); } diff --git a/include/staff/ticket-view.inc.php b/include/staff/ticket-view.inc.php index c1747a63f2125fa75e7438ca67d500b83cf76426..a9752bd7492c27ed8a2479556b2f39a6ef0c8324 100644 --- a/include/staff/ticket-view.inc.php +++ b/include/staff/ticket-view.inc.php @@ -598,7 +598,7 @@ foreach (DynamicFormEntry::forTicket($ticket->getId()) as $form) { ))); $displayed = array(); foreach($answers as $a) { - $displayed[] = array($a->getLocal('label'), $a->display() ?: '<span class="faded">—' . __('Empty') . '— </span>', $a->getLocal('id')); + $displayed[] = array($a->getLocal('label'), $a->display() ?: '<span class="faded">—' . __('Empty') . '— </span>', $a->getLocal('id'), ($a->getField() instanceof FileUploadField)); } if (count($displayed) == 0) continue; @@ -610,17 +610,22 @@ foreach (DynamicFormEntry::forTicket($ticket->getId()) as $form) { <tbody> <?php foreach ($displayed as $stuff) { - list($label, $v, $id) = $stuff; + list($label, $v, $id, $isFile) = $stuff; ?> <tr> <td width="200"><?php echo Format::htmlchars($label); ?>:</td> <td> - <?php if ($role->hasPerm(Ticket::PERM_EDIT)) {?> + <?php if ($role->hasPerm(Ticket::PERM_EDIT)) { + $isEmpty = strpos($v, '—'); + if ($isFile && !$isEmpty) + echo $v.'<br>'; ?> <a class="ticket-action" id="inline-update" data-placement="bottom" data-toggle="tooltip" title="<?php echo __('Update'); ?>" data-redirect="tickets.php?id=<?php echo $ticket->getId(); ?>" href="#tickets/<?php echo $ticket->getId(); ?>/field/<?php echo $id; ?>/edit"> <?php - if (strlen($v) > 200) { + if (is_string($v) && $isFile && !$isEmpty) { + echo "<i class=\"icon-edit\"></i>"; + } elseif (strlen($v) > 200) { echo Format::truncate($v, 200); echo "<br><i class=\"icon-edit\"></i>"; }