[Rt-commit] rt branch, 4.4/attachments-list, updated. rt-4.4.0-53-g61fb65e

Shawn Moore shawn at bestpractical.com
Fri May 6 11:27:12 EDT 2016


The branch, 4.4/attachments-list has been updated
       via  61fb65e4edad319d11cb63ecbbbb1dc4a9809a47 (commit)
      from  588482ffa00995302a466c1ba25403f930ae1ac6 (commit)

Summary of changes:
 share/html/Ticket/Elements/AddAttachments | 15 ++++++++++++++-
 1 file changed, 14 insertions(+), 1 deletion(-)

- Log -----------------------------------------------------------------
commit 61fb65e4edad319d11cb63ecbbbb1dc4a9809a47
Author: Shawn M Moore <shawn at bestpractical.com>
Date:   Fri May 6 11:26:57 2016 -0400

    Only show "include attachments" if we have attachments

diff --git a/share/html/Ticket/Elements/AddAttachments b/share/html/Ticket/Elements/AddAttachments
index fb4ec23..4bbc0bc 100644
--- a/share/html/Ticket/Elements/AddAttachments
+++ b/share/html/Ticket/Elements/AddAttachments
@@ -163,7 +163,7 @@ jQuery( function() {
         </div>
     </td>
 </tr>
-% if ($TicketObj && $TicketObj->id) {
+% if ($HasExisting) {
 <tr>
   <td class="label" valign="top"><&|/l&>Include attachments</&>:</td>
   <td id="reuse-attachments">
@@ -189,4 +189,17 @@ my $attachments;
 if ( exists $session{'Attachments'}{ $Token } && keys %{ $session{'Attachments'}{ $Token } } ) {
     $attachments = $session{'Attachments'}{ $Token };
 }
+
+my $HasExisting = 0;
+
+if ($TicketObj && $TicketObj->id) {
+    my $Existing = $Ticket->Attachments;
+    $Existing = $Attachments->Clone;
+    $Existing->Limit(
+        FIELD    => 'Filename',
+        OPERATOR => '!=',
+        VALUE    => '',
+    );
+    $HasExisting if $Existing->Count;
+}
 </%INIT>

-----------------------------------------------------------------------


More information about the rt-commit mailing list