[Rt-commit] rt branch, 4.0/global-scrips-links-on-queue-admin, created. rt-4.0.2-25-g7aab9cd

Alex Vandiver alexmv at bestpractical.com
Thu Sep 8 16:22:07 EDT 2011


The branch, 4.0/global-scrips-links-on-queue-admin has been created
        at  7aab9cdaeee2f7aa0af86cee00a093e3110e4033 (commit)

- Log -----------------------------------------------------------------
commit 7aab9cdaeee2f7aa0af86cee00a093e3110e4033
Author: Alex Vandiver <alexmv at bestpractical.com>
Date:   Tue Sep 6 21:29:46 2011 -0400

    Fix CollectionList links to global scripts on queue admin page
    
    The "Scrips" format defaults to pulling from the current request path
    (WebRequestPathDir), which in the case of ListGlobalScrips is
    "/Admin/Queues", as that element is only called from
    /Admin/Queues/Scrips.html  However, those rows should instead link to
    /Admin/Global/Scrip.html
    
    Fix this by breaking the admin formats in two -- one for global scrips,
    and one for queue-specific scrips.  These CollectionLists will hence work
    from any request path.
    
    This is not an upgrade hazard because hashes set in RT_SiteConfig.pm by
    way of `Set( %Hash, ...)` override only the keys that they specify.  The
    addition of the GlobalScrips key in %AdminSearchResultFormat will hence
    be picked up even if the local configuration has a
    Set( %AdminSearchResultFormat, ... ) present that does not contain a
    GlobalScrips key.

diff --git a/etc/RT_Config.pm.in b/etc/RT_Config.pm.in
index f98a4cc..5f792bb 100755
--- a/etc/RT_Config.pm.in
+++ b/etc/RT_Config.pm.in
@@ -2447,8 +2447,13 @@ Set(%AdminSearchResultFormat,
         .q{,__AppliedTo__, __FriendlyType__, __FriendlyPattern__},
 
     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{'<a href="__WebPath__/Admin/Queues/Scrip.html?id=__id__&Queue=__QueueId__">__id__</a>/TITLE:#'}
+        .q{,'<a href="__WebPath__/Admin/Queues/Scrip.html?id=__id__&Queue=__QueueId__">__Description__</a>/TITLE:Description'}
+        .q{,__Stage__, __Condition__, __Action__, __Template__},
+
+    GlobalScrips =>
+        q{'<a href="__WebPath__/Admin/Global/Scrip.html?id=__id__">__id__</a>/TITLE:#'}
+        .q{,'<a href="__WebPath__/Admin/Global/Scrip.html?id=__id__">__Description__</a>/TITLE:Description'}
         .q{,__Stage__, __Condition__, __Action__, __Template__},
 
     Templates =>
diff --git a/share/html/Admin/Elements/EditScrips b/share/html/Admin/Elements/EditScrips
index 02b53f0..4654c6b 100755
--- a/share/html/Admin/Elements/EditScrips
+++ b/share/html/Admin/Elements/EditScrips
@@ -89,9 +89,11 @@ if ( $id ) {
 
 if ($QueueObj->id) {
     $Scrips->LimitToQueue($id);
+    $Format ||= RT->Config->Get('AdminSearchResultFormat')->{'Scrips'};
 }
 else {
     $Scrips->LimitToGlobal();
+    $Format ||= RT->Config->Get('AdminSearchResultFormat')->{'GlobalScrips'};
 }
 
 # deal with modifying and deleting existing scrips
@@ -107,9 +109,6 @@ foreach my $id ( grep $_, @DeleteScrip, map /^DeleteScrip-(\d+)/, keys %ARGS ) {
         push @actions, $msg;
     }
 }
-
-$Format ||= RT->Config->Get('AdminSearchResultFormat')->{'Scrips'};
-
 </%init>
 
 <%ARGS>
diff --git a/share/html/Admin/Elements/ListGlobalScrips b/share/html/Admin/Elements/ListGlobalScrips
index 813691c..6545df7 100755
--- a/share/html/Admin/Elements/ListGlobalScrips
+++ b/share/html/Admin/Elements/ListGlobalScrips
@@ -61,7 +61,7 @@
 % }
 
 <%init>
-my $Format = RT->Config->Get('AdminSearchResultFormat')->{'Scrips'};
+my $Format = RT->Config->Get('AdminSearchResultFormat')->{'GlobalScrips'};
 
 my $Scrips = RT::Scrips->new( $session{'CurrentUser'} );
 $Scrips->LimitToGlobal;

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


More information about the Rt-commit mailing list