diff options
Diffstat (limited to 'rt/share/html/Admin/Articles')
-rw-r--r-- | rt/share/html/Admin/Articles/Classes/Modify.html | 66 | ||||
-rw-r--r-- | rt/share/html/Admin/Articles/Classes/Objects.html | 11 | ||||
-rw-r--r-- | rt/share/html/Admin/Articles/Classes/index.html | 5 | ||||
-rw-r--r-- | rt/share/html/Admin/Articles/index.html | 2 |
4 files changed, 67 insertions, 17 deletions
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 @@ </tr> <tr> <td> </td> -<td><input type="checkbox" name="Enabled" value="1" <%$EnabledChecked%>> <&|/l&>Enabled (Unchecking this box disables this class)</&></td> +<td> + <input type="checkbox" id="Enabled" name="Enabled" value="1" <%$EnabledChecked%>> + <label for="Enabled"><&|/l&>Enabled (Unchecking this box disables this class)</&></label> +</td> </tr> <tr> <td> </td> -<td><input type="checkbox" name="HotList" value="1" <%$HotListChecked%>> <&|/l&>All Articles in this class should be listed in a dropdown of the ticket reply page</&></td> +<td> + <input type="checkbox" id="HotList" name="HotList" value="1" <%$HotListChecked%>> + <label for="HotList"><&|/l&>All Articles in this class should be listed in a dropdown of the ticket reply page</&></label> +</td> </tr> </table> -<h3>When inserting articles in this class into emails:</h3> +<h3><&|/l&>When inserting articles in this class into emails:</&></h3> <ul> -<li><input type="checkbox" name="Include-Name" value="1" <% $include{Name} %>> Include article name</li> -<li><input type="checkbox" name="Include-Summary" value="1" <% $include{Summary} %>> Include article summary</li> +<li> + <input type="checkbox" id="Include-Name" name="Include-Name" value="1" <% $include{Name} %>> + <label for="Include-Name"><&|/l&>Include article name</&></label> +</li> +<li> + <input type="checkbox" id="Include-Summary" name="Include-Summary" value="1" <% $include{Summary} %>> + <label for="Include-Summary"><&|/l&>Include article summary</&></label> +</li> % if ( $cfs ) { % while (my $cf = $cfs->Next) { -<li>Include custom field '<% $cf->Name %>' +<li><&|/l, $cf->Name &>Include custom field '[_1]'</&> <ul> - <li><input type="checkbox" name="Include-CF-Title-<% $cf->Id %>" <% $include{"CF-Title-".$cf->Id} %> />Title</li> - <li><input type="checkbox" name="Include-CF-Value-<% $cf->Id %>" <% $include{"CF-Value-".$cf->Id} %> />Value</li> + <li> + <input type="checkbox" id="Include-CF-Title-<% $cf->Id %>" name="Include-CF-Title-<% $cf->Id %>" <% $include{"CF-Title-".$cf->Id} %> /> + <label for="Include-CF-Title-<% $cf->Id %>"><&|/l&>Title</&></label> + </li> + <li> + <input type="checkbox" id="Include-CF-Value-<% $cf->Id %>" name="Include-CF-Value-<% $cf->Id %>" <% $include{"CF-Value-".$cf->Id} %> /> + <label for="Include-CF-Value-<% $cf->Id %>"><&|/l&>Value</&></label> + </li> </ul> </li> % } } </ul> +% if ( @$subject_cfs ) { +<h3><&|/l&>Change email subject:</&></h3> +<p><&|/l&>If a Custom Field is selected, the Subject of your outgoing email will be overridden by this article.</&></p> + +<& /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 ) { <h2><&|/l&>Applies to all objects</&></h2> -<input type="checkbox" name="RemoveClass-<% $Class->id %>" value="0" /> -<&|/l&>check this box to remove this Class globally and be able to choose specific Queues.</&> +<input type="checkbox" id="RemoveClass-<% $Class->id %>" name="RemoveClass-<% $Class->id %>" value="0" /> +<label for="RemoveClass-<% $Class->id %>"><&|/l&>check this box to remove this Class globally and be able to choose specific Queues.</&></label> % } else { <h2><&|/l&>Apply globally</&></h2> -<input type="checkbox" name="AddClass-<% $Class->id %>" value="0" /> -<&|/l&>check this box to apply this Class globally to all Queues.</&> +<input type="checkbox" id="AddClass-<% $Class->id %>" name="AddClass-<% $Class->id %>" value="0" /> +<label for="AddClass-<% $Class->id %>"><&|/l&>check this box to apply this Class globally to all Queues.</&></label> <h2><&|/l&>Selected Queues</&></h2> <& /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 @@ % } <form method="post" action="<% RT->Config->Get('WebPath') %>/Admin/Articles/Classes/index.html"> -<input type="checkbox" name="FindDisabledClasses" value="1" /><&|/l&>Include disabled classes in listing.</&><br /> +<input type="checkbox" id="FindDisabledClasses" name="FindDisabledClasses" value="1" /> +<label for="FindDisabledClasses"><&|/l&>Include disabled classes in listing.</&></label><br /> <div align="right"><input type="submit" value="<&|/l&>Go!</&>" /></div> </form> <%INIT> @@ -83,6 +85,7 @@ if ($FindDisabledClasses) { } $Format ||= RT->Config->Get('AdminSearchResultFormat')->{'Classes'}; +my $Rows = RT->Config->Get('AdminSearchResultRows')->{'Classes'} || 50; </%INIT> <%ARGS> diff --git a/rt/share/html/Admin/Articles/index.html b/rt/share/html/Admin/Articles/index.html index 3aabaa965..b3d6a9a4b 100644 --- a/rt/share/html/Admin/Articles/index.html +++ b/rt/share/html/Admin/Articles/index.html @@ -47,4 +47,4 @@ %# END BPS TAGGED BLOCK }}} <& /Elements/Header, Title => loc('Article Administration') &> <& /Elements/Tabs &> -<& /Elements/ListMenu, menu => Menu()->child('tools')->child('config')->child('articles') &> +<& /Elements/ListMenu, menu => Menu()->child('admin')->child('articles') &> |