View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0003460 | mantisbt | custom fields | public | 2003-12-15 10:50 | 2016-08-18 03:10 |
Reporter | vboctor | Assigned To | |||
Priority | normal | Severity | minor | Reproducibility | always |
Status | new | Resolution | open | ||
Summary | 0003460: Custom Fields tab sequence | ||||
Description | This issue was reported by rabbe.kurten@rkrealtidssystem.com on online manual custom fields page: "I can get the custom fields ordered between themselves OK, but how do I get them into the ordinary tab sequence. When I press the tab key within a custom field I jump somewhere into one of the ordinary fields depending on where I was before going into the custom field. Is there a solution to this problem? | ||||
Tags | patch | ||||
Attached Files | mantis-3460.diff (8,163 bytes)
Index: bug_report_advanced_page.php =================================================================== RCS file: /cvsroot/mantisbt/mantisbt/bug_report_advanced_page.php,v retrieving revision 1.31 diff -u -r1.31 bug_report_advanced_page.php --- bug_report_advanced_page.php 11 Jan 2004 07:16:06 -0000 1.31 +++ bug_report_advanced_page.php 28 Feb 2004 22:02:46 -0000 @@ -300,6 +300,7 @@ <!-- Custom Fields --> <?php $t_custom_fields_found = false; + $custom_fields_count = 0; $t_related_custom_field_ids = custom_field_get_linked_ids( $t_project_id ); foreach( $t_related_custom_field_ids as $t_id ) { @@ -308,6 +309,7 @@ } $t_custom_fields_found = true; + $custom_fields_count++; $t_def = custom_field_get_definition( $t_id ); ?> <tr <?php echo helper_alternate_class() ?>> @@ -315,7 +317,7 @@ <?php echo lang_get_defaulted( $t_def['name'] ) ?> </td> <td> - <?php print_custom_field_input( $t_def ) ?> + <?php print_custom_field_input( $t_def, null, $custom_fields_count+15 ) ?> </td> </tr> <?php @@ -339,7 +341,7 @@ </td> <td> <input type="hidden" name="max_file_size" value="<?php echo config_get( 'max_file_size' ) ?>" /> - <input tabindex="16" name="file" type="file" size="60" /> + <input tabindex="<?php echo $custom_fields_count+16 ?>" name="file" type="file" size="60" /> </td> </tr> <?php } ?> @@ -351,8 +353,8 @@ <?php echo lang_get( 'view_status' ) ?> </td> <td> - <input tabindex="17" type="radio" name="view_state" value="<?php echo VS_PUBLIC ?>" <?php check_checked( $f_view_state, VS_PUBLIC ) ?> /> <?php echo lang_get( 'public' ) ?> - <input tabindex="18" type="radio" name="view_state" value="<?php echo VS_PRIVATE ?>" <?php check_checked( $f_view_state, VS_PRIVATE ) ?> /> <?php echo lang_get( 'private' ) ?> + <input tabindex="<?php echo $custom_fields_count+17>" type="radio" name="view_state" value="<?php echo VS_PUBLIC ?>" <?php check_checked( $f_view_state, VS_PUBLIC ) ?> /> <?php echo lang_get( 'public' ) ?> + <input tabindex="<?php echo $custom_fields_count+18>" type="radio" name="view_state" value="<?php echo VS_PRIVATE ?>" <?php check_checked( $f_view_state, VS_PRIVATE ) ?> /> <?php echo lang_get( 'private' ) ?> </td> </tr> @@ -363,7 +365,7 @@ <?php echo lang_get( 'report_stay' ) ?> <?php print_documentation_link( 'report_stay' ) ?> </td> <td> - <input tabindex="19" type="checkbox" name="report_stay" <?php check_checked( $f_report_stay ) ?> /> (<?php echo lang_get( 'check_report_more_bugs' ) ?>) + <input tabindex="<?php echo $custom_fields_count+19 ?>" type="checkbox" name="report_stay" <?php check_checked( $f_report_stay ) ?> /> (<?php echo lang_get( 'check_report_more_bugs' ) ?>) </td> </tr> @@ -374,7 +376,7 @@ <span class="required"> * <?php echo lang_get( 'required' ) ?></span> </td> <td class="center"> - <input tabindex="20" type="submit" value="<?php echo lang_get( 'submit_report_button' ) ?>" /> + <input tabindex="<?php echo $custom_fields_count+20 ?>" type="submit" value="<?php echo lang_get( 'submit_report_button' ) ?>" /> </td> </tr> Index: bug_report_page.php =================================================================== RCS file: /cvsroot/mantisbt/mantisbt/bug_report_page.php,v retrieving revision 1.31 diff -u -r1.31 bug_report_page.php --- bug_report_page.php 5 Feb 2004 10:57:01 -0000 1.31 +++ bug_report_page.php 28 Feb 2004 22:02:46 -0000 @@ -173,19 +173,21 @@ <!-- Custom Fields --> <?php $t_custom_fields_found = false; + $custom_fields_count = 0; $t_related_custom_field_ids = custom_field_get_linked_ids( $t_project_id ); foreach( $t_related_custom_field_ids as $t_id ) { $t_def = custom_field_get_definition( $t_id ); if( !$t_def['advanced'] && custom_field_has_write_access_to_project( $t_id, $t_project_id ) ) { $t_custom_fields_found = true; + $custom_fields_count++; ?> <tr <?php echo helper_alternate_class() ?>> <td class="category"> <?php echo lang_get_defaulted( $t_def['name'] ) ?> </td> <td> - <?php print_custom_field_input( $t_def ) ?> + <?php print_custom_field_input( $t_def, null, $custom_fields_count+7 ) ?> </td> </tr> <?php @@ -210,7 +212,7 @@ </td> <td> <input type="hidden" name="max_file_size" value="<?php echo config_get( 'max_file_size' ) ?>" /> - <input tabindex="8" name="file" type="file" size="60" /> + <input tabindex="<?php echo $custom_fields_count+8 ?>" name="file" type="file" size="60" /> </td> </tr> <?php } ?> @@ -222,8 +224,8 @@ <?php echo lang_get( 'view_status' ) ?> </td> <td> - <input tabindex="9" type="radio" name="view_state" value="<?php echo VS_PUBLIC ?>" <?php check_checked( $f_view_state, VS_PUBLIC ) ?> /> <?php echo lang_get( 'public' ) ?> - <input tabindex="10" type="radio" name="view_state" value="<?php echo VS_PRIVATE ?>" <?php check_checked( $f_view_state, VS_PRIVATE ) ?> /> <?php echo lang_get( 'private' ) ?> + <input tabindex="<?php echo $custom_fields_count+9 ?>" type="radio" name="view_state" value="<?php echo VS_PUBLIC ?>" <?php check_checked( $f_view_state, VS_PUBLIC ) ?> /> <?php echo lang_get( 'public' ) ?> + <input tabindex="<?php echo $custom_fields_count+10 ?>" type="radio" name="view_state" value="<?php echo VS_PRIVATE ?>" <?php check_checked( $f_view_state, VS_PRIVATE ) ?> /> <?php echo lang_get( 'private' ) ?> </td> </tr> @@ -234,7 +236,7 @@ <?php echo lang_get( 'report_stay' ) ?> <?php print_documentation_link( 'report_stay' ) ?> </td> <td> - <input tabindex="11" type="checkbox" name="report_stay" <?php check_checked( $f_report_stay ) ?> /> (<?php echo lang_get( 'check_report_more_bugs' ) ?>) + <input tabindex="<?php echo $custom_fields_count+11 ?>" type="checkbox" name="report_stay" <?php check_checked( $f_report_stay ) ?> /> (<?php echo lang_get( 'check_report_more_bugs' ) ?>) </td> </tr> @@ -245,7 +247,7 @@ <span class="required"> * <?php echo lang_get( 'required' ) ?></span> </td> <td class="center"> - <input tabindex="12" type="submit" value="<?php echo lang_get( 'submit_report_button' ) ?>" /> + <input tabindex="<?php echo $custom_fields_count+12 ?>" type="submit" value="<?php echo lang_get( 'submit_report_button' ) ?>" /> </td> </tr> Index: core/custom_field_api.php =================================================================== RCS file: /cvsroot/mantisbt/mantisbt/core/custom_field_api.php,v retrieving revision 1.24 diff -u -r1.24 custom_field_api.php --- core/custom_field_api.php 24 Feb 2004 23:51:38 -0000 1.24 +++ core/custom_field_api.php 28 Feb 2004 22:02:46 -0000 @@ -817,8 +817,10 @@ # $p_bug_id contains the bug where this field belongs to. If it's left # away, it'll default to 0 and thus belongs to a new (i.e. # non-existant) bug + # $p_tabindex tabindex value to set to the input control. If empty, it is + # ommitted in the html code. # NOTE: This probably belongs in the print_api.php - function print_custom_field_input( $p_field_def, $p_bug_id = null ) { + function print_custom_field_input( $p_field_def, $p_bug_id = null, $p_tabindex = null ) { $t_id = $p_field_def['id']; if( null == $p_bug_id ) { @@ -826,12 +828,18 @@ } else { $t_custom_field_value = custom_field_get_value( $t_id, $p_bug_id ); } + + if ( null == $p_tabindex ) { + $t_tabindex = ''; + } else { + $t_tabindex = " tabindex=\"$p_tabindex\" "; + } $t_custom_field_value = string_attribute( $t_custom_field_value ); switch ($p_field_def['type']) { case CUSTOM_FIELD_TYPE_ENUM: - echo "<select name=\"custom_field_$t_id\">"; + echo "<select $t_tabindex name=\"custom_field_$t_id\">"; $t_values = explode('|', $p_field_def['possible_values']); foreach( $t_values as $t_option ) { if( $t_custom_field_value == $t_option ) { @@ -847,7 +855,7 @@ case CUSTOM_FIELD_TYPE_EMAIL: default: case CUSTOM_FIELD_TYPE_STRING: - echo "<input type=\"text\" name=\"custom_field_$t_id\" size=\"80\""; + echo "<input $t_tabindex type=\"text\" name=\"custom_field_$t_id\" size=\"80\""; if( 0 < $p_field_def['length_max'] ) { echo ' maxlength="' . $p_field_def['length_max'] . '"'; } else { | ||||
I have tested this on IE 6 and Mantis 0.18.0rc1 and it seems to be fine. Can you tell me more about the environment? |
|
It works fine when editing an existing bug, but when entering a new bug the fields are quite hard to get to with the tab key as they are at a very weird place in the tab order. |
|
I think the patch solves the problem. The 'tabindex' attribute is added to the custom fields. |
|
Any objections or reasons why this shouldn't be applied?. If not, i'll look at updating this patch and getting it applied to CVS version |
|
I had a quick look at the patch. I don't object on the concept, but I think the implementation has a problem in terms of maintainability:
I would rather avoid absolute number since they will cause problems when an extra field is added. I suggest having a running counter "tabindex" which gets incremented and used all the time. echo ++$tabindex; There maybe a reason why this is not done, if that's the case lets see if we can find other way to avoid maintenance problems in the future. |
|
I can't remember why exactly I've written it this way. Probably because a more general approach like vboctor proposed, demands a lot of rewriting of the forms. But it is indeed not very maintanable right now... |
|
Hello everybody I think the "Tabbing-Problem" is still there in 1.12.15. Here are the steps to reproduce: 1) Add a custom field (I use "Transportauftrag") |
|
Duplicate 0010800 had a proposed pull request https://github.com/mantisbt/mantisbt/pull/145 that was not finalized as the original submitter never responded to review comments. |
|