[Rt-commit] rt branch, 4.4-trunk, updated. rt-4.4.1-105-gad59123

Shawn Moore shawn at bestpractical.com
Fri Aug 19 17:18:40 EDT 2016


The branch, 4.4-trunk has been updated
       via  ad59123af04971e43f13da0de457db65d63b5429 (commit)
       via  5f4c8a2e4311ade309d109cb59682fa8ac0c3f6d (commit)
      from  6df28d54e2fd06adfb32b34ec30a90f19b2d521c (commit)

Summary of changes:
 etc/RT_Config.pm.in                 | 16 ++++++++++++++++
 share/html/Ticket/Elements/UpdateCc | 34 ++++++++++++++++++++++++++++++++++
 2 files changed, 50 insertions(+)

- Log -----------------------------------------------------------------
commit 5f4c8a2e4311ade309d109cb59682fa8ac0c3f6d
Author: Dustin Graves <dustin at bestpractical.com>
Date:   Thu Aug 11 22:33:02 2016 +0000

    add config option HideOneTimeSuggestions to hide one-time Cc and Bcc email addresses
    
    this encapsulates the list of email addresses in a toggleable div with
    (show suggestions) and (hide suggestions) links
    
    Fixes: T#168228

diff --git a/etc/RT_Config.pm.in b/etc/RT_Config.pm.in
index 705c6c9..4627f22 100644
--- a/etc/RT_Config.pm.in
+++ b/etc/RT_Config.pm.in
@@ -3864,8 +3864,24 @@ Admin -> Tools menu for SuperUsers.
 
 Set($StatementLog, undef);
 
+=item C<$HideOneTimeSuggestions>
+
+On ticket comment and correspond there are "One-time Cc" and "One-time Bcc"
+fields. As part of this section, RT includes a list of suggested email
+addresses based on the correspondence history for that ticket. This list may
+grow quite large over time.
+
+Enabling this option will hide the list behind a "(show suggestions)" link to
+cut down on page clutter. Once this option is clicked the link will change to
+"(hide suggestions)" and the full list of email addresses will be shown.
+
+=cut
+
+Set($HideOneTimeSuggestions, 0);
+
 =back
 
+
 =cut
 
 1;
diff --git a/share/html/Ticket/Elements/UpdateCc b/share/html/Ticket/Elements/UpdateCc
index c7d2637..641fa33 100644
--- a/share/html/Ticket/Elements/UpdateCc
+++ b/share/html/Ticket/Elements/UpdateCc
@@ -52,6 +52,12 @@
         <br />
 
 %if (scalar @one_time_Ccs) {
+%   if ($hide_cc_suggestions) {
+        <a href="#" class="ToggleSuggestions" data-hide-label="<% $hide_label %>" data-show-label="<% $show_label %>">
+            <i class="label">(<&|/l&>show suggestions</&>)</i>
+        </a>
+        <div class="OneTimeCcs hidden">
+%   }
 <i class="label">(<&|/l&>check to add</&>)</i>
 %}
 %foreach my $addr ( @one_time_Ccs ) {
@@ -65,9 +71,18 @@
     <% $ARGS{'UpdateCc-'.$addr} ? 'checked="checked"' : ''%> >
       <label for="UpdateCc-<%$addr%>"><& /Elements/ShowUser, Address => $txn_addresses{$addr}&></label>
 %}
+%if (@one_time_Ccs && $hide_cc_suggestions) {
+</div>
+%}
 </td></tr>
 <tr><td class="label"><&|/l&>One-time Bcc</&>:</td><td><& /Elements/EmailInput, Name => 'UpdateBcc', Size => undef, Default => $ARGS{UpdateBcc}, AutocompleteMultiple => 1 &><br />
 %if (scalar @one_time_Ccs) {
+%   if ($hide_cc_suggestions) {
+        <a href="#" class="ToggleSuggestions" data-hide-label="<% $hide_label %>" data-show-label="<% $show_label %>">
+            <i class="label">(<&|/l&>show suggestions</&>)</i>
+        </a>
+        <div class="OneTimeCcs hidden">
+%   }
 <i class="label">(<&|/l&>check to add</&>)</i>
 %}
 %foreach my $addr ( @one_time_Ccs ) {
@@ -81,6 +96,21 @@
     <% $ARGS{'UpdateBcc-'.$addr} ? 'checked="checked"' : ''%> >
       <label for="UpdateBcc-<%$addr%>"><& /Elements/ShowUser, Address => $txn_addresses{$addr}&></label>
 %}
+%if (@one_time_Ccs && $hide_cc_suggestions) {
+</div>
+<script type="text/javascript">
+jQuery(function() {
+    jQuery('a.ToggleSuggestions').click(function(e) {
+        e.preventDefault();
+        var toggleSuggestions = jQuery(this);
+        var oneTimeCcs = toggleSuggestions.closest('td').find('.OneTimeCcs');
+        oneTimeCcs.toggleClass('hidden');
+        var hideOrShow = oneTimeCcs.hasClass('hidden') ? toggleSuggestions.data('showLabel') : toggleSuggestions.data('hideLabel');
+        toggleSuggestions.find('i').html('(' + hideOrShow + ')');
+    });
+});
+</script>
+%}
 </td></tr>
 <%args>
 $TicketObj
@@ -100,4 +130,8 @@ foreach my $addr ( keys %txn_addresses) {
   next if ( grep {$addr eq lc $_->address} @people_addresses );
   push @one_time_Ccs,$addr;
 }
+
+my $hide_cc_suggestions =  RT->Config->Get('HideOneTimeSuggestions', $session{CurrentUser});
+my $show_label    = $m->interp->apply_escapes( loc("show suggestions"), 'h' );
+my $hide_label    = $m->interp->apply_escapes( loc("hide suggestions"), 'h' );
 </%init>

commit ad59123af04971e43f13da0de457db65d63b5429
Merge: 6df28d5 5f4c8a2
Author: Shawn M Moore <shawn at bestpractical.com>
Date:   Fri Aug 19 21:14:32 2016 +0000

    Merge branch '4.4/hide-onetime-cc-suggestions' into 4.4-trunk


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


More information about the rt-commit mailing list