View Issue Details

IDProjectCategoryView StatusLast Update
0009550mantisbtadministrationpublic2008-08-19 09:29
Reporterrumo Assigned To 
PrioritynormalSeverityfeatureReproducibilityhave not tried
Status newResolutionopen 
Product Version1.1.1 
Summary0009550: manage_proj_edit_page.php: Add description to versions table
Description

For me it is helpful when the versions' descriptions are displayed in the versions table when managing a project. Therefore I modified manage_proj_edit_page.php" and added the column "description" to the versions table. The description is truncated to max. 30 chars to fit in the table.

I am using MANTIS 1.1.1. Attached you find my modifications (lines 368-440) for the file identified by the following ID. Maybe it is worthwhile to be integrated into the official development branch.

$Id: manage_proj_edit_page.php,v 1.104.2.2 2007-10-19 07:25:59 vboctor Exp $

TagsNo tags attached.

Activities

2008-08-19 08:57

 

manage_proj_edit_page.php (1,946 bytes)   
<!-- Title -->
<tr>
	<td class="form-title" colspan="3">
		<?php echo lang_get( 'versions' ) ?>
	</td>
</tr>
<?php
	$t_versions = version_get_all_rows( $f_project_id );

	if ( count( $t_versions ) > 0 ) {
?>
		<tr class="row-category">
			<td>
				<?php echo lang_get( 'version' ) ?>
			</td>
			<td class="center">
				<?php echo lang_get( 'released' ) ?>
			</td>
			<td class="center">
				<?php echo lang_get( 'timestamp' ) ?>
			</td>
			<td class="center">
				<?php echo lang_get( 'description' ) ?>
			</td>
			<td class="center">
				<?php echo lang_get( 'actions' ) ?>
			</td>
		</tr>
<?php
	}

    <!-- This constant should be moved to a more suitable place. -->
    $MAX_LEN_DESCRIPTION = 30;
    
	foreach ( $t_versions as $t_version ) {
		$t_name = $t_version['version'];
		$t_released = $t_version['released'];
		$t_date_order = $t_version['date_order'];
		$t_date_formatted = string_format_complete_date( $t_version['date_order'] );
		$t_description = $t_version['description'];
		if (strlen($t_description) > $MAX_LEN_DESCRIPTION) {
            $t_description = substr($t_description, 0, $MAX_LEN_DESCRIPTION) . '...';
        }
?>
<!-- Repeated Info Rows -->
		<tr <?php echo helper_alternate_class() ?>>
			<td>
				<?php echo string_display( $t_name ) ?>
			</td>
			<td class="center">
				<?php echo trans_bool( $t_released ) ?>
			</td>
			<td class="center">
				<?php echo $t_date_formatted ?>
			</td>
			<td class="center">
				<?php echo $t_description ?>
			</td>
			<td class="center">
				<?php
					$t_version_id = version_get_id( $t_name, $f_project_id );

					print_button( 'manage_proj_ver_edit_page.php?version_id=' . $t_version_id, lang_get( 'edit_link' ) );
					echo '&nbsp;';
					print_button( 'manage_proj_ver_delete.php?version_id=' . $t_version_id, lang_get( 'delete_link' ) );
				?>
			</td>
		</tr>
<?php
	} # end for loop
?>
manage_proj_edit_page.php (1,946 bytes)   

2008-08-19 09:28

 

manage_proj_edit_page-02.php (3,209 bytes)   
<!-- PROJECT VERSIONS -->
<a name="versions" />
<table class="width75" cellspacing="1">

<!-- Title -->
<tr>
	<td class="form-title" colspan="5">
		<?php echo lang_get( 'versions' ) ?>
	</td>
</tr>
<?php
	$t_versions = version_get_all_rows( $f_project_id );

	if ( count( $t_versions ) > 0 ) {
?>
		<tr class="row-category">
			<td width="10%">
				<?php echo lang_get( 'version' ) ?>
			</td>
			<td width="10%" class="center">
				<?php echo lang_get( 'released' ) ?>
			</td>
			<td width="20%" class="center">
				<?php echo lang_get( 'timestamp' ) ?>
			</td>
			<td width="40%" class="center">
				<?php echo lang_get( 'description' ) ?>
			</td>
			<td width="20%" class="center">
				<?php echo lang_get( 'actions' ) ?>
			</td>
		</tr>
<?php
	}

    // This constant should be moved to a more suitable place.
    $MAX_LEN_DESCRIPTION = 40;

	foreach ( $t_versions as $t_version ) {
		$t_name = $t_version['version'];
		$t_released = $t_version['released'];
		$t_date_order = $t_version['date_order'];
		$t_date_formatted = string_format_complete_date( $t_version['date_order'] );
		$t_description = $t_version['description'];
		if (strlen($t_description) > $MAX_LEN_DESCRIPTION) {
            $t_description = substr($t_description, 0, $MAX_LEN_DESCRIPTION) . '...';
        }
?>
<!-- Repeated Info Rows -->
		<tr <?php echo helper_alternate_class() ?>>
			<td>
				<?php echo string_display( $t_name ) ?>
			</td>
			<td class="center">
				<?php echo trans_bool( $t_released ) ?>
			</td>
			<td class="center">
				<?php echo $t_date_formatted ?>
			</td>
			<td class="center">
				<?php echo $t_description ?>
			</td>
			<td class="center">
				<?php
					$t_version_id = version_get_id( $t_name, $f_project_id );

					print_button( 'manage_proj_ver_edit_page.php?version_id=' . $t_version_id, lang_get( 'edit_link' ) );
					echo '&nbsp;';
					print_button( 'manage_proj_ver_delete.php?version_id=' . $t_version_id, lang_get( 'delete_link' ) );
				?>
			</td>
		</tr>
<?php
	} # end for loop
?>

<!-- Version Add Form -->
<tr>
	<td class="left" colspan="5">
		<form method="post" action="manage_proj_ver_add.php">
			<input type="hidden" name="project_id" value="<?php echo $f_project_id ?>" />
			<input type="text" name="version" size="32" maxlength="64" />
			<input type="submit" name="add_version" class="button" value="<?php echo lang_get( 'add_version_button' ) ?>" />
			<input type="submit" name="add_and_edit_version" class="button" value="<?php echo lang_get( 'add_and_edit_version_button' ) ?>" />
		</form>
	</td>
</tr>
<tr>
	<td class="left" colspan="5">
		<form method="post" action="manage_proj_ver_copy.php">
			<input type="hidden" name="project_id" value="<?php echo $f_project_id ?>" />
			<select name="other_project_id">
				<?php print_project_option_list( null, false, $f_project_id ); ?>
			</select>
			<input type="submit" name="copy_from" class="button" value="<?php echo lang_get( 'copy_versions_from' ) ?>" />
			<input type="submit" name="copy_to" class="button" value="<?php echo lang_get( 'copy_versions_to' ) ?>" />
		</form>
	</td>
</tr>
</table>
</div>
manage_proj_edit_page-02.php (3,209 bytes)   
rumo

rumo

2008-08-19 09:29

reporter   ~0019178

I added "manage_proj_edit_page-02.php" with some corrections.

Issue History

Date Modified Username Field Change
2008-08-19 08:57 rumo New Issue
2008-08-19 08:57 rumo File Added: manage_proj_edit_page.php
2008-08-19 09:28 rumo File Added: manage_proj_edit_page-02.php
2008-08-19 09:29 rumo Note Added: 0019178