Index: openacs-4/packages/acs-subsite/www/permissions/perm-user-add-include.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/www/permissions/perm-user-add-include.tcl,v diff -u -r1.10.2.1 -r1.10.2.2 --- openacs-4/packages/acs-subsite/www/permissions/perm-user-add-include.tcl 16 May 2019 09:54:29 -0000 1.10.2.1 +++ openacs-4/packages/acs-subsite/www/permissions/perm-user-add-include.tcl 26 Oct 2022 14:20:35 -0000 1.10.2.2 @@ -3,10 +3,12 @@ object_id:naturalnum,notnull return_url:localurl page:naturalnum,optional + {search ""} } -# check they have read permission on this file - +# +# Check if the current user has read permission on this object_id. +# permission::require_permission -object_id $object_id -privilege admin # TODO: @@ -18,11 +20,25 @@ set perm_url "[lindex [site_node::get_url_from_object_id -object_id [site_node::closest_ancestor_package -include_self -package_key [subsite::package_keys]]] 0]permissions/" +ad_form \ + -name filter \ + -edit_buttons [list [list "Go" go]] \ + -has_submit 1 \ + -html { class foo } \ + -export {return_url object_id page} \ + -form { + {search:text,optional + {label ""} + {html {length 30 placeholder "[_ acs-kernel.common_Search]"} } + {value $search} + } + } -on_submit {} + list::create \ -name users \ -multirow users \ -key user_id \ - -page_size 20 \ + -page_size 10 \ -page_query_name users_who_dont_have_any_permissions_paginator \ -no_data "[_ acs-subsite.lt_There_are_no_users_wh]" \ -bulk_action_export_vars { return_url object_id } \ @@ -41,11 +57,20 @@ label "[_ acs-subsite.Add]" link_url_col add_url link_html { title "[_ acs-subsite.Add_this_user]" } - display_template "[_ acs-subsite.Add]" + display_template "" } } -filters { object_id {} return_url {} + search { + hide_p 1 + where_clause { + (:search is null + or u.first_names || ' ' || u.last_name ilike '%' || :search || '%' + or u.email ilike '%' || :search || '%' + ) + } + } } db_multirow -extend { add_url } users users_who_dont_have_any_permissions {} {