[Bps-public-commit] rt-extension-admin-conditions-and-actions branch, master, updated. c0ac2bb2a41d19ef9054d5330b863260389f786e

? sunnavy sunnavy at bestpractical.com
Wed Aug 7 09:51:36 EDT 2013


The branch, master has been updated
       via  c0ac2bb2a41d19ef9054d5330b863260389f786e (commit)
       via  0fc3c607af6df737ca1212d64cfaa38637eac835 (commit)
       via  972dc47022ebd4a52a2dff38005f7ed721a01fd4 (commit)
      from  92a532899aab02db85cd362600153b547652d3d7 (commit)

Summary of changes:
 README                                                  | 17 ++++++++++++++++-
 html/Admin/Elements/EditActions                         |  2 +-
 html/Admin/Elements/EditConditions                      |  2 +-
 .../AdminConditionsAndActions/Elements/Tabs/Privileged  |  4 +++-
 lib/RT/Extension/AdminConditionsAndActions.pm           |  5 +++--
 5 files changed, 24 insertions(+), 6 deletions(-)

- Log -----------------------------------------------------------------
commit 972dc47022ebd4a52a2dff38005f7ed721a01fd4
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Wed Aug 7 21:40:33 2013 +0800

    exclude custom ones from system actions/conditions

diff --git a/html/Admin/Elements/EditActions b/html/Admin/Elements/EditActions
index feef465..ebbd4d7 100644
--- a/html/Admin/Elements/EditActions
+++ b/html/Admin/Elements/EditActions
@@ -83,7 +83,7 @@ unless ( $session{CurrentUser}->HasRight( Object => RT->System, Right => 'ShowSc
 my (@actions);
 
 my $system_actions = RT::ScripActions->new($session{'CurrentUser'});
-$system_actions->UnLimit;
+$system_actions->Limit( FIELD => 'Creator', VALUE => RT->SystemUser->id );
 
 my $actions = RT::ScripActions->new($session{'CurrentUser'});
 $actions->Limit( FIELD => 'Creator', VALUE => RT->SystemUser->id, OPERATOR => '!=' );
diff --git a/html/Admin/Elements/EditConditions b/html/Admin/Elements/EditConditions
index b35a8d2..6cce7d5 100644
--- a/html/Admin/Elements/EditConditions
+++ b/html/Admin/Elements/EditConditions
@@ -83,7 +83,7 @@ unless ( $session{CurrentUser}->HasRight( Object => RT->System, Right => 'ShowSc
 my (@actions);
 
 my $system_conditions = RT::ScripConditions->new($session{'CurrentUser'});
-$system_conditions->UnLimit;
+$system_conditions->Limit( FIELD => 'Creator', VALUE => RT->SystemUser->id );
 
 my $conditions = RT::ScripConditions->new($session{'CurrentUser'});
 $conditions->Limit( FIELD => 'Creator', VALUE => RT->SystemUser->id, OPERATOR => '!=' );

commit 0fc3c607af6df737ca1212d64cfaa38637eac835
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Wed Aug 7 21:46:30 2013 +0800

    make it work for 4.0 too

diff --git a/html/Callbacks/AdminConditionsAndActions/Elements/Tabs/Privileged b/html/Callbacks/AdminConditionsAndActions/Elements/Tabs/Privileged
index b61ea99..421476b 100644
--- a/html/Callbacks/AdminConditionsAndActions/Elements/Tabs/Privileged
+++ b/html/Callbacks/AdminConditionsAndActions/Elements/Tabs/Privileged
@@ -49,7 +49,9 @@
 
 return unless $session{'CurrentUser'}->HasRight( Object => RT->System, Right => 'ModifyScrips' );
 
-my $admin_global = Menu()->child('admin')->child('global');
+my $admin = Menu->child('admin') || Menu->child('tools')->child('config');
+my $admin_global = $admin->child('global');
+
 my $conditions   = $admin_global->child(
     conditions  => title => loc('Conditions'),
     description => loc('Edit system conditions'),

commit c0ac2bb2a41d19ef9054d5330b863260389f786e
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Wed Aug 7 21:49:54 2013 +0800

    update package info

diff --git a/README b/README
index 38377a0..9770d7a 100644
--- a/README
+++ b/README
@@ -15,15 +15,30 @@ INSTALLATION
         or add "RT::Extension::AdminConditionsAndActions" to your existing
         @Plugins line.
 
+        You can customize Condition/Action list format by config
+        %AdminSearchResultFormat, e.g.
+
+            Set(%AdminSearchResultFormat,
+                ...
+                Conditions =>
+                    q{'<a href="__WebPath__/Admin/Conditions/Modify.html?&id=__id__">__id__</a>/TITLE:#'}
+                    .q{,'<a href="__WebPath__/Admin/Conditions/Modify.html?id=__id__">__Name__</a>/TITLE:Name'}
+                    .q{,'__Description__','__UsedBy__},
+                Actions =>
+                    q{'<a href="__WebPath__/Admin/Conditions/Modify.html?&id=__id__">__id__</a>/TITLE:#'}
+                    .q{,'<a href="__WebPath__/Admin/Conditions/Modify.html?id=__id__">__Name__</a>/TITLE:Name'}
+                    .q{,'__Description__','__UsedBy__},
+            );
+
     Clear your mason cache
             rm -rf /opt/rt4/var/mason_data/obj
 
     Restart your webserver
 
 AUTHOR
+    sunnavy <sunnavy at bestpractical.com>
 
     Jim Brandt <jbrandt at bestpractical.com>
-    sunnavy <sunnavy at bestpractical.com>
 
 LICENSE AND COPYRIGHT
     Copyright 2013 Best Practical Solutions, LLC.
diff --git a/lib/RT/Extension/AdminConditionsAndActions.pm b/lib/RT/Extension/AdminConditionsAndActions.pm
index a82b8e2..685dc9d 100644
--- a/lib/RT/Extension/AdminConditionsAndActions.pm
+++ b/lib/RT/Extension/AdminConditionsAndActions.pm
@@ -112,13 +112,14 @@ You can customize Condition/Action list format by config C<%AdminSearchResultFor
 
 =head1 AUTHOR
 
-Jim Brandt <jbrandt at bestpractical.com>
 sunnavy <sunnavy at bestpractical.com>
 
+Jim Brandt <jbrandt at bestpractical.com>
+
 =head1 LICENSE AND COPYRIGHT
 
 Copyright 2013 Best Practical Solutions, LLC.
 
 This is free software, licensed under:
 
-  The GNU General Public License, Version 2, June 1991
\ No newline at end of file
+  The GNU General Public License, Version 2, June 1991

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



More information about the Bps-public-commit mailing list