View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0006479 | mantisbt | feature | public | 2005-12-09 04:36 | 2014-09-23 18:05 |
Reporter | elmuerte | Assigned To | dregad | ||
Priority | normal | Severity | feature | Reproducibility | N/A |
Status | closed | Resolution | fixed | ||
Product Version | 1.0.0rc3 | ||||
Target Version | 1.2.12 | Fixed in Version | 1.2.12 | ||
Summary | 0006479: Direct project link | ||||
Description | We have a couple of projects in our BT. It would be great if it was possible to create a link that preselects a project for certain pages. For example, the followig link would directly show all issues for project 1, even though the user previously switched to an other project And for example this link would directly show the "report issue" page for project 2 | ||||
Tags | No tags attached. | ||||
Attached Files | mantisBT#6479-direct-access-to-project-for-report-and-view-bug-list.diff (2,203 bytes)
### Eclipse Workspace Patch 1.0 #P Mantis - M4D Index: view_all_bug_page.php =================================================================== --- view_all_bug_page.php (revision 294) +++ view_all_bug_page.php (working copy) @@ -32,6 +32,11 @@ auth_ensure_user_authenticated(); $f_page_number = gpc_get_int( 'page_number', 1 ); + $t_project_id = gpc_get_int('project_id',helper_get_current_project()); + if(project_exists($t_project_id)){ + helper_set_current_project($t_project_id); + } + $t_per_page = null; $t_bug_count = null; Index: view_all_inc.php =================================================================== --- view_all_inc.php (revision 294) +++ view_all_inc.php (working copy) @@ -52,9 +52,11 @@ $t_filter = filter_get_default(); } + $t_project_id = gpc_get_int('project_id',helper_get_current_project()); + if(project_exists($t_project_id)){ + helper_set_current_project($t_project_id); + } - - list( $t_sort, ) = explode( ',', $t_filter['sort'] ); list( $t_dir, ) = explode( ',', $t_filter['dir'] ); Index: bug_report_page.php =================================================================== --- bug_report_page.php (revision 311) +++ bug_report_page.php (working copy) @@ -37,6 +37,12 @@ require_once( 'collapse_api.php' ); $f_master_bug_id = gpc_get_int( 'm_id', 0 ); + + $t_project_id = gpc_get_int('project_id',helper_get_current_project()); + if(project_exists($t_project_id)){ + helper_set_current_project($t_project_id); + } + # this page is invalid for the 'All Project' selection except if this is a clone if ( ( ALL_PROJECTS == helper_get_current_project() ) && ( 0 == $f_master_bug_id ) ) { Index: core/helper_api.php =================================================================== --- core/helper_api.php (revision 294) +++ core/helper_api.php (working copy) @@ -282,8 +282,9 @@ * @return bool always true */ function helper_set_current_project( $p_project_id ) { + global $g_cache_current_project; $t_project_cookie_name = config_get( 'project_cookie' ); - + $g_cache_current_project = $p_project_id; gpc_set_cookie( $t_project_cookie_name, $p_project_id, true ); return true; | ||||
If I understand your request correctly, you can achieve this using a URL like this: http://your.site/mantis/set_project.php?project_id=2&make_default=no&ref=bug_report_page.php I use this to create handy 'report a bug' links in some of my software. You can change the 'ref' parameter to any Mantis page you like. |
|
You can also use the following link to go to a specific project page. At the moment this pre-selects the project and redirects to View Issues page. In future version, the project page may display some information about the project and provide some links / buttons for possible actions. http://www.example.com/mantis/project_page.php?project_id=1 To go to the report page, you will have to use the link suggested by ape. |
|
We should allow passing the project_id GET parameter to the bug_report_page.php and bug_report_advanced_page.php to simplify the construction of links that report bugs for specific projects. |
|
bug_report_page.php and bug_report_advanced_page.php supporting the project_id GET parameter would definitely make life simpler. This bug could then be resolved with a similar fix to bug 0007667 (although for me the TinyURL feature is unnecessary--maybe it could be optional for those that don't like to see long complex links?) |
|
patch based on 1.28, using "project_id" GET parameter |
|
Thanks for your contribution LapinKiller - I'll have a look at this later this week if I can. If you can, please consider submitting your contributions as git patches, or even better github pull requests, to make our lives easier. |
|
sorry but git & and github are blocked at office i can't use git or github, |
|
They don't even let you install a local git client ? damn. Don't worry I can live with unified diff - it's just a bit extra work. |
|
i'm trying to get an exception too, but i'm in a very big company (more than 200 000 employees), so it's not easy to get this exception :( for the client install i have a VM with admin rights (on my computer i can't do nothing...) |
|
github is now working at office :D i have made a pull request (my first one), i hope it's ok. |
|
good to hear :)
I'll review it and let you know. |
|
Salut Lapin See my comments on your pull request |
|
Marking as 'acknowledged' not resolved/closed to track that change gets ported to master-2.0.x branch |
|
MantisBT: master-1.2.x edfbecf2 2012-08-12 19:50 Committer: Damien Regad Details Diff |
Fix 0006479: Direct project links Adding possibility to change the current project id via GET/POST parameters. Enables direct project selection for the following pages: * bug_report_page.php * view_all_bug_page.php Lapinkiller's original patch was modified to align with MantisBT coding guidelines, and reword the commit message. Signed-off-by: Damien Regad <damien.regad@merckgroup.com> |
Affected Issues 0006479 |
|
mod - bug_report_page.php | Diff File | ||
mod - core/helper_api.php | Diff File | ||
mod - view_all_bug_page.php | Diff File | ||
mod - view_all_inc.php | Diff File | ||
MantisBT: master 0fdebfb5 2012-08-12 19:50 Committer: Damien Regad Details Diff |
Fix 0006479: Direct project links Adding possibility to change the current project id via GET/POST parameters. Enables direct project selection for the following pages: * bug_report_page.php * view_all_bug_page.php Lapinkiller's original patch was modified to align with MantisBT coding guidelines, and reword the commit message. Signed-off-by: Damien Regad <damien.regad@merckgroup.com> |
Affected Issues 0006479 |
|
mod - bug_report_page.php | Diff File | ||
mod - core/helper_api.php | Diff File | ||
mod - view_all_bug_page.php | Diff File | ||
mod - view_all_inc.php | Diff File | ||
MantisBT: master-1.2.x 00dbc614 2012-08-13 01:51 Details Diff |
Fix 0006479: Force page reload to refresh Project Selector |
Affected Issues 0006479 |
|
mod - bug_report_page.php | Diff File | ||
mod - view_all_bug_page.php | Diff File | ||
mod - view_all_inc.php | Diff File | ||
MantisBT: master efa18ce9 2012-08-13 01:51 Details Diff |
Fix 0006479: Force page reload to refresh Project Selector |
Affected Issues 0006479 |
|
mod - bug_report_page.php | Diff File | ||
mod - view_all_bug_page.php | Diff File | ||
mod - view_all_inc.php | Diff File |