diff options
author | ivan <ivan> | 2010-05-18 18:49:59 +0000 |
---|---|---|
committer | ivan <ivan> | 2010-05-18 18:49:59 +0000 |
commit | 624b2d44625f69d71175c3348cae635d580c890b (patch) | |
tree | ed57a90db2ecbc72cea6c1d3c175c1dcd1938ab4 /rt/share/html/Admin | |
parent | 7f4aff45cd6ef2f630d538294fa9d9c4db4ac4aa (diff) | |
parent | e70abd21bab68b23488f7ef1ee2e693a3b365691 (diff) |
This commit was generated by cvs2svn to compensate for changes in r9232,
which included commits to RCS files with non-trunk default branches.
Diffstat (limited to 'rt/share/html/Admin')
-rw-r--r-- | rt/share/html/Admin/CustomFields/Objects.html | 152 | ||||
-rw-r--r-- | rt/share/html/Admin/CustomFields/index.html | 58 | ||||
-rwxr-xr-x | rt/share/html/Admin/Elements/EditCustomFields | 213 | ||||
-rwxr-xr-x | rt/share/html/Admin/Elements/EditScrip | 1 | ||||
-rwxr-xr-x | rt/share/html/Admin/Elements/EditScrips | 5 | ||||
-rwxr-xr-x | rt/share/html/Admin/Elements/EditTemplates | 5 | ||||
-rwxr-xr-x | rt/share/html/Admin/Groups/index.html | 5 | ||||
-rwxr-xr-x | rt/share/html/Admin/Queues/Modify.html | 7 | ||||
-rwxr-xr-x | rt/share/html/Admin/Queues/index.html | 6 | ||||
-rw-r--r-- | rt/share/html/Admin/Tools/Configuration.html | 180 | ||||
-rw-r--r-- | rt/share/html/Admin/Users/Memberships.html | 4 | ||||
-rwxr-xr-x | rt/share/html/Admin/Users/index.html | 6 |
12 files changed, 346 insertions, 296 deletions
diff --git a/rt/share/html/Admin/CustomFields/Objects.html b/rt/share/html/Admin/CustomFields/Objects.html index 20d79b294..06e3739b2 100644 --- a/rt/share/html/Admin/CustomFields/Objects.html +++ b/rt/share/html/Admin/CustomFields/Objects.html @@ -56,94 +56,104 @@ <form action="Objects.html" method="post"> <input type="hidden" class="hidden" name="id" value="<% $id %>" /> -<input type="hidden" class="hidden" name="UpdateObjs" value="1" /> + +% if ( $is_global ) { +<h2><&|/l&>Applies to all objects</&></h2> +<input type="checkbox" name="RemoveCustomField-<% $CF->id %>" value="0" /> +<&|/l&>check this box to remove this Custom Field from all objects and be able to choose specific objects.</&> +% } else { +<h2><&|/l&>Apply globally</&></h2> + +<input type="checkbox" name="AddCustomField-<% $CF->id %>" value="0" /> +<&|/l&>check this box to apply this Custom Field to all objects.</&> <h2><&|/l&>Selected objects</&></h2> -<& /Admin/Elements/PickObjects, Objects => \@AssignedObjs, id => $id, Checked => 1 &> -<h2><&|/l&>Unselected objects</&></h2> -<& /Admin/Elements/PickObjects, Objects => \@UnassignedObjs, id => $id &> +<& /Elements/CollectionList, + OrderBy => 'id', + Order => 'ASC', + %ARGS, + Collection => $applied, + Rows => 0, + Page => 1, + Format => $format, + DisplayFormat => "'__CheckBox.{RemoveCustomField-". $CF->id ."}__',". $format, + AllowSorting => 0, + ShowEmpty => 0, + PassArguments => [ + qw(id Format Rows Page Order OrderBy), + ], +&> -<& /Elements/Submit, CheckAll => 1, ClearAll => 1 &> +<h2><&|/l&>Unselected objects</&></h2> +<& /Elements/CollectionList, + OrderBy => 'id', + Order => 'ASC', + %ARGS, + Collection => $not_applied, + Rows => 50, + Format => $format, + DisplayFormat => "'__CheckBox.{AddCustomField-". $CF->id ."}__',". $format, + AllowSorting => 1, + ShowEmpty => 0, + PassArguments => [ + qw(id Format Rows Page Order OrderBy), + ], +&> + +% } + +<& /Elements/Submit, Name => 'UpdateObjs' &> </form> <%INIT> my $CF = RT::CustomField->new($session{'CurrentUser'}); $CF->Load($id) or Abort(loc("Could not load CustomField [_1]"), $id); -my $LookupType = $CF->LookupType || ''; -$LookupType =~ /^([^-]+)/ || - Abort(loc("Object of type [_1] cannot take custom fields", $LookupType)); - -my $Class = $1; -my $CollectionClass; -if (UNIVERSAL::can($Class.'Collection', 'new') ) { -$CollectionClass = $Class.'Collection'; - -} elsif (UNIVERSAL::can($Class.'es', 'new') ) { - $CollectionClass = $Class.'es'; -} elsif (UNIVERSAL::can($Class.'s', 'new') ) { - $CollectionClass = $Class.'s'; - -} else { - Abort(loc("Can't find a collection class for '[_1]'", $Class)); -} - - -my $title = loc('Modify associated objects for [_1]', $CF->Name); +my $class = $CF->RecordClassFromLookupType; +Abort(loc("Something wrong. Contact system administrator")) + unless $class; -my $Objects = $CollectionClass->new($session{'CurrentUser'}); +my (@results); -# If CF is a Group CF, only display user-defined groups -if ($Class eq 'RT::Group') { - $Objects->LimitToUserDefinedGroups; +if ( $UpdateObjs ) { + if ( defined (my $del = $ARGS{'RemoveCustomField-'.$CF->id}) ) { + foreach my $id ( ref $del? (@$del) : ($del) ) { + my $object = $class->new( $session{'CurrentUser'} ); + if ( $id ) { + $object->Load( $id ); + next unless $object->id; + } + + my ($status, $msg) = $CF->RemoveFromObject( $object ); + push @results, $msg; + } + } + if ( defined (my $add = $ARGS{'AddCustomField-'.$CF->id}) ) { + foreach my $id ( ref $add? (@$add) : ($add) ) { + my $object = $class->new( $session{'CurrentUser'} ); + if ( $id ) { + $object->Load( $id ); + next unless $object->id; + } + + my ($status, $msg) = $CF->AddToObject( $object ); + push @results, $msg; + } + } } -my (@results); -my (@AssignedObjs, @UnassignedObjs); - -$Objects->UnLimit; -$Objects->OrderBy( FIELD => 'Name' ); +my $is_global = $CF->IsApplied(0); +my $applied = $CF->AppliedTo; +my $not_applied = $CF->NotAppliedTo; -my $ObjectCFs; -$ObjectCFs = RT::ObjectCustomFields->new($session{'CurrentUser'}); -$ObjectCFs->UnLimit; -$ObjectCFs->LimitToCustomField($id); +my $collection_class = ref($applied); +$collection_class =~ s/^RT:://; -my %seen; -while (my $OCF = $ObjectCFs->Next) { - $seen{$OCF->ObjectId}++; -} +my $format = RT->Config->Get('AdminSearchResultFormat')->{$collection_class} + || '__id__,__Name__'; -while (my $obj = $Objects->Next) { - my $obj_id = $obj->Id; - - if ($UpdateObjs) { - # Go through and delete all the custom field relationships that this object - # no longer has - my $key = "Object-$obj_id-CF-$id"; - if ($ARGS{$key}) { - if (!$seen{$obj_id}) { - my ($val, $msg) = $CF->AddToObject($obj); - push (@results, $msg); - push @UnassignedObjs, $obj if !$val; - } - } - else { - push @UnassignedObjs, $obj; - if ($seen{$obj_id}) { - my ($val, $msg) = $CF->RemoveFromObject($obj); - push (@results, $msg); - pop @UnassignedObjs if !$val; - } - } - } - elsif (!$seen{$obj_id}) { - push @UnassignedObjs, $obj; - } - next if @UnassignedObjs and $UnassignedObjs[-1] == $obj; - push @AssignedObjs, $obj; -} +my $title = loc('Modify associated objects for [_1]', $CF->Name); </%INIT> <%ARGS> diff --git a/rt/share/html/Admin/CustomFields/index.html b/rt/share/html/Admin/CustomFields/index.html index 139b8ebd6..16fb593f6 100644 --- a/rt/share/html/Admin/CustomFields/index.html +++ b/rt/share/html/Admin/CustomFields/index.html @@ -45,40 +45,38 @@ %# those contributions and any derivatives thereof. %# %# END BPS TAGGED BLOCK }}} -<& /Admin/Elements/Header, Title => loc('Select a Custom Field') &> +<& /Admin/Elements/Header, Title => $title &> <& /Admin/Elements/CustomFieldTabs, current_tab => 'Admin/CustomFields/', - Title => loc('Select a Custom Field') &> + Title => $title, +&> -% my @types; -% my $prev_lookup = ''; -% while (my $CustomFieldObj = $CustomFields->Next) { -% next unless $CustomFieldObj->CurrentUserHasRight('AdminCustomField'); -% my $lookup = $CustomFieldObj->FriendlyLookupType; -% if ($lookup ne $prev_lookup) { -% if ($prev_lookup) { -</ul> -% } -<h2><% loc("Custom Fields for [_1]", $lookup) %></h2> -<ul> -% $prev_lookup = $lookup; -% push @types, [$lookup, $CustomFieldObj->LookupType]; -% } -% -<li> -<a href="Modify.html?id=<% $CustomFieldObj->id %>"><% $CustomFieldObj->Name %>: <% $CustomFieldObj->Description %></a> -</li> -% } -% if ($prev_lookup) { -</ul> +% 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) + ], +&> + <form action="<%RT->Config->Get('WebPath')%>/Admin/CustomFields/index.html" method="get"> <&|/l&>Only show custom fields for:</&> <select name="Type"> <option value="" <% !$Type && 'selected="selected"'%> ><% loc('(any)') %></option> -% for (@types) { -<option value="<% $_->[1] %>" <% $_->[1] eq $Type && 'selected="selected"'%> ><% $_->[0] %></option> +% for my $type ( $tmp->LookupTypes ) { +<option value="<% $type %>" <% $type eq $Type && 'selected="selected"'%> ><% $tmp->FriendlyLookupType( $type ) %></option> % } </select> <br /> @@ -92,8 +90,12 @@ <%args> $Type => '' $ShowDisabled => 0 + +$Format => undef </%args> <%INIT> +my $title = loc('Select a Custom Field'); + $Type ||= $ARGS{'type'} || ''; if ( !$Type && $ARGS{'type'} ) { $Type ||= $ARGS{'type'}; @@ -102,7 +104,9 @@ if ( !$Type && $ARGS{'type'} ) { my $CustomFields = RT::CustomFields->new($session{'CurrentUser'}); $CustomFields->UnLimit; -$CustomFields->{'find_disabled_rows'} = 1 if $ShowDisabled; +$CustomFields->FindAllRows if $ShowDisabled; $CustomFields->LimitToLookupType( $Type ) if $Type; -$CustomFields->OrderByCols( { FIELD => 'LookupType' }, { FIELD => 'Name' } ); + +$Format ||= RT->Config->Get('AdminSearchResultFormat')->{'CustomFields'}; + </%INIT> diff --git a/rt/share/html/Admin/Elements/EditCustomFields b/rt/share/html/Admin/Elements/EditCustomFields index 89c6d0f65..0767e4ae4 100755 --- a/rt/share/html/Admin/Elements/EditCustomFields +++ b/rt/share/html/Admin/Elements/EditCustomFields @@ -51,155 +51,126 @@ <input type="hidden" class="hidden" name="id" value="<% $Object->Id || ''%>" /> <input type="hidden" class="hidden" name="ObjectType" value="<% $ObjectType %>" /> <input type="hidden" class="hidden" name="SubType" value="<% $SubType %>" /> -<input type="hidden" class="hidden" name="UpdateCFs" value="1" /> -% if ($Object->Id) { -<h2><&|/l&>Global Custom Fields</&></h2> -<& PickCustomFields, CustomFields => \@GlobalCFs, ReadOnly => 1, id => $id, SubType => $SubType &> -% } <h2><&|/l&>Selected Custom Fields</&></h2> -<& PickCustomFields, CustomFields => [$ObjectCFs->CustomFields], id => $id, Checked => 1, SubType => $SubType &> -<h2><&|/l&>Unselected Custom Fields</&></h2> -<& PickCustomFields, CustomFields => \@UnassignedCFs, id => $id, SubType => $SubType &> +<& /Elements/CollectionList, + %ARGS, + Collection => $applied_cfs, + Rows => 0, + Page => 1, + Format => $format, + DisplayFormat => + $id + ? ("'__RemoveCheckBox.{$id}__',". $format .", '__MoveCF.{$id}__'") + : ("'__CheckBox.{RemoveCustomField}__',". $format .", '__MoveCF.{$id}__'"), + AllowSorting => 0, + ShowEmpty => 0, + PassArguments => [ + qw(Page Order OrderBy), + qw(id ObjectType SubType), + ], +&> -<& /Elements/Submit, CheckAll => 1, ClearAll => 1 &> +<h2><&|/l&>Unselected Custom Fields</&></h2> +<& /Elements/CollectionList, + OrderBy => 'Name', + Order => 'ASC', + %ARGS, + Collection => $not_applied_cfs, + Rows => 50, + Format => $format, + DisplayFormat => "'__CheckBox.{AddCustomField}__',". $format, + AllowSorting => 1, + ShowEmpty => 0, + PassArguments => [ + qw(Page Order OrderBy), + qw(id ObjectType SubType), + ], +&> + +<& /Elements/Submit, Name => 'UpdateCFs' &> </form> <%INIT> -my $CustomFields = RT::CustomFields->new($session{'CurrentUser'}); -my @results; -my (@GlobalCFs, @UnassignedCFs); - -my $id = $Object->Id; +my $id = $Object->Id || 0; if ($id and !$Object->CurrentUserHasRight('AssignCustomFields')) { $m->out('<p><i>', loc('(No custom fields)'), '</i></p>'); return; } +my @results; + my $lookup = $ObjectType; $lookup .= "-$SubType" if $SubType; -$CustomFields->LimitToLookupType($lookup); -$CustomFields->OrderBy( FIELD => 'Name' ); - - -my ($GlobalCFs, $ObjectCFs); -$ObjectCFs = RT::ObjectCustomFields->new($session{'CurrentUser'}); -$ObjectCFs->UnLimit; -$ObjectCFs->LimitToObjectId($id); -$ObjectCFs->LimitToLookupType($lookup); - -# Check sanity of SortOrders -my %SortOrders; -$SortOrders{ $_->SortOrder }++ - while ($_ = $ObjectCFs->Next); - -# If there are duplicates, run though and squash them -if (grep $_ > 1, values %SortOrders) { - my $i = 1; - while ( my $ObjectCF = $ObjectCFs->Next ) { - $ObjectCF->SetSortOrder( $i++ ); +## deal with moving sortorder of custom fields +if ( $MoveCustomFieldUp ) { { + my $record = RT::ObjectCustomField->new( $session{'CurrentUser'} ); + $record->LoadByCols( ObjectId => $id, CustomField => $MoveCustomFieldUp ); + unless ( $record->id ) { + push @results, loc("Custom field #[_1] is not applied to this object", $MoveCustomFieldUp); + last; } - $ObjectCFs->GotoFirstItem; -} - -# {{{ deal with moving sortorder of custom fields -if ($CustomField and $Move) { - my $SourceObj = RT::ObjectCustomField->new($session{'CurrentUser'}); - $SourceObj->LoadByCols( ObjectId => $id, CustomField => $CustomField ); - - my $TargetObj; - my $target_order = $SourceObj->SortOrder + $Move; - while (my $ObjectCF = $ObjectCFs->Next) { - my $this_order = $ObjectCF->SortOrder; - - # if we have an exact match, finish the loop now - ($TargetObj = $ObjectCF, last) if $this_order == $target_order; - - # otherwise, we need to apropos toward the general direction - # ... first, check the sign is correct - next unless ($this_order - $SourceObj->SortOrder) * $Move > 0; - # ... next, see if we already have a candidate - if ($TargetObj) { - # ... if yes, compare the delta and choose the smaller one - my $orig_delta = abs($TargetObj->SortOrder - $target_order); - my $this_delta = abs($this_order - $target_order); - next if $orig_delta < $this_delta; - } - - $TargetObj = $ObjectCF; + my ($status, $msg) = $record->MoveUp; + push @results, $msg; +} } +if ( $MoveCustomFieldDown ) { { + my $record = RT::ObjectCustomField->new( $session{'CurrentUser'} ); + $record->LoadByCols( ObjectId => $id, CustomField => $MoveCustomFieldDown ); + unless ( $record->id ) { + push @results, loc("Custom field #[_1] is not applied to this object", $MoveCustomFieldDown); + last; } - if ($TargetObj) { - # swap their sort order - my ($s, $t) = ($SourceObj->SortOrder, $TargetObj->SortOrder); - $TargetObj->SetSortOrder($s); - $SourceObj->SetSortOrder($t); - # because order changed, we must redo search for subsequent uses + my ($status, $msg) = $record->MoveDown; + push @results, $msg; +} } + +if ( $UpdateCFs ) { + foreach my $cf_id ( @AddCustomField ) { + my $CF = RT::CustomField->new( $session{'CurrentUser'} ); + $CF->Load( $cf_id ); + unless ( $CF->id ) { + push @results, loc("Couldn't load CustomField #[_1]", $cf_id); + next; + } + my ($status, $msg) = $CF->AddToObject( $Object ); + push @results, $msg; + } + foreach my $cf_id ( @RemoveCustomField ) { + my $CF = RT::CustomField->new( $session{'CurrentUser'} ); + $CF->Load( $cf_id ); + unless ( $CF->id ) { + push @results, loc("Couldn't load CustomField #[_1]", $cf_id); + next; + } + my ($status, $msg) = $CF->RemoveFromObject( $Object ); + push @results, $msg; } - - $ObjectCFs->GotoFirstItem; -} -# }}} - -if ($id) { - $GlobalCFs = RT::ObjectCustomFields->new($session{'CurrentUser'}); - $GlobalCFs->LimitToObjectId(0); - $GlobalCFs->LimitToLookupType($lookup); } -while (my $cf = $CustomFields->Next) { - my $cf_id = $cf->Id; +my $applied_cfs = RT::CustomFields->new( $session{'CurrentUser'} ); +$applied_cfs->LimitToLookupType($lookup); +$applied_cfs->LimitToGlobalOrObjectId($id); +$applied_cfs->ApplySortOrder; - if ($GlobalCFs and $GlobalCFs->HasEntryForCustomField($cf_id)) { - push @GlobalCFs, $cf; - next; - } +my $not_applied_cfs = RT::CustomFields->new( $session{'CurrentUser'} ); +$not_applied_cfs->LimitToLookupType($lookup); +$not_applied_cfs->LimitToNotApplied( $id ? ($id, 0) : (0) ); - if ($UpdateCFs) { - # Go through and delete all the custom field relationships that this object - # no longer has - my $key = "Object-$id-CF-$cf_id"; - if ($ARGS{$key}) { - if (!$ObjectCFs->HasEntryForCustomField($cf_id)) { - my ($val, $msg) = $cf->AddToObject($Object); - push (@results, $msg); - push @UnassignedCFs, $cf if !$val; - } - } - else { - push @UnassignedCFs, $cf; - if ($ObjectCFs->HasEntryForCustomField($cf_id)) { - my ($val, $msg) = $cf->RemoveFromObject($Object); - push (@results, $msg); - pop @UnassignedCFs if !$val; - } - } - } - elsif (!$ObjectCFs->HasEntryForCustomField($cf_id)) { - push @UnassignedCFs, $cf; - } - else { - } -} - -# redo search... -$ObjectCFs = RT::ObjectCustomFields->new($session{'CurrentUser'}); -$ObjectCFs->UnLimit; -$ObjectCFs->LimitToObjectId($id); -$ObjectCFs->LimitToLookupType($lookup); +my $format = RT->Config->Get('AdminSearchResultFormat')->{'CustomFields'}; </%INIT> <%ARGS> -$title => undef -$Move => undef -$Source => undef -$CustomField => undef -$FindDisabledCustomFields => undef -$UpdateCFs => 0 $Object $ObjectType $SubType => '' + +$UpdateCFs => undef +@RemoveCustomField => () +@AddCustomField => () +$MoveCustomFieldUp => undef +$MoveCustomFieldDown => undef </%ARGS> diff --git a/rt/share/html/Admin/Elements/EditScrip b/rt/share/html/Admin/Elements/EditScrip index 29ec71cd7..2bcf64d49 100755 --- a/rt/share/html/Admin/Elements/EditScrip +++ b/rt/share/html/Admin/Elements/EditScrip @@ -56,6 +56,7 @@ <tr><td align="right"><&|/l&>Description</&>:</td><td> <input name="Scrip-<% $id %>-Description" + size="60" value="<% $ARGS{"Scrip-$id-Description"} || $scrip->Description || '' %>" /> </td></tr> diff --git a/rt/share/html/Admin/Elements/EditScrips b/rt/share/html/Admin/Elements/EditScrips index df349e1b9..dce0390fd 100755 --- a/rt/share/html/Admin/Elements/EditScrips +++ b/rt/share/html/Admin/Elements/EditScrips @@ -109,10 +109,7 @@ foreach my $id ( grep $_, @DeleteScrip, map /^DeleteScrip-(\d+)/, keys %ARGS ) { } # }}} -my $dir_path = $m->request_comp->dir_path; -$Format ||= qq{'<a href="__WebPath__$dir_path/Scrip.html?id=__id__&Queue=$id">__id__</a>/TITLE:#'} - .qq{,'<a href="__WebPath__$dir_path/Scrip.html?id=__id__&Queue=$id">__Description__</a>/TITLE:Description'} - .q{,__Stage__, __Condition__, __Action__, __Template__}; +$Format ||= RT->Config->Get('AdminSearchResultFormat')->{'Scrips'}; </%init> diff --git a/rt/share/html/Admin/Elements/EditTemplates b/rt/share/html/Admin/Elements/EditTemplates index 0bd68c2c0..7d7d930ce 100755 --- a/rt/share/html/Admin/Elements/EditTemplates +++ b/rt/share/html/Admin/Elements/EditTemplates @@ -73,10 +73,7 @@ </form> <%INIT> -my $dir_path = $m->request_comp->dir_path; -$Format ||= qq{'<a href="__WebPath__$dir_path/Template.html?Queue=$id&Template=__id__">__id__</a>/TITLE:#'} - .qq{,'<a href="__WebPath__$dir_path/Template.html?Queue=$id&Template=__id__">__Name__</a>/TITLE:Name'} - .qq{,'__Description__'}; +$Format ||= RT->Config->Get('AdminSearchResultFormat')->{'Templates'}; my $QueueObj = RT::Queue->new( $session{'CurrentUser'} ); $QueueObj->Load( $id ) if $id; diff --git a/rt/share/html/Admin/Groups/index.html b/rt/share/html/Admin/Groups/index.html index 078f51bd9..17b760c26 100755 --- a/rt/share/html/Admin/Groups/index.html +++ b/rt/share/html/Admin/Groups/index.html @@ -113,10 +113,7 @@ else { $caption = loc("User-defined groups"); } - -$Format ||= 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__'}; +$Format ||= RT->Config->Get('AdminSearchResultFormat')->{'Groups'}; </%INIT> <%ARGS> diff --git a/rt/share/html/Admin/Queues/Modify.html b/rt/share/html/Admin/Queues/Modify.html index df97a68c7..c6ffe179f 100755 --- a/rt/share/html/Admin/Queues/Modify.html +++ b/rt/share/html/Admin/Queues/Modify.html @@ -194,6 +194,13 @@ if ( $QueueObj->Id ) { ); push @results, @linkresults; push @results, ProcessObjectCustomFieldUpdates( ARGSRef => \%ARGS, Object => $QueueObj ); + if ( RT->Config->Get('RTAddressRegexp') ) { + foreach my $address ( $QueueObj->CorrespondAddress, $QueueObj->CommentAddress ) { + next unless defined $address && length $address; + next if RT::EmailParser->IsRTAddress( $address ); + push @results, loc("RTAddressRegexp option in the config doesn't match [_1]", $address ); + } + } } </%INIT> diff --git a/rt/share/html/Admin/Queues/index.html b/rt/share/html/Admin/Queues/index.html index 52e7b3bfd..c0131b14f 100755 --- a/rt/share/html/Admin/Queues/index.html +++ b/rt/share/html/Admin/Queues/index.html @@ -92,7 +92,7 @@ <%INIT> my $queues = new RT::Queues($session{'CurrentUser'}); -$queues->{'find_disabled_rows'} = 1 if $FindDisabledQueues; +$queues->FindAllRows if $FindDisabledQueues; my ($caption); if ( defined $QueueString && length $QueueString ) { @@ -111,9 +111,7 @@ if ( defined $QueueString && length $QueueString ) { : loc("Enabled Queues"); } -$Format ||= 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__}; +$Format ||= RT->Config->Get('AdminSearchResultFormat')->{'Queues'}; </%INIT> <%ARGS> diff --git a/rt/share/html/Admin/Tools/Configuration.html b/rt/share/html/Admin/Tools/Configuration.html index eb48af19c..22c846aca 100644 --- a/rt/share/html/Admin/Tools/Configuration.html +++ b/rt/share/html/Admin/Tools/Configuration.html @@ -50,9 +50,7 @@ require Module::Versions::Report; my $title = loc('System Configuration'); unless ($session{'CurrentUser'}->HasRight( Object=> $RT::System, Right => 'SuperUser')) { Abort(loc('This feature is only available to system administrators')); -} - - +} </%init> <& /Admin/Elements/Header, Title => $title &> <& /Admin/Elements/ToolTabs, @@ -60,18 +58,15 @@ unless ($session{'CurrentUser'}->HasRight( Object=> $RT::System, Right => 'Super current_subtab => 'Admin/Tools/Configuration.html', Title => $title &> - - -<h2><&|/l&>Loaded perl modules</&></h2> -% my $report = Module::Versions::Report::report(); -% my @report = grep /v\d/, split("\n",$report); -<pre> -<% join('<br />', @report) |n %> -</pre> - -<h2><&|/l&>RT Config</&></h2> -<table> +<&|/Widgets/TitleBox, title => loc("RT Configuration") &> +<table border="0" cellspacing="0" cellpadding="5" width="100%" class="collection"> +<tr class="collection-as-table"> +<th class="collection-as-table"><&|/l&>Option</&></th> +<th class="collection-as-table"><&|/l&>Value</&></th> +<th class="collection-as-table"><&|/l&>Source</&></th> +</tr> <%PERL> +my $index_conf; foreach my $key ( RT->Config->Options( Overridable => undef, Sorted => 0 ) ) { my $val = RT->Config->Get( $key ); next unless defined $val; @@ -90,9 +85,11 @@ foreach my $key ( RT->Config->Options( Overridable => undef, Sorted => 0 ) ) { else { $description = loc("core config"); } + $index_conf++; </%PERL> -<tr><th><% $key %></th> -<td rowspan="2">\ +<tr class="<% $index_conf%2 ? 'oddline' : 'evenline'%>"> +<td class="collection-as-table"><% $key %></td> +<td class="collection-as-table"> % if ( $key =~ /Password(?!Length)/i ) { <em>Password not printed</em>\ % } elsif ( !ref $val ) { @@ -104,19 +101,38 @@ foreach my $key ( RT->Config->Options( Overridable => undef, Sorted => 0 ) ) { % } else { <% ref $val %>\ % } -</td></tr> -<tr><td><% $description %></td></tr> +</td> +<td class="collection-as-table" style="white-space: nowrap"> +% if ( $description =~ /^.*site config$/ ) { +<span style="font-weight: bold"><% $description %></span> +% } else { +<% $description %> +% } +</td> +</tr> % } </table> - -<h2><&|/l&>RT Variables</&></h2> -<table> -% { no strict qw/refs/; -% my %config_opt = map { $_ => 1 } RT->Config->Options( Overridable => undef ); -% foreach my $key ( sort keys %{*RT::} ) { -% next if !${'RT::'.$key} || ref ${'RT::'.$key} || $config_opt{ $key }; -<tr><th>RT::<% $key %></th> -<td> +</&> +<table width="100%"> + <tr> + <td valign="top" width="60%" class="boxcontainer"> +<&|/Widgets/TitleBox, title=> loc("RT core variables") &> +<table border="0" cellspacing="0" cellpadding="5" width="100%" class="collection"> +<tr class="collection-as-table"> +<th class="collection-as-table"><&|/l&>Variable</&></th> +<th class="collection-as-table"><&|/l&>Value</&></th> +</tr> +<%PERL> +{ no strict qw/refs/; +my %config_opt = map { $_ => 1 } RT->Config->Options( Overridable => undef ); +my $index_var; +foreach my $key ( sort keys %{*RT::} ) { + next if !${'RT::'.$key} || ref ${'RT::'.$key} || $config_opt{ $key }; + $index_var++; +</%PERL> +<tr class="collection-as-table <% $index_var%2 ? 'oddline' : 'evenline'%>"> +<td class="collection-as-table">RT::<% $key %></td> +<td class="collection-as-table"> % if ( $key =~ /Password(?!Length)/i ) { <em>Password not printed</em> % } else { @@ -127,44 +143,100 @@ foreach my $key ( RT->Config->Options( Overridable => undef, Sorted => 0 ) ) { % } % } </table> +</&> -<h2><&|/l&>RT Size</&></h2> -<table> +<&|/Widgets/TitleBox, title => loc("RT Size") &> +<table border="0" cellspacing="0" cellpadding="5" width="100%" class="collection"> +<tr class="collection-as-table"> +<th class="collection-as-table"><&|/l&>Object</&></th> +<th class="collection-as-table"><&|/l&>Size</&></th> +</tr> <%PERL> -for my $type (qw/Ticket Queue Transaction Group/) { - my $class = 'RT::' . $type . 's'; +my ($index_size, $user_count, $privileged_count); +for my $type (qw/Tickets Queues Transactions Groups PrivilegedUsers UnprivilegedUsers/) { + my $count; + my $class = 'RT::' . $type; + $class =~ s/Privileged|Unprivileged//; my $collection = $class->new($RT::SystemUser); $collection->UnLimit; - my $count = $collection->CountAll; + if ($type =~ /PrivilegedUsers/) { + $user_count = $collection->CountAll; + $collection->LimitToPrivileged; + $count = $privileged_count = $collection->CountAll; + } elsif ($type =~ /UnprivilegedUsers/) { + $count = $user_count - $privileged_count; + } else { + $count = $collection->CountAll; + } + $index_size++; </%PERL> -<tr><th><% $type %>s</th> -<td><% $count %></td></tr> +<tr class="<% $index_size%2 ? 'oddline' : 'evenline'%>"> +<td class="collection-as-table"><% $type %></td> +<td class="collection-as-table"><% $count %></td> +</tr> % } +</table> +</&> +</td> +<td valign="top" class="boxcontainer"> -<%PERL> -my $users = RT::Users->new($RT::SystemUser); -$users->UnLimit; -my $user_count = $users->CountAll; +<&|/Widgets/TitleBox, title => loc("Mason template search order") &> +<ol> +% foreach my $path ( map { $_->[1] } $m->interp->comp_root_array ) { +<li><% $path %></li> +% } +</ol> +</&> -$users->LimitToPrivileged; -my $privileged_count = $users->CountAll; -my $unprivileged_count = $user_count - $privileged_count; -</%PERL> -<tr><th>Privileged Users</th> -<td><% $privileged_count %></td></tr> -<tr><th>Unprivileged Users</th> -<td><% $unprivileged_count %></td></tr> +<&|/Widgets/TitleBox, title => loc("Perl library search order") &> +<ol> +% foreach my $inc (@INC) { +<li><% $inc %></li> +% } +</ol> +</&> + +</td> +</table> + +<&|/Widgets/TitleBox, title => loc("Loaded perl modules")&> +<table border="0" cellspacing="0" cellpadding="5" width="100%" class="collection"> +<tr class="collection-as-table"> +<th class="collection-as-table"><&|/l&>Module</&></th> +<th class="collection-as-table"><&|/l&>Version</&></th> +<th class="collection-as-table"><&|/l&>Source</&></th> + + +<%perl> +my $i = 0; +my $report = Module::Versions::Report::report(); +my @report = grep /v\d/, split("\n",$report); +shift @report; # throw away the perl version +my ($ver, $source, $distfile); +foreach my $item (@report) { +if ($item =~ /^\s*(.*?)\s*v(\S+);/) { + $item = $1; + $ver = $2; + $distfile = $item.".pm"; + $distfile =~ s|::|/|g; +} +</%perl> +<tr class="<% $i++ %2 ? 'oddline' : 'evenline'%>"> +<td class="collection-as-table"><% $item %></td> + <td class="collection-as-table"> + <%$ver%> + </td> + <td class="collection-as-table"> + <% $INC{$distfile} %> + </td> +</tr> +% } </table> +</&> -<h2><&|/l&>Perl configuration</&></h2> +<&|/Widgets/TitleBox, title => loc("Perl configuration") &> % require Config; <pre> <% Config::myconfig() %> </pre> - -<h2><&|/l&>Perl Include Paths (@INC)</&></h2> -<pre> -% foreach my $inc (@INC) { -<% $inc %> -% } -</pre> +</&> diff --git a/rt/share/html/Admin/Users/Memberships.html b/rt/share/html/Admin/Users/Memberships.html index ea5dd258b..cd8574d58 100644 --- a/rt/share/html/Admin/Users/Memberships.html +++ b/rt/share/html/Admin/Users/Memberships.html @@ -128,9 +128,7 @@ my $is_not_member = RT::Groups->new( $session{'CurrentUser'} ); $is_not_member->LimitToUserDefinedGroups; $is_not_member->WithoutMember( PrincipalId => $UserObj->Id ); -$Format ||= 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__'}; +$Format ||= RT->Config->Get('AdminSearchResultFormat')->{'Groups'}; </%INIT> <%ARGS> $id => undef diff --git a/rt/share/html/Admin/Users/index.html b/rt/share/html/Admin/Users/index.html index e9a58183d..88a775fc3 100755 --- a/rt/share/html/Admin/Users/index.html +++ b/rt/share/html/Admin/Users/index.html @@ -93,7 +93,7 @@ <%INIT> my $caption; my $users = RT::Users->new( $session{'CurrentUser'} ); -$users->{'find_disabled_rows'} = 1 if $FindDisabledUsers; +$users->FindAllRows if $FindDisabledUsers; if ( defined($UserString) && length $UserString ) { $caption = loc("Users matching search criteria"); @@ -117,9 +117,7 @@ else { $users->LimitToPrivileged; } -$Format ||= 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__}; +$Format ||= RT->Config->Get('AdminSearchResultFormat')->{'Users'}; </%INIT> <%ARGS> |