Skip to content

Commit

Permalink
actually support to include multiple articles at the same time
Browse files Browse the repository at this point in the history
  • Loading branch information
ruz committed Aug 18, 2023
1 parent cc8369b commit 26462e1
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions share/html/Elements/MessageBox
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,9 @@
<div class="col-12">
% }
<textarea autocomplete="off" class="form-control messagebox <% $Type eq 'text/html' ? 'richtext' : '' %>" <% $SuppressAttachmentWarning ? 'suppress-attachment-warning' : '' %> <% $width_attr %>="<% $Width %>" rows="<% $Height %>" <% $wrap_type |n %> name="<% $Name %>" id="<% $Name %>" placeholder="<% $Placeholder %>">
% $m->comp('/Articles/Elements/IncludeArticle', %ARGS, IncludeArticleId => $article_id, QueueObj => $QueueObj) if $IncludeArticle;
% if ($IncludeArticle) {
% $m->comp('/Articles/Elements/IncludeArticle', %ARGS, IncludeArticleId => $_, QueueObj => $QueueObj) for @article_id;
% }
% $m->callback( %ARGS, SignatureRef => \$signature, DefaultRef => \$Default, MessageRef => \$message );
% if (RT->Config->Get("SignatureAboveQuote", $session{'CurrentUser'})) {
<% $Default || '' %><% $signature %><% $message %></textarea>
Expand Down Expand Up @@ -136,16 +138,16 @@ if ( $IncludeSignature and $signature =~ /\S/ ) {
$signature = '';
}

my $article_id;
my @article_id;
if ( $IncludeDefaultArticle && defined $QueueObj && $QueueObj->Id ) {
# Load a default article
$article_id = $QueueObj->DefaultValue('Article') if $QueueObj->DefaultValue('Article');
}
else {
# Load from the page, if provided
$article_id = $ARGS{'IncludeArticleId'} if $ARGS{'IncludeArticleId'};
push @article_id, $QueueObj->DefaultValue('Article')
if $QueueObj->DefaultValue('Article');
}

# Load from the page, if provided
push @article_id, grep $_, @IncludeArticleId;

# wrap="something" seems to really break IE + richtext
my $wrap_type = $Type eq 'text/html' ? '' : 'wrap="soft"';

Expand All @@ -168,6 +170,7 @@ $Width => RT->Config->Get('MessageBoxWidth', $session{'Curre
$Height => RT->Config->Get('MessageBoxHeight', $session{'CurrentUser'} ) || 15
$IncludeSignature => RT->Config->Get('MessageBoxIncludeSignature');
$IncludeArticle => 1;
@IncludeArticleId => ();
$Type => RT->Config->Get('MessageBoxRichText', $session{'CurrentUser'}) ? 'text/html' : 'text/plain';
$SuppressAttachmentWarning => 0
$Placeholder => loc('Type your message here')
Expand Down

0 comments on commit 26462e1

Please sign in to comment.