[Bps-public-commit] rt-extension-resetpassword branch, pass-with-password-arg-to-paging-url, created. 1.11-1-g74bdaaf

? sunnavy sunnavy at bestpractical.com
Fri Apr 23 15:40:18 EDT 2021


The branch, pass-with-password-arg-to-paging-url has been created
        at  74bdaafb4cd91ec5172dd39913efbe148d233337 (commit)

- Log -----------------------------------------------------------------
commit 74bdaafb4cd91ec5172dd39913efbe148d233337
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Sat Apr 24 03:31:32 2021 +0800

    Pass FindUsersWithPassword argument to paging URL
    
    Thus its value won't be lost when user navigates different pages.

diff --git a/html/Callbacks/RT-Extension-ResetPassword/Admin/Users/index.html/ModifyCollectionListArgs b/html/Callbacks/RT-Extension-ResetPassword/Admin/Users/index.html/ModifyCollectionListArgs
new file mode 100644
index 0000000..1da6579
--- /dev/null
+++ b/html/Callbacks/RT-Extension-ResetPassword/Admin/Users/index.html/ModifyCollectionListArgs
@@ -0,0 +1,6 @@
+<%INIT>
+push @{$CollectionListArgs->{PassArguments}}, 'FindUsersWithPassword';
+</%INIT>
+<%ARGS>
+$CollectionListArgs
+</%ARGS>
diff --git a/patches/user-admin-callbacks.patch b/patches/user-admin-callbacks.patch
index 0ad771e..dedcfb4 100644
--- a/patches/user-admin-callbacks.patch
+++ b/patches/user-admin-callbacks.patch
@@ -29,3 +29,40 @@ index 4bcfc2e95..e819b3393 100644
  $caption = loc("Users matching search criteria");
  my @users_queries = ();
  push @users_queries, { field => $UserField, op => $UserOp, string => $UserString } if length $UserString;
+commit 73d82646143a5b72ac09902c93a0cbb330fd0e8b
+Author: sunnavy <sunnavy at bestpractical.com>
+Date:   Sat Apr 24 02:53:52 2021 +0800
+
+    Add ModifyCollectionListArgs callback to user admin index page
+    
+    The initial reason is: customization code that adds extra search
+    parameters can use this callback to pass them to paging URLs
+    accordingly.
+
+diff --git a/share/html/Admin/Users/index.html b/share/html/Admin/Users/index.html
+index a686e3442..c919f31b2 100644
+--- a/share/html/Admin/Users/index.html
++++ b/share/html/Admin/Users/index.html
+@@ -160,7 +160,8 @@ jQuery(function(){
+ % } else {
+ <p><&|/l&>Select a user</&>:</p>
+ 
+-<& /Elements/CollectionList,
++<%perl>
++my %collection_list_args = (
+     OrderBy => 'Name',
+     Order => 'ASC',
+     Rows  => $Rows,
+@@ -169,7 +170,11 @@ jQuery(function(){
+     Collection => $users,
+     AllowSorting => 1,
+     PassArguments => [qw(Format Rows Page Order OrderBy UserString UserOp UserField UserString2 UserOp2 UserField2 UserString3 UserOp3 UserField3 IdLike EmailLike FindDisabledUsers)],
+-&>
++);
++</%perl>
++
++% $m->callback( %ARGS, UsersObj => $users, CallbackName => 'ModifyCollectionListArgs', CollectionListArgs => \%collection_list_args );
++<& /Elements/CollectionList, %collection_list_args &>
+ 
+ % }
+ 

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


More information about the Bps-public-commit mailing list