From: Victor B. <vb...@us...> - 2006-05-18 13:00:33
|
Update of /cvsroot/mantisbt/mantisbt/core In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv12155/core Modified Files: custom_field_api.php date_api.php helper_api.php print_api.php Log Message: Fixed #7114: tabindex in duplicate in bug_report_advanced_page. Index: custom_field_api.php =================================================================== RCS file: /cvsroot/mantisbt/mantisbt/core/custom_field_api.php,v retrieving revision 1.58 retrieving revision 1.59 diff -u -d -r1.58 -r1.59 --- custom_field_api.php 19 Apr 2006 00:45:46 -0000 1.58 +++ custom_field_api.php 18 May 2006 13:00:28 -0000 1.59 @@ -1182,9 +1182,9 @@ } if ( $p_field_def['type'] == CUSTOM_FIELD_TYPE_MULTILIST ) { - echo '<select name="custom_field_' . $t_id . '[]" size="' . $t_list_size . '" multiple>'; + echo '<select ', helper_get_tab_index(), ' name="custom_field_' . $t_id . '[]" size="' . $t_list_size . '" multiple>'; } else { - echo '<select name="custom_field_' . $t_id . '" size="' . $t_list_size . '">'; + echo '<select ', helper_get_tab_index(), ' name="custom_field_' . $t_id . '" size="' . $t_list_size . '">'; } $t_selected_values = explode( '|', $t_custom_field_value ); @@ -1201,7 +1201,7 @@ $t_values = explode( '|', custom_field_prepare_possible_values( $p_field_def['possible_values'] ) ); $t_checked_values = explode( '|', $t_custom_field_value ); foreach( $t_values as $t_option ) { - echo '<input type="checkbox" name="custom_field_' . $t_id . '[]"'; + echo '<input ', helper_get_tab_index(), ' type="checkbox" name="custom_field_' . $t_id . '[]"'; if( in_array( $t_option, $t_checked_values ) ) { echo ' value="' . $t_option . '" checked> ' . $t_option . ' '; } else { @@ -1213,7 +1213,7 @@ case CUSTOM_FIELD_TYPE_FLOAT: case CUSTOM_FIELD_TYPE_EMAIL: case CUSTOM_FIELD_TYPE_STRING: - echo '<input type="text" name="custom_field_' . $t_id . '" size="80"'; + echo '<input ', helper_get_tab_index(), ' type="text" name="custom_field_' . $t_id . '" size="80"'; if( 0 < $p_field_def['length_max'] ) { echo ' maxlength="' . $p_field_def['length_max'] . '"'; } else { Index: date_api.php =================================================================== RCS file: /cvsroot/mantisbt/mantisbt/core/date_api.php,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- date_api.php 26 Feb 2005 01:00:39 -0000 1.7 +++ date_api.php 18 May 2006 13:00:28 -0000 1.8 @@ -110,30 +110,29 @@ foreach( $t_chars as $t_char ) { if (strcmp( $t_char, "M") == 0) { - echo "<select name=\"" . $p_name . "_month\" $t_disable>" ; + echo "<select ", helper_get_tab_index(), " name=\"" . $p_name . "_month\" $t_disable>" ; echo $t_blank_line ; print_month_option_list( $t_date[1] ) ; echo "</select>\n" ; } if (strcmp( $t_char, "m") == 0) { - echo "<select name=\"" . $p_name . "_month\" $t_disable>" ; + echo "<select ", helper_get_tab_index(), " name=\"" . $p_name . "_month\" $t_disable>" ; echo $t_blank_line ; print_numeric_month_option_list( $t_date[1] ) ; echo "</select>\n" ; } if (strcasecmp( $t_char, "D") == 0) { - echo "<select name=\"" . $p_name . "_day\" $t_disable>" ; + echo "<select ", helper_get_tab_index(), " name=\"" . $p_name . "_day\" $t_disable>" ; echo $t_blank_line ; print_day_option_list( $t_date[2] ) ; echo "</select>\n" ; } if (strcasecmp( $t_char, "Y") == 0) { - echo "<select name=\"" . $p_name . "_year\" $t_disable>" ; + echo "<select ", helper_get_tab_index(), " name=\"" . $p_name . "_year\" $t_disable>" ; echo $t_blank_line ; print_year_range_option_list( $t_date[0], $p_year_start, $p_year_end ) ; echo "</select>\n" ; } } } - ?> Index: helper_api.php =================================================================== RCS file: /cvsroot/mantisbt/mantisbt/core/helper_api.php,v retrieving revision 1.66 retrieving revision 1.67 diff -u -d -r1.66 -r1.67 --- helper_api.php 18 May 2006 05:53:44 -0000 1.66 +++ helper_api.php 18 May 2006 13:00:28 -0000 1.67 @@ -365,4 +365,17 @@ return $t_filename . $p_suffix . $p_extension_with_dot; } + + # -------------------- + # returns a tab index and increments internal state by 1. This is used to give sequential tab index on + # a form. For example, this function returns: tabindex="1" + function helper_get_tab_index() { + static $tab_index = 1; + + $t_tab_index_attribute = 'tabindex="' . $tab_index . '"'; + + $tab_index++; + + return $t_tab_index_attribute; + } ?> \ No newline at end of file Index: print_api.php =================================================================== RCS file: /cvsroot/mantisbt/mantisbt/core/print_api.php,v retrieving revision 1.156 retrieving revision 1.157 diff -u -d -r1.156 -r1.157 --- print_api.php 18 May 2006 06:57:14 -0000 1.156 +++ print_api.php 18 May 2006 13:00:28 -0000 1.157 @@ -785,7 +785,7 @@ # resort the list into ascending order ksort( $t_enum_list ); reset( $t_enum_list ); - echo '<select name="' . $p_select_label . '">'; + echo '<select ', helper_get_tab_index(), ' name="' . $p_select_label . '">'; foreach ( $t_enum_list as $key => $val ) { echo "<option value=\"$key\""; check_selected( $key, $p_current_value ); |