Skip to content

Commit

Permalink
Issue #7917: "Update Information" button at top of update form
Browse files Browse the repository at this point in the history
This patch from stappel extends the use of the existing
$g_action_button_position configuration option to apply to the "Update
Information" button on the bug update form. This can make it a little
bit quicker/easier to update a bug without scrolling all the way down
the page to reach the bottom of the form. Again, this is optional and
disabled by default.
  • Loading branch information
davidhicks committed Oct 27, 2009
1 parent 829e821 commit d8fb6b2
Showing 1 changed file with 18 additions and 3 deletions.
21 changes: 18 additions & 3 deletions bug_update_advanced_page.php
Expand Up @@ -60,6 +60,11 @@

$tpl_bug_id = $f_bug_id;

$t_action_button_position = config_get( 'action_button_position' );

$tpl_top_buttons_enabled = $t_action_button_position == POSITION_TOP || $t_action_button_position == POSITION_BOTH;
$tpl_bottom_buttons_enabled = $t_action_button_position == POSITION_BOTTOM || $t_action_button_position == POSITION_BOTH;

$tpl_show_id = in_array( BUG_FIELD_ID, $t_fields );
$tpl_show_project = in_array( BUG_FIELD_PROJECT, $t_fields );
$tpl_show_category = in_array( BUG_FIELD_CATEGORY, $t_fields );
Expand Down Expand Up @@ -123,6 +128,14 @@
print_bracket_link( string_get_bug_view_url( $tpl_bug_id ), lang_get( 'back_to_bug_link' ) );
echo '</td></tr>';

# Submit Button
if ( $tpl_top_buttons_enabled ) {
echo '<tr><td class="center" colspan="6">';
echo '<input ', helper_get_tab_index(), ' type="submit" class="button" value="', lang_get( 'update_information_button' ), '" />';
echo '</td></tr>';
}


event_signal( 'EVENT_UPDATE_BUG_FORM_TOP', array( $tpl_bug_id, true ) );

if ( $tpl_show_id || $tpl_show_project || $tpl_show_category || $tpl_show_view_state || $tpl_show_date_submitted | $tpl_show_last_updated ) {
Expand Down Expand Up @@ -654,9 +667,11 @@
event_signal( 'EVENT_BUGNOTE_ADD_FORM', array( $tpl_bug_id ) );

# Submit Button
echo '<tr><td class="center" colspan="6">';
echo '<input ', helper_get_tab_index(), ' type="submit" class="button" value="', lang_get( 'update_information_button' ), '" />';
echo '</td></tr>';
if ( $tpl_bottom_buttons_enabled ) {
echo '<tr><td class="center" colspan="6">';
echo '<input ', helper_get_tab_index(), ' type="submit" class="button" value="', lang_get( 'update_information_button' ), '" />';
echo '</td></tr>';
}

echo '</table></form>';

Expand Down

0 comments on commit d8fb6b2

Please sign in to comment.