Adding Target Version to bug_change_status_page.php

Post about your customizations to share with others.

Moderators: Developer, Contributor

Post Reply
nyamanza

Adding Target Version to bug_change_status_page.php

Post by nyamanza »

Hi All,

I would like to add the "Target Version" to the bug_change_status_page.php at the assignment level.

I am a newbie unfortunately, and not much of a developer but I have found that if I add the following to the bug_change_status_page.php at line 154:

Code: Select all

         <td class="category">
		<?php echo lang_get( 'target_version' ) ?>
	<td>
	<select <?php echo helper_get_tab_index() ?> name="target_version">
		<?php print_version_option_list( $t_bug->target_version, $t_bug->project_id, VERSION_ALL ) ?>
	</select>
	</td>
I can get the Target Version displayed with the drop down. If I change the drop down the data is saved so all there works fine.

However this is on all the change of bug statuses not just when I assign a bug. Is it possible to do this easily? Please can someone tell me how stoopid I am being ;)

Thanks!
matto
Posts: 13
Joined: 31 Jan 2007, 18:49

Post by matto »

you could put this before the code you added

<?php if ( 50 == $f_new_status ) { ?>

I'm pretty sure that assigned is status 50, but you can check the stats_enum_string in lang/strings_english.txt, or whatever language you're using, to find out what it is if that doesn't work.

and then after the code you added you can put

<?php } else { ?>
<td colspan="2">
<?php } ?>

What that will do is when the status you are changing to is 50, pretty sure that's assigned, it will put in the target version stuff, and if it isn't a 2 column spacer will be place instead.
nyamanza

Post by nyamanza »

:D

Matto thanks dude. Perfect answer and it worked a treat! Like brand new!
Rotem
Posts: 4
Joined: 03 May 2007, 15:14

Post by Rotem »

I have the Target_Version in my update screen, however I only want the component manager to have permissions to change it (and get a list of values) while everyone else should only see the value.
How can I do that ?
Please advice.
Post Reply