[Rt-commit] rt branch, 4.4/hide-onetime-cc-suggestions, repushed
Dustin Graves
dustin at bestpractical.com
Mon Aug 15 17:28:54 EDT 2016
The branch 4.4/hide-onetime-cc-suggestions was deleted and repushed:
was 4aa70abe8ee65ee0c13c33fd7bc438b96325dadf
now 89381b7c9d58a5efbd7f32bd6e869e9fe740149e
1: 4aa70ab ! 1: 89381b7 add config option HideCcSuggestions to hide one-time Cc and Bcc email addresses
@@ -12,11 +12,11 @@
+++ b/etc/RT_Config.pm.in
@@
- =back
+ Set($StatementLog, undef);
-+=item C<$HideCcSuggestions>
++=item C<$HideOneTimeSuggestions>
+
-+One ticket comment and correspond there are "One-time Cc" and "One-time Bcc"
++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.
@@ -27,27 +27,14 @@
+
+=cut
+
-+Set($HideCcSuggestions, 0);
++Set($HideOneTimeSuggestions, 0);
+
-+=back
-+
+ =back
+
+
=cut
1;
-
-diff --git a/share/html/Elements/JavascriptConfig b/share/html/Elements/JavascriptConfig
---- a/share/html/Elements/JavascriptConfig
-+++ b/share/html/Elements/JavascriptConfig
-@@
- loading => "Loading...", #loc
- try_again => "Try again", #loc
- history_scroll_error => "Could not load ticket history. Reason:", #loc
-+ hide_suggestions => "hide suggestions", #loc
-+ show_suggestions => "show suggestions", #loc
- };
- $_ = loc($_) for values %$Catalog;
-
diff --git a/share/html/Ticket/Elements/UpdateCc b/share/html/Ticket/Elements/UpdateCc
--- a/share/html/Ticket/Elements/UpdateCc
@@ -57,10 +44,10 @@
%if (scalar @one_time_Ccs) {
+% if ($hide_cc_suggestions) {
-+ <a href="#" class="ToggleSuggestions">
++ <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" style="display:none">
++ <div class="OneTimeCcs hidden">
+% }
<i class="label">(<&|/l&>check to add</&>)</i>
%}
@@ -69,17 +56,17 @@
<% $ARGS{'UpdateCc-'.$addr} ? 'checked="checked"' : ''%> >
<label for="UpdateCc-<%$addr%>"><& /Elements/ShowUser, Address => $txn_addresses{$addr}&></label>
%}
-+%if (scalar @one_time_Ccs && $hide_cc_suggestions) {
++%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">
++ <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" style="display:none">
++ <div class="OneTimeCcs hidden">
+% }
<i class="label">(<&|/l&>check to add</&>)</i>
%}
@@ -88,7 +75,7 @@
<% $ARGS{'UpdateBcc-'.$addr} ? 'checked="checked"' : ''%> >
<label for="UpdateBcc-<%$addr%>"><& /Elements/ShowUser, Address => $txn_addresses{$addr}&></label>
%}
-+%if (scalar @one_time_Ccs && $hide_cc_suggestions) {
++%if (@one_time_Ccs && $hide_cc_suggestions) {
+</div>
+<script type="text/javascript">
+jQuery(function() {
@@ -96,9 +83,9 @@
+ e.preventDefault();
+ var toggleSuggestions = jQuery(this);
+ var oneTimeCcs = toggleSuggestions.closest('td').find('.OneTimeCcs');
-+ oneTimeCcs.toggle();
-+ var hideOrShow = (oneTimeCcs.is(":visible") ? 'hide' : 'show') + '_suggestions';
-+ toggleSuggestions.find('i').html('(' + loc_key(hideOrShow) + ')');
++ oneTimeCcs.toggleClass('hidden');
++ var hideOrShow = oneTimeCcs.hasClass('hidden') ? toggleSuggestions.data('showLabel') : toggleSuggestions.data('hideLabel');
++ toggleSuggestions.find('i').html('(' + hideOrShow + ')');
+ });
+});
+</script>
@@ -111,5 +98,7 @@
push @one_time_Ccs,$addr;
}
+
-+my $hide_cc_suggestions = RT->Config->Get('HideCcSuggestions', $session{CurrentUser});
++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>
More information about the rt-commit
mailing list