Commit 7105be6c authored by Alex Vandiver's avatar Alex Vandiver
Browse files

Merge branch '4.2/admin-formatting-columnmap' into 4.2-trunk

parents ba7d5316 b98d0463
......@@ -2943,22 +2943,22 @@ Set(%AdminSearchResultFormat,
Queues =>
q{'<a href="__WebPath__/Admin/Queues/Modify.html?id=__id__">__id__</a>/TITLE:#'}
.q{,'<a href="__WebPath__/Admin/Queues/Modify.html?id=__id__">__Name__</a>/TITLE:Name'}
.q{,__Description__,__Address__,__Priority__,__DefaultDueIn__,__Disabled__,__Lifecycle__},
.q{,__Description__,__Address__,__Priority__,__DefaultDueIn__,__Lifecycle__,__SubjectTag__,__Disabled__},
Groups =>
q{'<a href="__WebPath__/Admin/Groups/Modify.html?id=__id__">__id__</a>/TITLE:#'}
.q{,'<a href="__WebPath__/Admin/Groups/Modify.html?id=__id__">__Name__</a>/TITLE:Name'}
.q{,'__Description__'},
.q{,'__Description__',__Disabled__},
Users =>
q{'<a href="__WebPath__/Admin/Users/Modify.html?id=__id__">__id__</a>/TITLE:#'}
.q{,'<a href="__WebPath__/Admin/Users/Modify.html?id=__id__">__Name__</a>/TITLE:Name'}
.q{,__RealName__, __EmailAddress__},
.q{,__RealName__, __EmailAddress__,__Disabled__},
CustomFields =>
q{'<a href="__WebPath__/Admin/CustomFields/Modify.html?id=__id__">__id__</a>/TITLE:#'}
.q{,'<a href="__WebPath__/Admin/CustomFields/Modify.html?id=__id__">__Name__</a>/TITLE:Name'}
.q{,__AddedTo__, __FriendlyType__, __FriendlyPattern__},
.q{,__AddedTo__, __FriendlyType__, __FriendlyPattern__,__Disabled__},
Scrips =>
q{'<a href="__WebPath__/Admin/Scrips/Modify.html?id=__id____From__">__id__</a>/TITLE:#'}
......@@ -2972,7 +2972,7 @@ Set(%AdminSearchResultFormat,
Classes =>
q{ '<a href="__WebPath__/Admin/Articles/Classes/Modify.html?id=__id__">__id__</a>/TITLE:#'}
.q{,'<a href="__WebPath__/Admin/Articles/Classes/Modify.html?id=__id__">__Name__</a>/TITLE:Name'}
.q{,__Description__},
.q{,__Description__,__Disabled__},
);
=back
......
......@@ -49,24 +49,7 @@
<& /Elements/Tabs &>
% my $tmp = RT::CustomField->new( $session{'CurrentUser'} );
% if ( $Type ) {
<h2><% loc("Custom Fields for [_1]", $tmp->FriendlyLookupType( $Type )) %></h2>
% }
<& /Elements/CollectionList,
OrderBy => 'LookupType|Name',
Order => 'ASC|ASC',
Rows => 50,
%ARGS,
Collection => $CustomFields,
Format => $Format,
DisplayFormat => ($Type? '' : '__FriendlyLookupType__,'). $Format,
AllowSorting => 1,
PassArguments => [
qw(Format Rows Page Order OrderBy),
qw(Type ShowDisabled)
],
&>
<h1><% $Type ? loc("Custom Fields for [_1]", $Type) : loc('All Custom Fields') %></h1>
<form action="<%RT->Config->Get('WebPath')%>/Admin/CustomFields/index.html" method="get">
<&|/l&>Only show custom fields for:</&>
......@@ -83,9 +66,24 @@
% $m->callback(CallbackName => 'BeforeSubmit');
<input type="submit" value="<% loc('Go!') %>" />
<div align="right"><input type="submit" value="<% loc('Go!') %>" /></div>
</form>
<& /Elements/CollectionList,
OrderBy => 'LookupType|Name',
Order => 'ASC|ASC',
Rows => 50,
%ARGS,
Collection => $CustomFields,
Format => $Format,
DisplayFormat => ($Type? '' : '__FriendlyLookupType__,'). $Format,
AllowSorting => 1,
PassArguments => [
qw(Format Rows Page Order OrderBy),
qw(Type ShowDisabled)
],
&>
<%args>
$Type => ''
$ShowDisabled => 0
......
......@@ -48,9 +48,28 @@
<& /Admin/Elements/Header, Title => loc("Admin queues") &>
<& /Elements/Tabs &>
<h1><%$caption%></h1>
<form method="post" action="<% RT->Config->Get('WebPath') %>/Admin/Queues/index.html">
% foreach my $field( qw(Format Rows Page Order OrderBy) ) {
% next unless defined $ARGS{ $field } && length $ARGS{ $field };
<input type="hidden" name="<% $field %>" value="<% $ARGS{ $field } %>" />
% }
<select name="QueueField">
% foreach my $col (qw(Name Description CorrespondAddress CommentAddress InitialPriority FinalPriority DefaultDueIn Lifecycle SubjectTag)) {
<option <% $QueueField eq $col ? 'selected="selected"' : '' |n %> value="<% $col %>"><% loc($col) %></option>
% }
</select>
<& /Elements/SelectMatch, Name => 'QueueOp', Default => $QueueOp &>
<input size="8" name="QueueString" value="<% $QueueString %>" />
<br />
<input type="checkbox" class="checkbox" id="FindDisabledQueues" name="FindDisabledQueues" value="1" <% $FindDisabledQueues? 'checked="checked"': '' |n%> />
<label for="FindDisabledQueues"><&|/l&>Include disabled queues in listing.</&></label>
<div align="right"><input type="submit" class="button" value="<&|/l&>Go!</&>" /></div>
</form>
<h1><%$caption%></h1>
<p><&|/l&>Select a queue</&>:</p>
% unless ( $queues->Count ) {
<em><&|/l&>No queues matching search criteria found.</&></em>
......@@ -69,25 +88,6 @@
)],
&>
% }
<form method="post" action="<% RT->Config->Get('WebPath') %>/Admin/Queues/index.html">
% foreach my $field( qw(Format Rows Page Order OrderBy) ) {
% next unless defined $ARGS{ $field } && length $ARGS{ $field };
<input type="hidden" name="<% $field %>" value="<% $ARGS{ $field } %>" />
% }
<select name="QueueField">
% foreach my $col (qw(Name Description CorrespondAddress CommentAddress InitialPriority FinalPriority DefaultDueIn)) {
<option <% $QueueField eq $col ? 'selected="selected"' : '' |n %> value="<% $col %>"><% loc($col) %></option>
% }
</select>
<& /Elements/SelectMatch, Name => 'QueueOp', Default => $QueueOp &>
<input size="8" name="QueueString" value="<% $QueueString %>" />
<br />
<input type="checkbox" class="checkbox" id="FindDisabledQueues" name="FindDisabledQueues" value="1" <% $FindDisabledQueues? 'checked="checked"': '' |n%> />
<label for="FindDisabledQueues"><&|/l&>Include disabled queues in listing.</&></label>
<div align="right"><input type="submit" class="button" value="<&|/l&>Go!</&>" /></div>
</form>
<%INIT>
my $queues = RT::Queues->new($session{'CurrentUser'});
......@@ -120,6 +120,6 @@ $FindDisabledQueues => 0
$Format => undef
$QueueField => 'Name'
$QueueOp => '='
$QueueOp => 'LIKE'
$QueueString => ''
</%ARGS>
......@@ -62,6 +62,11 @@ my $COLUMN_MAP = {
attribute => 'Description',
value => sub { return $_[0]->Description() },
},
Disabled => {
title => 'Status', # loc
attribute => 'Disabled',
value => sub { return $_[0]->Disabled? $_[0]->loc('Disabled'): $_[0]->loc('Enabled') },
},
};
......
......@@ -53,7 +53,7 @@ $GenericMap => {}
<%ONCE>
my $COLUMN_MAP = {
Disabled => {
title => \'&nbsp;',
title => 'Status', # loc
attribute => 'Disabled',
value => sub { return $_[0]->Disabled? $_[0]->loc('Disabled'): $_[0]->loc('Enabled') },
},
......
......@@ -78,6 +78,10 @@ my $COLUMN_MAP = {
attribute => 'Description',
value => sub { return $_[0]->Description() },
},
Disabled => {
title => 'Status', # loc
value => sub { return $_[0]->Disabled? $_[0]->loc('Disabled'): $_[0]->loc('Enabled') },
},
};
</%ONCE>
......
......@@ -53,7 +53,7 @@ $GenericMap => {}
<%ONCE>
my $COLUMN_MAP = {
Disabled => {
title => \'&nbsp;',
title => 'Status', # loc
attribute => 'Disabled',
value => sub { return $_[0]->Disabled? $_[0]->loc('Disabled'): $_[0]->loc('Enabled') },
},
......
......@@ -107,7 +107,7 @@ my $COLUMN_MAP = {
value => sub { return $_[0]->Description() },
},
Disabled => {
title => \'&nbsp;',
title => 'Status', # loc
attribute => 'Disabled',
value => sub { return $_[0]->Disabled? $_[0]->loc('Disabled'): $_[0]->loc('Enabled') },
},
......
......@@ -142,6 +142,10 @@ my $COLUMN_MAP = {
attribute => 'FreeformContactInfo',
value => sub { return $_[0]->FreeformContactInfo() },
},
Disabled => {
title => 'Status', # loc
value => sub { return $_[0]->Disabled? $_[0]->loc('Disabled'): $_[0]->loc('Enabled') },
},
};
</%ONCE>
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment