Skip to content

Commit

Permalink
Button to edit custom fields in manage project page
Browse files Browse the repository at this point in the history
The use of a hyperlink to edit Custom Fields is not consistent with the
other sections on the page (subprojects, versions).

This commit removes the hyperlink on the Custom Field's name, and adds
a new 'Edit' button in the Actions column instead.

We also modify the existing print_form_button() call that removes custom
field association, to use the function's $p_args_to_post parameter
instead of building a GET URL.

Fixes #28557
  • Loading branch information
dregad committed Jun 12, 2022
1 parent a19acf4 commit 1f11dd3
Showing 1 changed file with 21 additions and 6 deletions.
27 changes: 21 additions & 6 deletions manage_proj_edit_page.php
Original file line number Diff line number Diff line change
Expand Up @@ -718,8 +718,9 @@ class="btn btn-sm btn-primary btn-white btn-round"
foreach( $t_custom_fields as $t_field_id ) {
$t_desc = custom_field_get_definition( $t_field_id ); ?>
<tr>
<td><?php echo '<a href="manage_custom_field_edit_page.php?field_id=' . $t_field_id . '">' .
custom_field_get_display_name( $t_desc['name'] ) . '</a>' ?></td>
<td>
<?php echo custom_field_get_display_name( $t_desc['name'] ); ?>
</td>
<td class="center">
<form method="post" action="manage_proj_custom_field_update.php" class="form-inline">
<fieldset>
Expand All @@ -736,12 +737,26 @@ class="btn btn-sm btn-primary btn-white btn-round"
</fieldset>
</form>
</td>
<td class="center"><?php
<td class="center">
<?php
# You need global permissions to edit custom field defs
print_form_button(
"manage_proj_custom_field_remove.php?field_id=$t_field_id&project_id=$f_project_id",
lang_get( 'remove_link' )
); ?>
'manage_custom_field_edit_page.php?field_id=' . $t_field_id,
lang_get( 'edit' ),
array(
'return' => 'manage_proj_edit_page.php?project_id='
. $f_project_id . '#customfields',
)
);
print_form_button(
'manage_proj_custom_field_remove.php',
lang_get( 'remove_link' ),
array(
'field_id' => $t_field_id,
'project_id' => $f_project_id,
)
);
?>
</td>
</tr>
<?php
Expand Down

0 comments on commit 1f11dd3

Please sign in to comment.