View Issue Details

IDProjectCategoryView StatusLast Update
0003434mantisbtfeaturepublic2003-12-13 04:34
Reporterksjohnsonz Assigned Tovboctor  
PrioritynormalSeverityfeatureReproducibilityN/A
Status closedResolutionduplicate 
Summary0003434: Sort by name in project option list
Description

The function to print the option list is odd, it gets the project id and then goes back and gets the name from the database in a loop. This means I can't simply add a sort method by name in alpha order. I will have possibily 10 projects or more so it would be nice to have some order. See below from .18rc release:

List projects that the current user has access to

function print_project_option_list( $p_project_id = null, $p_include_all_projects = true ) {
$t_project_ids = current_user_get_accessible_projects();
if ( $p_include_all_projects ) {
echo '<option value="' . ALL_PROJECTS . '"';
check_selected( $p_project_id, ALL_PROJECTS );
echo '>' . lang_get( 'all_projects' ) . '</option>';
}

     $t_project_count = count( $t_project_ids );
     for ($i=0;$i<$t_project_count;$i++) {
             $t_id = $t_project_ids[$i];
             echo "<option value=\"$t_id\"";
             check_selected( $p_project_id, $t_id );
             echo '>' . string_display( project_get_field( $t_id, 'name' ) ) . '</option>';
     }
Additional Information

Maybe someone can help me recode this function? Thanks

TagsNo tags attached.

Relationships

duplicate of 0003310 closedvboctor Sorting of projects in menu bar 

Activities

vboctor

vboctor

2003-11-26 14:56

manager   ~0004765

This is fixed by 0003310 by making the user_get_accessible_projects() sort the returned ids based on the alphabetical order of the names. Bug 0003310 has the patch that you can use to fix this problem.