View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0009402 | mantisbt | other | public | 2008-07-16 10:52 | 2014-01-25 09:38 |
Reporter | urkle | Assigned To | |||
Priority | normal | Severity | feature | Reproducibility | N/A |
Status | new | Resolution | open | ||
Summary | 0009402: Add option to use optgroups instead of raquo in project list | ||||
Description | Using optgroups instead of raque and nbsps allows for the use of the keyboard to jump to specific project in the list. Example Framework Applications
when using the raquo I can not "jump" to tickets. (I have 46 projects in my list in several parent/child groupings). Attached is a patch that adds an option to switch to Optgroups instead of raquo. | ||||
Tags | No tags attached. | ||||
Attached Files | project_list.diff (3,006 bytes)
Index: api/soap/mc_issue_api.php =================================================================== --- api/soap/mc_issue_api.php (revision 5416) +++ api/soap/mc_issue_api.php (working copy) @@ -234,7 +234,7 @@ $t_relationship = array(); $t_relationship['id'] = $t_relship_row->id; $t_reltype = array(); - $t_reltype['id'] = $t_relship_row->type; + $t_reltype['id'] = relationship_get_complementary_type($t_relship_row->type); $t_reltype['name'] = relationship_get_description_dest_side($t_relship_row->type); $t_relationship['type'] = $t_reltype; $t_relationship['target_id'] = $t_relship_row->src_bug_id; Index: config_defaults_inc.php =================================================================== --- config_defaults_inc.php (revision 5416) +++ config_defaults_inc.php (working copy) @@ -518,6 +518,11 @@ # Shows only top projects in the project dropdown and adds an extra dropdown for subprojects. $g_show_extended_project_browser = OFF; + # --- use optgroups in the project list instead of » --- + # Uses optgroups in the select list instead of manual spacing and » + # This allows for better navigating by keyboard through the select list + $g_show_project_optgroups = OFF; + # --- show assigned to names ------ # This is in the view all pages $g_show_assigned_names = ON; @@ -2021,4 +2026,4 @@ # Enables or disables the mind mapping features including ability to export Freemind files and # in browser view of generated mindmaps. - $g_mindmap_enabled = ON; \ No newline at end of file + $g_mindmap_enabled = ON; Index: core/print_api.php =================================================================== --- core/print_api.php (revision 5416) +++ core/print_api.php (working copy) @@ -493,6 +493,8 @@ array_push( $p_parents, $p_parent_id ); $t_project_ids = current_user_get_accessible_subprojects( $p_parent_id ); $t_project_count = count( $t_project_ids ); + $t_project_optgroups = config_get('show_project_optgroups'); + if ($t_project_optgroups && $t_project_count) PRINT "<optgroup>"; for ($i=0;$i<$t_project_count;$i++) { $t_full_id = $t_id = $t_project_ids[$i]; if ( $t_id != $p_filter_project_id ) { @@ -502,10 +504,12 @@ } PRINT "$t_full_id\""; check_selected( $p_project_id, $t_full_id ); - PRINT '>' . str_repeat( ' ', count( $p_parents ) ) . str_repeat( '»', count( $p_parents ) ) . ' ' . string_display( project_get_field( $t_id, 'name' ) ) . '</option>' . "\n"; + $t_spacing = $t_project_optgroups ? "" : str_repeat( ' ', count( $p_parents ) ) . str_repeat( '»', count( $p_parents ) ). ' '; + PRINT '>' . $t_spacing . string_display( project_get_field( $t_id, 'name' ) ) . '</option>' . "\n"; print_subproject_option_list( $t_id, $p_project_id, $p_filter_project_id, $p_trace, $p_parents ); } } + if ($t_project_optgroups && $t_project_count) PRINT "</optgroup>"; } # -------------------- # Print extended project browser 9402.diff (2,373 bytes)
--- C:/Users/Paul/AppData/Local/Temp/print_api-HEAD.4.php Mon Jul 28 00:30:51 2008 +++ c:/mantis/mantissvn/core/print_api.php Mon Jul 28 00:28:46 2008 @@ -493,19 +493,27 @@ array_push( $p_parents, $p_parent_id ); $t_project_ids = current_user_get_accessible_subprojects( $p_parent_id ); $t_project_count = count( $t_project_ids ); + $t_project_optgroups = config_get('show_project_optgroups'); + if ($t_project_optgroups && $t_project_count) { + echo '<optgroup>'; + } for ($i=0;$i<$t_project_count;$i++) { $t_full_id = $t_id = $t_project_ids[$i]; if ( $t_id != $p_filter_project_id ) { - PRINT "<option value=\""; + echo '<option value="'; if ( $p_trace ) { $t_full_id = join( $p_parents, ";") . ';' . $t_id; } - PRINT "$t_full_id\""; + echo "$t_full_id\""; check_selected( $p_project_id, $t_full_id ); - PRINT '>' . str_repeat( ' ', count( $p_parents ) ) . str_repeat( '»', count( $p_parents ) ) . ' ' . string_display( project_get_field( $t_id, 'name' ) ) . '</option>' . "\n"; + $t_spacing = $t_project_optgroups ? "" : str_repeat( ' ', count( $p_parents ) ) . str_repeat( '»', count( $p_parents ) ). ' '; + echo '>' . $t_spacing . string_display( project_get_field( $t_id, 'name' ) ) . '</option>' . "\n"; print_subproject_option_list( $t_id, $p_project_id, $p_filter_project_id, $p_trace, $p_parents ); } } + if ($t_project_optgroups && $t_project_count) { + echo '</optgroup>'; + } } # -------------------- # Print extended project browser @@ -597,10 +605,15 @@ $t_project_ids = current_user_get_accessible_subprojects( $t_parent_id ); $t_project_count = count( $t_project_ids ); + $t_project_optgroups = config_get('show_project_optgroups'); for ($i=0;$i<$t_project_count;$i++) { $t_id = $t_project_ids[$i]; + if ( $t_project_optgroups ) { + $t_name = addslashes( ' ' . project_get_field( $t_id, 'name' ) ); + } else { $t_name = addslashes( str_repeat( ( ' ' ) , $t_level ) . str_repeat( ( '»' ), $t_level ) . ' ' . project_get_field( $t_id, 'name' ) ); + } echo 'subprojects[\'' . $t_top_id . '\'][\'' . $p_trace . ';' . $t_id . '\'] = \'' . $t_name . '\';' . "\n"; print_extended_project_browser_subproject_javascript( $p_trace . ';' . $t_id ); | ||||