[Rt-commit] rt branch, admin_collections_formats, updated. rt-3.8.7-164-gcbf4d08

Ruslan Zakirov ruz at bestpractical.com
Wed Feb 17 21:05:32 EST 2010


The branch, admin_collections_formats has been updated
       via  cbf4d082c62406d71b19d40c83a3c7daae5f3dcf (commit)
       via  e960f754d1219566fef994edb5b2e9906f9566e1 (commit)
       via  04dd230d3080f24bcca29335086087a072ad4a03 (commit)
       via  e4943b14c017d7d3a6fe1a36928acb0f8421622b (commit)
      from  4658be309b346f9f9af2123cf70a92fc3865d71d (commit)

Summary of changes:
 etc/RT_Config.pm.in                        |   35 ++++++++++++++++++++++++++++
 share/html/Admin/Elements/EditScrips       |    5 +---
 share/html/Admin/Elements/EditTemplates    |    5 +---
 share/html/Admin/Groups/index.html         |    5 +---
 share/html/Admin/Queues/index.html         |    4 +--
 share/html/Admin/Users/Memberships.html    |    4 +--
 share/html/Admin/Users/index.html          |    4 +--
 share/html/Elements/ColumnMap              |    2 +
 share/html/Elements/RT__Scrip/ColumnMap    |    4 +++
 share/html/Elements/RT__Template/ColumnMap |   11 ++++++++
 10 files changed, 58 insertions(+), 21 deletions(-)

- Log -----------------------------------------------------------------
commit e4943b14c017d7d3a6fe1a36928acb0f8421622b
Author: Ruslan Zakirov <ruz at bestpractical.com>
Date:   Thu Feb 18 04:58:22 2010 +0300

    add global __WebRequestPath__ and __WebRequestPathDir__ column maps

diff --git a/share/html/Elements/ColumnMap b/share/html/Elements/ColumnMap
index e84d3cd..a1475a9 100644
--- a/share/html/Elements/ColumnMap
+++ b/share/html/Elements/ColumnMap
@@ -156,6 +156,8 @@ my $COLUMN_MAP = {
         $_ => { value => sub { return \$value } };
     
     } qw(WebPath WebBaseURL WebURL)),
+    WebRequestPath    => { value => sub { substr( $m->request_path, 1 ) } },
+    WebRequestPathDir => { value => sub { substr( $m->request_comp->dir_path, 1 ) } },
 };
 
 $COLUMN_MAP->{'CF'} = $COLUMN_MAP->{'CustomField'};

commit 04dd230d3080f24bcca29335086087a072ad4a03
Author: Ruslan Zakirov <ruz at bestpractical.com>
Date:   Thu Feb 18 04:59:38 2010 +0300

    Queue and QueueId column maps for scrips and templates

diff --git a/share/html/Elements/RT__Scrip/ColumnMap b/share/html/Elements/RT__Scrip/ColumnMap
index 88b4c4b..3e1d407 100644
--- a/share/html/Elements/RT__Scrip/ColumnMap
+++ b/share/html/Elements/RT__Scrip/ColumnMap
@@ -64,6 +64,10 @@ my $COLUMN_MAP = {
             return $_[0]->loc('Global');
         },
     },
+    QueueId => {
+        title     => 'Queue', # loc
+        value     => sub { $_[0]->Queue },
+    },
     Condition => {
         title     => 'Condition', # loc
         value     => sub { return $_[0]->loc( $_[0]->ScripConditionObj->Name ) },
diff --git a/share/html/Elements/RT__Template/ColumnMap b/share/html/Elements/RT__Template/ColumnMap
index 851cc9d..e7c1495 100644
--- a/share/html/Elements/RT__Template/ColumnMap
+++ b/share/html/Elements/RT__Template/ColumnMap
@@ -67,6 +67,17 @@ my $COLUMN_MAP = {
 	attribute => 'Description',
 	value     => sub { return $_[0]->Description() },
     },
+    Queue => {
+        title     => 'Queue', # loc
+        value     => sub {
+            return $_[0]->QueueObj->Name if $_[0]->Queue;
+            return $_[0]->loc('Global');
+        },
+    },
+    QueueId => {
+        title     => 'Queue', # loc
+        value     => sub { $_[0]->Queue },
+    },
 };
 
 </%ONCE>

commit e960f754d1219566fef994edb5b2e9906f9566e1
Author: Ruslan Zakirov <ruz at bestpractical.com>
Date:   Thu Feb 18 05:00:34 2010 +0300

    %AdminSearchResultFormat config option

diff --git a/etc/RT_Config.pm.in b/etc/RT_Config.pm.in
index a04ba95..2d165d0 100755
--- a/etc/RT_Config.pm.in
+++ b/etc/RT_Config.pm.in
@@ -1381,6 +1381,41 @@ Set($DefaultSelfServiceSearchResultFormat, qq{
    Requestors,
    OwnerName});
 
+=item C<%AdminSearchResultFormat>
+
+In admin interface format strings similar to tickets search result
+formats are used. Use C<%AdminSearchResultFormat> to define format
+strings per RT class.
+
+=cut
+
+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__},
+
+    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__'},
+
+    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__},
+
+    Scrips => 
+        q{'<a href="__WebPath__/__WebRequestPathDir__/Scrip.html?id=__id__&Queue=__QueueId__">__id__</a>/TITLE:#'}
+        .q{,'<a href="__WebPath__/__WebRequestPathDir__/Scrip.html?id=__id__&Queue=__QueueId__">__Description__</a>/TITLE:Description'}
+        .q{,__Stage__, __Condition__, __Action__, __Template__},
+
+    Templates =>
+        q{'<a href="__WebPath__/__WebRequestPathDir__/Template.html?Queue=__QueueId__&Template=__id__">__id__</a>/TITLE:#'}
+        .q{,'<a href="__WebPath__/__WebRequestPathDir__/Template.html?Queue=__QueueId__&Template=__id__">__Name__</a>/TITLE:Name'}
+        .q{,'__Description__'},
+);
+
 =item C<$SuppressInlineTextFiles>
 
 If C<$SuppressInlineTextFiles> is set to a true value, then uploaded

commit cbf4d082c62406d71b19d40c83a3c7daae5f3dcf
Author: Ruslan Zakirov <ruz at bestpractical.com>
Date:   Thu Feb 18 05:00:56 2010 +0300

    use %AdminSearchResultFormat config option in the admin ui

diff --git a/share/html/Admin/Elements/EditScrips b/share/html/Admin/Elements/EditScrips
index df349e1..dce0390 100755
--- a/share/html/Admin/Elements/EditScrips
+++ b/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/share/html/Admin/Elements/EditTemplates b/share/html/Admin/Elements/EditTemplates
index 0bd68c2..7d7d930 100755
--- a/share/html/Admin/Elements/EditTemplates
+++ b/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/share/html/Admin/Groups/index.html b/share/html/Admin/Groups/index.html
index 078f51b..17b760c 100755
--- a/share/html/Admin/Groups/index.html
+++ b/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/share/html/Admin/Queues/index.html b/share/html/Admin/Queues/index.html
index 52e7b3b..98dce3d 100755
--- a/share/html/Admin/Queues/index.html
+++ b/share/html/Admin/Queues/index.html
@@ -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/share/html/Admin/Users/Memberships.html b/share/html/Admin/Users/Memberships.html
index ea5dd25..cd8574d 100644
--- a/share/html/Admin/Users/Memberships.html
+++ b/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/share/html/Admin/Users/index.html b/share/html/Admin/Users/index.html
index e9a5818..1ef773b 100755
--- a/share/html/Admin/Users/index.html
+++ b/share/html/Admin/Users/index.html
@@ -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>

-----------------------------------------------------------------------


More information about the Rt-commit mailing list