Vote #62812
完了Patch for #791 (Search for all projects issues)
0%
journals
Also patch for #379 (#791 is a duplicate)
--------------------------------------------------------------------------------
This updates the patch to work with revision #1249, and also makes all_projects be the default when inside a project.
IMHO having a single search dialog that always works the same is far more intuitive (people expect Google behavior), and so I'm going to modify it slightly so the outside-a-project search also searches all projects. But, that seems beyond the intent of the original patch, so this is not included in my mod.
--------------------------------------------------------------------------------
This is definitely a must-have feature.
But with this patch, the number of queries will grow with the total number of projects. I would prefer a solution where a single query is executed for each kind of object (as it's done for the cross-project activity view). I'll work on it.
By the way, there's a small bug in the @object_types_and_scope@ method: the @project instance variable is used instead of the argument.
--------------------------------------------------------------------------------
Hi, I wrote a patch which does it in a single query per object while limiting the scope to only projects for which the user has the necessary permissions.
Included some screenies too.
The behavior of the patch is as follows:
When not inside a project:
* searches all projects including project names
* only checkboxes for categories where a user has a right to in some project are rendered
* the automatic redirect to a project if only one result has been removed
When inside a project:
* defaults to search inside the project only
* a checkbox is present to search in all projects (maybe this should be the default?)
* does not search in project names (maybe should be present as a greyed out option when 'search all projects' is unchecked)
Could you give feedback on this patch? I'd like to make it ready for inclusion.
btw, it still has some problems with anonymous users and non-members when searching all projects. This is because User.allowed_to? returns false for :global instead of checking anonymous and non-member roles.
--------------------------------------------------------------------------------
Functionality added in r1435.
Peter: your patch looks to work fine but I used a different approach that should be a bit more efficient when there are many public projects. Thanks.
Also, I added the ability to search 'My projects' only.
--------------------------------------------------------------------------------
Please, help me understand this: Is it a desired feature that a user can see issues from projects he does not belongs to?
When I search outside a project, I can see in the search results issues belonging to projects that are supposed to be restricted to me...
--------------------------------------------------------------------------------
related_issues
relates,Closed,791,Search for all projects issues