Page 1 of 1

Adding Target Version to bug_change_status_page.php

Posted: 22 May 2007, 02:56
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!

Posted: 22 May 2007, 12:55
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.

Posted: 23 May 2007, 03:13
by nyamanza
:D

Matto thanks dude. Perfect answer and it worked a treat! Like brand new!

Posted: 11 Jun 2007, 14:00
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.