From e131b1f71f08b69abb832c1687d1f29682d171f8 Mon Sep 17 00:00:00 2001 From: Ivan Kohler Date: Thu, 9 Jul 2015 22:18:55 -0700 Subject: RT 4.2.11, ticket#13852 --- rt/share/html/Admin/Articles/Classes/Modify.html | 66 +++++++++++++++++++---- rt/share/html/Admin/Articles/Classes/Objects.html | 11 ++-- rt/share/html/Admin/Articles/Classes/index.html | 5 +- 3 files changed, 66 insertions(+), 16 deletions(-) (limited to 'rt/share/html/Admin/Articles/Classes') diff --git a/rt/share/html/Admin/Articles/Classes/Modify.html b/rt/share/html/Admin/Articles/Classes/Modify.html index 7dcc77945..17a9ae7ae 100644 --- a/rt/share/html/Admin/Articles/Classes/Modify.html +++ b/rt/share/html/Admin/Articles/Classes/Modify.html @@ -68,29 +68,60 @@   -> <&|/l&>Enabled (Unchecking this box disables this class) + + > + +   -> <&|/l&>All Articles in this class should be listed in a dropdown of the ticket reply page + + > + + -

When inserting articles in this class into emails:

+

<&|/l&>When inserting articles in this class into emails:

+% if ( @$subject_cfs ) { +

<&|/l&>Change email subject:

+

<&|/l&>If a Custom Field is selected, the Subject of your outgoing email will be overridden by this article.

+ +<& /Widgets/Form/Select, + Name => 'SubjectOverride', + DefaultLabel => loc('No Subject Override'), + Values => $subject_cfs, + ValuesLabel => $subject_cf_labels, + CurrentValue => $ClassObj->SubjectOverride, +&> +% } + %$m->callback( CallbackName => 'BeforeSubmit', CustomFields => $cfs, ClassObj => $ClassObj ); % if ( $Create ) { @@ -132,8 +163,17 @@ if ($Create) { } if ($ClassObj->Id()) { + + if ($ARGS{SubjectOverride}) { + $ARGS{SubjectOverride} = $m->comp('/Widgets/Form/Select:Process', + Arguments => \%ARGS, + Name => 'SubjectOverride', + DefaultValue => (''), + ); + } + $ARGS{HotList} ||= 0 if $Submitted; - my @attribs= qw(Description Name HotList); + my @attribs= qw(Description Name HotList SubjectOverride); $m->callback( CallbackName => 'AttributeList', Attributes => \@attribs, ARGSRef => \%ARGS ); push @results, UpdateRecordObject( AttributesRef => \@attribs, Object => $ClassObj, @@ -148,11 +188,17 @@ if ((defined $Enabled && $Enabled == 1) or (not defined $Enabled and $Create)) { } my %include = (Name => 1, Summary => 1); +my $subject_cfs = []; +my $subject_cf_labels = {}; my $cfs; if ( $ClassObj->id ) { $cfs = $ClassObj->ArticleCustomFields; - $include{"CF-Title-".$_->Id} = $include{"CF-Value-".$_->Id} = 1 while $_ = $cfs->Next; + while ( my $cf = $cfs->Next ) { + $include{"CF-Title-".$cf->Id} = $include{"CF-Value-".$cf->Id} = 1; + push @$subject_cfs,$cf->Id; + $subject_cf_labels->{$cf->Id} = $cf->Name; + } } if ( $ClassObj->id && $Submitted ) { diff --git a/rt/share/html/Admin/Articles/Classes/Objects.html b/rt/share/html/Admin/Articles/Classes/Objects.html index 62c57256b..37a3617d5 100644 --- a/rt/share/html/Admin/Articles/Classes/Objects.html +++ b/rt/share/html/Admin/Articles/Classes/Objects.html @@ -54,13 +54,13 @@ % if ( $is_global ) {

<&|/l&>Applies to all objects

- -<&|/l&>check this box to remove this Class globally and be able to choose specific Queues. + + % } else {

<&|/l&>Apply globally

- -<&|/l&>check this box to apply this Class globally to all Queues. + +

<&|/l&>Selected Queues

<& /Elements/CollectionList, @@ -85,7 +85,7 @@ Order => 'ASC', %ARGS, Collection => $not_applied, - Rows => 50, + Rows => $rows, Format => $format, DisplayFormat => "'__CheckBox.{AddClass-". $Class->id ."}__',". $format, AllowSorting => 1, @@ -143,6 +143,7 @@ $collection_class =~ s/^RT:://; my $format = RT->Config->Get('AdminSearchResultFormat')->{$collection_class} || '__id__,__Name__'; +my $rows = RT->Config->Get('AdminSearchResultRows')->{$collection_class} || 50; my $title = loc('Modify associated objects for [_1]', $Class->Name); diff --git a/rt/share/html/Admin/Articles/Classes/index.html b/rt/share/html/Admin/Articles/Classes/index.html index 97d77c6e7..6158bcbfa 100644 --- a/rt/share/html/Admin/Articles/Classes/index.html +++ b/rt/share/html/Admin/Articles/Classes/index.html @@ -56,6 +56,7 @@ <& /Elements/CollectionList, OrderBy => 'Name', Order => 'ASC', + Rows => $Rows, %ARGS, Format => $Format, Collection => $Classes, @@ -65,7 +66,8 @@ % }
-<&|/l&>Include disabled classes in listing.
+ +
<%INIT> @@ -83,6 +85,7 @@ if ($FindDisabledClasses) { } $Format ||= RT->Config->Get('AdminSearchResultFormat')->{'Classes'}; +my $Rows = RT->Config->Get('AdminSearchResultRows')->{'Classes'} || 50; <%ARGS> -- cgit v1.2.1