Hello,
I need to see in my homepage the list of issues "assigned to me" but with the resolved oned, too.
Is this possible?
Thank you!
"Assigned to me" with resolved ones
Moderators: Developer, Contributor
Re: "Assigned to me" with resolved ones
not possible out of the box, you would need to:
-define another box on the my_view page
-adjust a core script
In both cases something you would need to do again with each upgrade.
-define another box on the my_view page
-adjust a core script
In both cases something you would need to do again with each upgrade.
Re: "Assigned to me" with resolved ones
Ok, I can manage this: can you help me with the steps?
Re: "Assigned to me" with resolved ones
Ok, here is the quick and dirty solution.
open core/file_api.php
find function filter_create_assigned_to_unresolved which looks like:
change this into:
this does mean that wherever the function is used, also resolved/closed items will be shown.
open core/file_api.php
find function filter_create_assigned_to_unresolved which looks like:
Code: Select all
function filter_create_assigned_to_unresolved( $p_project_id, $p_user_id ) {
$t_filter = filter_get_default();
if( $p_user_id == 0 ) {
$t_filter[FILTER_PROPERTY_HANDLER_ID] = array( '0' => META_FILTER_NONE );
} else {
$t_filter[FILTER_PROPERTY_HANDLER_ID] = array( '0' => $p_user_id );
}
$t_bug_resolved_status_threshold = config_get( 'bug_resolved_status_threshold', null, $p_user_id, $p_project_id );
$t_filter[FILTER_PROPERTY_HIDE_STATUS] = array( '0' => $t_bug_resolved_status_threshold );
if( $p_project_id != ALL_PROJECTS ) {
$t_filter[FILTER_PROPERTY_PROJECT_ID] = array( '0' => $p_project_id );
}
return filter_ensure_valid_filter( $t_filter );
}
Code: Select all
function filter_create_assigned_to_unresolved( $p_project_id, $p_user_id ) {
$t_filter = filter_get_default();
if( $p_user_id == 0 ) {
$t_filter[FILTER_PROPERTY_HANDLER_ID] = array( '0' => META_FILTER_NONE );
} else {
$t_filter[FILTER_PROPERTY_HANDLER_ID] = array( '0' => $p_user_id );
}
if( $p_project_id != ALL_PROJECTS ) {
$t_filter[FILTER_PROPERTY_PROJECT_ID] = array( '0' => $p_project_id );
}
return filter_ensure_valid_filter( $t_filter );
}
Re: "Assigned to me" with resolved ones
I assume this will change the behavior for all users; is it possible to have a different defined function to be added to my home page?
Re: "Assigned to me" with resolved ones
Correct, this would change it for all users. If you would like it to be only for you, new code (replacing old one)would look like:
Be sure to put your user_id in this line
Code: Select all
function filter_create_assigned_to_unresolved( $p_project_id, $p_user_id ) {
$t_filter = filter_get_default();
if ($p_user_id) <> 23) {
if( $p_user_id == 0 ) {
$t_filter[FILTER_PROPERTY_HANDLER_ID] = array( '0' => META_FILTER_NONE );
} else {
$t_filter[FILTER_PROPERTY_HANDLER_ID] = array( '0' => $p_user_id );
}
$t_bug_resolved_status_threshold = config_get( 'bug_resolved_status_threshold', null, $p_user_id, $p_project_id );
$t_filter[FILTER_PROPERTY_HIDE_STATUS] = array( '0' => $t_bug_resolved_status_threshold );
if( $p_project_id != ALL_PROJECTS ) {
$t_filter[FILTER_PROPERTY_PROJECT_ID] = array( '0' => $p_project_id );
}
} else {
if( $p_user_id == 0 ) {
$t_filter[FILTER_PROPERTY_HANDLER_ID] = array( '0' => META_FILTER_NONE );
} else {
$t_filter[FILTER_PROPERTY_HANDLER_ID] = array( '0' => $p_user_id );
}
if( $p_project_id != ALL_PROJECTS ) {
$t_filter[FILTER_PROPERTY_PROJECT_ID] = array( '0' => $p_project_id );
}
}
return filter_ensure_valid_filter( $t_filter );
}
So replace 23 with your user_id ( admin => 1)if ($p_user_id) <> 23) {
Re: "Assigned to me" with resolved ones
Ok, I understand, but is it possibile to add a new section to my home page with a new custom function as the one you wrote?
Re: "Assigned to me" with resolved ones
yes, of course is possible, this section will then be visible for all unless you use a condition to show or not (like in the code I gave you).
But that is almost writing a plugin ( which could be the best solution for you anyway) which goes beyond a simple answer
But that is almost writing a plugin ( which could be the best solution for you anyway) which goes beyond a simple answer