View Issue Details

IDProjectCategoryView StatusLast Update
0012526mantisbtattachmentspublic2011-08-05 02:31
Reporteristvanb Assigned Toatrol  
PrioritynormalSeverityminorReproducibilityN/A
Status closedResolutionduplicate 
Product Version1.2.3 
Summary0012526: How to add multiple files to the issue at issue report
Description

The issue is related to: http://www.mantisbt.org/bugs/view.php?id=10223

That link above contains a small patch from Cas which allows the user to upload multiple files when the issue is already created, but not when the user reports the issue.

My mod modifies the following files:
bug_report.php
bug_report_page.php

and now the user is allowed to upload as many files as the "$g_max_file_num" defines in the config_inc.php. (please see the linked issue to understand that variable)

I think this feature is missing from Mantis now. Especially since many times the user would like to attach multiple files when he/she creates the issue.

At the same time I have to say it would be apprechiated if somebody would check my change.

TagsNo tags attached.
Attached Files
bug_report.php (10,042 bytes)   
<?php
# MantisBT - a php based bugtracking system

# MantisBT is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 2 of the License, or
# (at your option) any later version.
#
# MantisBT is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with MantisBT.  If not, see <http://www.gnu.org/licenses/>.

	/**
	 * This page stores the reported bug
	 *
	 * @package MantisBT
	 * @copyright Copyright (C) 2000 - 2002  Kenzaburo Ito - kenito@300baud.org
	 * @copyright Copyright (C) 2002 - 2010  MantisBT Team - mantisbt-dev@lists.sourceforge.net
	 * @link http://www.mantisbt.org
	 */
	 /**
	  * MantisBT Core API's
	  */
	require_once( 'core.php' );

	require_once( 'string_api.php' );
	require_once( 'file_api.php' );
	require_once( 'bug_api.php' );
	require_once( 'custom_field_api.php' );

	form_security_validate( 'bug_report' );

	access_ensure_project_level( config_get('report_bug_threshold' ) );

	$t_bug_data = new BugData;
	$t_bug_data->build				= gpc_get_string( 'build', '' );
	$t_bug_data->platform				= gpc_get_string( 'platform', '' );
	$t_bug_data->os					= gpc_get_string( 'os', '' );
	$t_bug_data->os_build				= gpc_get_string( 'os_build', '' );
	$t_bug_data->version			= gpc_get_string( 'product_version', '' );
	$t_bug_data->profile_id			= gpc_get_int( 'profile_id', 0 );
	$t_bug_data->handler_id			= gpc_get_int( 'handler_id', 0 );
	$t_bug_data->view_state			= gpc_get_int( 'view_state', config_get( 'default_bug_view_status' ) );

	$t_bug_data->category_id			= gpc_get_int( 'category_id', 0 );
	$t_bug_data->reproducibility		= gpc_get_int( 'reproducibility', config_get( 'default_bug_reproducibility' ) );
	$t_bug_data->severity				= gpc_get_int( 'severity', config_get( 'default_bug_severity' ) );
	$t_bug_data->priority				= gpc_get_int( 'priority', config_get( 'default_bug_priority' ) );
	$t_bug_data->projection				= gpc_get_int( 'projection', config_get( 'default_bug_projection' ) );
	$t_bug_data->eta					= gpc_get_int( 'eta', config_get( 'default_bug_eta' ) );
	$t_bug_data->resolution				= config_get( 'default_bug_resolution' );
	$t_bug_data->status					= config_get( 'bug_submit_status' );
	$t_bug_data->summary				= gpc_get_string( 'summary' );
	$t_bug_data->description			= gpc_get_string( 'description' );
	$t_bug_data->steps_to_reproduce	= gpc_get_string( 'steps_to_reproduce', config_get( 'default_bug_steps_to_reproduce' ) );
	$t_bug_data->additional_information	= gpc_get_string( 'additional_info', config_get ( 'default_bug_additional_info' ) );
	$t_bug_data->due_date 				= gpc_get_string( 'due_date', '');
	if ( is_blank ( $t_bug_data->due_date ) ) {
		$t_bug_data->due_date = date_get_null();
	} else {
		$t_bug_data->due_date = $t_bug_data->due_date;
	}

//	$f_file					= gpc_get_file( 'file', null ); /** @todo (thraxisp) Note that this always returns a structure */
//															# size = 0, if no file
															
//	$f_file2					= gpc_get_file( "file".$f_szam."", null ); /** @todo (thraxisp) Note that this always returns a structure */
//															# size = 0, if no file															
															
	$f_report_stay			= gpc_get_bool( 'report_stay', false );
	$t_bug_data->project_id			= gpc_get_int( 'project_id' );

	$t_bug_data->reporter_id		= auth_get_current_user_id();

	$t_bug_data->summary			= trim( $t_bug_data->summary );

	if ( access_has_project_level( config_get( 'roadmap_update_threshold' ), $t_bug_data->project_id ) ) {
		$t_bug_data->target_version = gpc_get_string( 'target_version', '' );
	}

	# if a profile was selected then let's use that information
	if ( 0 != $t_bug_data->profile_id ) {
		if ( profile_is_global( $t_bug_data->profile_id ) ) {
			$row = user_get_profile_row( ALL_USERS, $t_bug_data->profile_id );
		} else {
			$row = user_get_profile_row( $t_bug_data->reporter_id, $t_bug_data->profile_id );
		}

		if ( is_blank( $t_bug_data->platform ) ) {
			$t_bug_data->platform = $row['platform'];
		}
		if ( is_blank( $t_bug_data->os ) ) {
			$t_bug_data->os = $row['os'];
		}
		if ( is_blank( $t_bug_data->os_build ) ) {
			$t_bug_data->os_build = $row['os_build'];
		}
	}
	helper_call_custom_function( 'issue_create_validate', array( $t_bug_data ) );

	# Validate the custom fields before adding the bug.
	$t_related_custom_field_ids = custom_field_get_linked_ids( $t_bug_data->project_id );
	foreach( $t_related_custom_field_ids as $t_id ) {
		$t_def = custom_field_get_definition( $t_id );

		# Produce an error if the field is required but wasn't posted
		if ( !gpc_isset_custom_field( $t_id, $t_def['type'] ) &&
			( $t_def['require_report'] ||
				$t_def['type'] == CUSTOM_FIELD_TYPE_ENUM ||
				$t_def['type'] == CUSTOM_FIELD_TYPE_LIST ||
				$t_def['type'] == CUSTOM_FIELD_TYPE_MULTILIST ||
				$t_def['type'] == CUSTOM_FIELD_TYPE_RADIO ) ) {
			error_parameters( lang_get_defaulted( custom_field_get_field( $t_id, 'name' ) ) );
			trigger_error( ERROR_EMPTY_FIELD, ERROR );
		}
		if ( !custom_field_validate( $t_id, gpc_get_custom_field( "custom_field_$t_id", $t_def['type'], NULL ) ) ) {
			error_parameters( lang_get_defaulted( custom_field_get_field( $t_id, 'name' ) ) );
			trigger_error( ERROR_CUSTOM_FIELD_INVALID_VALUE, ERROR );
		}
	}

	# Allow plugins to pre-process bug data
	$t_bug_data = event_signal( 'EVENT_REPORT_BUG_DATA', $t_bug_data );

	# Create the bug
	$t_bug_id = $t_bug_data->create();

	# Mark the added issue as visited so that it appears on the last visited list.
	last_visited_issue( $t_bug_id );

	# Read the number of attachment from the bug_report_page.php and attach them to the issue
	For ( $i = 0	; $i < $g_max_file_num	; $i++ ) 
		{
		if (!empty($_FILES['ufile']['name'][$i]))
			{
			$f_file['name'] = $_FILES['ufile']['name'][$i];
			$f_file['tmp_name'] = $_FILES['ufile']['tmp_name'][$i];
			$f_file['type'] = $_FILES['ufile']['type'][$i];
			$f_file['size'] = $_FILES['ufile']['size'][$i];
			file_add( $t_bug_id, $f_file, 'bug' );
			}
		}
	
	# Handle custom field submission
	foreach( $t_related_custom_field_ids as $t_id ) {
		# Do not set custom field value if user has no write access.
		if( !custom_field_has_write_access( $t_id, $t_bug_id ) ) {
			continue;
		}

		$t_def = custom_field_get_definition( $t_id );
		if( !custom_field_set_value( $t_id, $t_bug_id, gpc_get_custom_field( "custom_field_$t_id", $t_def['type'], '' ), false ) ) {
			error_parameters( lang_get_defaulted( custom_field_get_field( $t_id, 'name' ) ) );
			trigger_error( ERROR_CUSTOM_FIELD_INVALID_VALUE, ERROR );
		}
	}

	$f_master_bug_id = gpc_get_int( 'm_id', 0 );
	$f_rel_type = gpc_get_int( 'rel_type', -1 );

	if ( $f_master_bug_id > 0 ) {
		# it's a child generation... let's create the relationship and add some lines in the history

		# update master bug last updated
		bug_update_date( $f_master_bug_id );

		# Add log line to record the cloning action
		history_log_event_special( $t_bug_id, BUG_CREATED_FROM, '', $f_master_bug_id );
		history_log_event_special( $f_master_bug_id, BUG_CLONED_TO, '', $t_bug_id );

		if ( $f_rel_type >= 0 ) {
			# Add the relationship
			relationship_add( $t_bug_id, $f_master_bug_id, $f_rel_type );

			# Add log line to the history (both issues)
			history_log_event_special( $f_master_bug_id, BUG_ADD_RELATIONSHIP, relationship_get_complementary_type( $f_rel_type ), $t_bug_id );
			history_log_event_special( $t_bug_id, BUG_ADD_RELATIONSHIP, $f_rel_type, $f_master_bug_id );

			# Send the email notification
			email_relationship_added( $f_master_bug_id, $t_bug_id, relationship_get_complementary_type( $f_rel_type ) );
		}
	}

	helper_call_custom_function( 'issue_create_notify', array( $t_bug_id ) );

	# Allow plugins to post-process bug data with the new bug ID
	event_signal( 'EVENT_REPORT_BUG', array( $t_bug_data, $t_bug_id ) );

	email_new_bug( $t_bug_id );

	form_security_purge( 'bug_report' );

	html_page_top1();

	if ( !$f_report_stay ) {
		html_meta_redirect( 'view_all_bug_page.php' );
	}

	html_page_top2();
?>
<br />
<div align="center">
<?php
	echo lang_get( 'operation_successful' ) . '<br />';
	print_bracket_link( string_get_bug_view_url( $t_bug_id ), sprintf( lang_get( 'view_submitted_bug_link' ), $t_bug_id ) );
	print_bracket_link( 'view_all_bug_page.php', lang_get( 'view_bugs_link' ) );

	if ( $f_report_stay ) {
?>
	<p>
	<form method="post" action="<?php echo string_get_bug_report_url() ?>">
	<?php # CSRF protection not required here - form does not result in modifications ?>
		<input type="hidden" name="category_id" 	value="<?php echo $t_bug_data->category_id ?>" />
		<input type="hidden" name="severity" 		value="<?php echo $t_bug_data->severity ?>" />
		<input type="hidden" name="reproducibility" 	value="<?php echo $t_bug_data->reproducibility ?>" />
		<input type="hidden" name="profile_id" 		value="<?php echo $t_bug_data->profile_id ?>" />
		<input type="hidden" name="platform" 		value="<?php echo $t_bug_data->platform ?>" />
		<input type="hidden" name="os" 			value="<?php echo $t_bug_data->os ?>" />
		<input type="hidden" name="os_build" 		value="<?php echo $t_bug_data->os_build ?>" />
		<input type="hidden" name="product_version" 	value="<?php echo $t_bug_data->version ?>" />
		<input type="hidden" name="target_version" 	value="<?php echo $t_bug_data->target_version ?>" />
		<input type="hidden" name="build" 		value="<?php echo $t_bug_data->build ?>" />
		<input type="hidden" name="report_stay" 	value="1" />
		<input type="hidden" name="view_state"		value="<?php echo $t_bug_data->view_state ?>" />
		<input type="hidden" name="due_date"		value="<?php echo $t_bug_data->due_date ?>" />
		<input type="submit" class="button" 		value="<?php echo lang_get( 'report_more_bugs' ) ?>" />
	</form>
	</p>
<?php
	}
?>
</div>

<?php
	html_page_bottom();
bug_report.php (10,042 bytes)   
bug_report_page.php (19,444 bytes)   
<?php
# MantisBT - a php based bugtracking system

# MantisBT is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 2 of the License, or
# (at your option) any later version.
#
# MantisBT is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with MantisBT.  If not, see <http://www.gnu.org/licenses/>.

	/**
	 * This file POSTs data to report_bug.php
	 *
	 * @package MantisBT
	 * @copyright Copyright (C) 2000 - 2002  Kenzaburo Ito - kenito@300baud.org
	 * @copyright Copyright (C) 2002 - 2010  MantisBT Team - mantisbt-dev@lists.sourceforge.net
	 * @link http://www.mantisbt.org
	 */

	 $g_allow_browser_cache = 1;

	 /**
	  * MantisBT Core API's
	  */
	require_once( 'core.php' );

	require_once( 'file_api.php' );
	require_once( 'custom_field_api.php' );
	require_once( 'last_visited_api.php' );
	require_once( 'projax_api.php' );
	require_once( 'collapse_api.php' );

	$f_master_bug_id = gpc_get_int( 'm_id', 0 );

	# this page is invalid for the 'All Project' selection except if this is a clone
	if ( ( ALL_PROJECTS == helper_get_current_project() ) && ( 0 == $f_master_bug_id ) ) {
		print_header_redirect( 'login_select_proj_page.php?ref=bug_report_page.php' );
	}

	if ( $f_master_bug_id > 0 ) {
		# master bug exists...
		bug_ensure_exists( $f_master_bug_id );

		# master bug is not read-only...
		if ( bug_is_readonly( $f_master_bug_id ) ) {
			error_parameters( $f_master_bug_id );
			trigger_error( ERROR_BUG_READ_ONLY_ACTION_DENIED, ERROR );
		}

		$t_bug = bug_get( $f_master_bug_id, true );

		# the user can at least update the master bug (needed to add the relationship)...
		access_ensure_bug_level( config_get( 'update_bug_threshold', null, $t_bug->project_id ), $f_master_bug_id );

		#@@@ (thraxisp) Note that the master bug is cloned into the same project as the master, independent of
		#       what the current project is set to.
		if( $t_bug->project_id != helper_get_current_project() ) {
            # in case the current project is not the same project of the bug we are viewing...
            # ... override the current project. This to avoid problems with categories and handlers lists etc.
            $g_project_override = $t_bug->project_id;
            $t_changed_project = true;
        } else {
            $t_changed_project = false;
        }

	    access_ensure_project_level( config_get( 'report_bug_threshold' ) );

		$f_build				= $t_bug->build;
		$f_platform				= $t_bug->platform;
		$f_os					= $t_bug->os;
		$f_os_build				= $t_bug->os_build;
		$f_product_version		= $t_bug->version;
		$f_target_version		= $t_bug->target_version;
		$f_profile_id			= 0;
		$f_handler_id			= $t_bug->handler_id;

		$f_category_id			= $t_bug->category_id;
		$f_reproducibility		= $t_bug->reproducibility;
		$f_severity				= $t_bug->severity;
		$f_priority				= $t_bug->priority;
		$f_summary				= $t_bug->summary;
		$f_description			= $t_bug->description;
		$f_steps_to_reproduce	= $t_bug->steps_to_reproduce;
		$f_additional_info		= $t_bug->additional_information;
		$f_view_state			= $t_bug->view_state;
		$f_due_date				= $t_bug->due_date;

		$t_project_id			= $t_bug->project_id;
	} else {
	    access_ensure_project_level( config_get( 'report_bug_threshold' ) );

		$f_build				= gpc_get_string( 'build', '' );
		$f_platform				= gpc_get_string( 'platform', '' );
		$f_os					= gpc_get_string( 'os', '' );
		$f_os_build				= gpc_get_string( 'os_build', '' );
		$f_product_version		= gpc_get_string( 'product_version', '' );
		$f_target_version		= gpc_get_string( 'target_version', '' );
		$f_profile_id			= gpc_get_int( 'profile_id', 0 );
		$f_handler_id			= gpc_get_int( 'handler_id', 0 );

		$f_category_id			= gpc_get_int( 'category_id', 0 );
		$f_reproducibility		= gpc_get_int( 'reproducibility', config_get( 'default_bug_reproducibility' ) );
		$f_severity				= gpc_get_int( 'severity', config_get( 'default_bug_severity' ) );
		$f_priority				= gpc_get_int( 'priority', config_get( 'default_bug_priority' ) );
		$f_summary				= gpc_get_string( 'summary', '' );
		$f_description			= gpc_get_string( 'description', '' );
		$f_steps_to_reproduce	= gpc_get_string( 'steps_to_reproduce', config_get( 'default_bug_steps_to_reproduce' ) );
		$f_additional_info		= gpc_get_string( 'additional_info', config_get ( 'default_bug_additional_info' ) );
		$f_view_state			= gpc_get_int( 'view_state', config_get( 'default_bug_view_status' ) );
		$f_due_date				= gpc_get_string( 'due_date', '');

		if ( $f_due_date == '' ) {
			$f_due_date = date_get_null();
		}

		$t_project_id			= helper_get_current_project();

		$t_changed_project		= false;
	}

	$f_report_stay			= gpc_get_bool( 'report_stay', false );

	$t_fields = config_get( 'bug_report_page_fields' );
	$t_fields = columns_filter_disabled( $t_fields );

	$tpl_show_category = in_array( 'category_id', $t_fields );
	$tpl_show_reproducibility = in_array( 'reproducibility', $t_fields );
	$tpl_show_severity = in_array( 'severity', $t_fields );
	$tpl_show_priority = in_array( 'priority', $t_fields );
	$tpl_show_steps_to_reproduce = in_array( 'steps_to_reproduce', $t_fields );
	$tpl_show_handler = in_array( 'handler', $t_fields ) && access_has_project_level( config_get( 'update_bug_assign_threshold' ) );
	$tpl_show_profiles = config_get( 'enable_profiles' );
	$tpl_show_platform = $tpl_show_profiles && in_array( 'platform', $t_fields );
	$tpl_show_os = $tpl_show_profiles && in_array( 'os', $t_fields );
	$tpl_show_os_version = $tpl_show_profiles && in_array( 'os_version', $t_fields );

	$tpl_show_versions = version_should_show_product_version( $t_project_id );
	$tpl_show_product_version = $tpl_show_versions && in_array( 'product_version', $t_fields );
	$tpl_show_product_build = $tpl_show_versions && in_array( 'product_build', $t_fields ) && config_get( 'enable_product_build' ) == ON;
	$tpl_show_target_version = $tpl_show_versions && in_array( 'target_version', $t_fields ) && access_has_project_level( config_get( 'roadmap_update_threshold' ) );
	$tpl_show_additional_info = in_array( 'additional_info', $t_fields );
	$tpl_show_due_date = in_array( 'due_date', $t_fields ) && access_has_project_level( config_get( 'due_date_update_threshold' ), helper_get_current_project(), auth_get_current_user_id() );
	$tpl_show_attachments = in_array( 'attachments', $t_fields ) && file_allow_bug_upload();
	$tpl_show_view_state = in_array( 'view_state', $t_fields ) && access_has_project_level( config_get( 'set_view_status_threshold' ) );

	# don't index bug report page
	html_robots_noindex();

	html_page_top( lang_get( 'report_bug_link' ) );

	print_recently_visited();
?>
<br />
<div align="center">
<form name="report_bug_form" method="post" <?php if ( $tpl_show_attachments ) { echo 'enctype="multipart/form-data"'; } ?> action="bug_report.php">
<?php echo form_security_field( 'bug_report' ) ?>
<table class="width90" cellspacing="1">
	<tr>
		<td class="form-title" colspan="2">
			<input type="hidden" name="m_id" value="<?php echo $f_master_bug_id ?>" />
			<input type="hidden" name="project_id" value="<?php echo $t_project_id ?>" />
			<?php echo lang_get( 'enter_report_details_title' ) ?>
		</td>
	</tr>
<?php
	event_signal( 'EVENT_REPORT_BUG_FORM_TOP', array( $t_project_id ) );

	if ( $tpl_show_category ) {
?>
	<tr <?php echo helper_alternate_class() ?>>
		<td class="category" width="30%">
			<?php echo config_get( 'allow_no_category' ) ? '' : '<span class="required">*</span>'; print_documentation_link( 'category' ) ?>
		</td>
		<td width="70%">
			<?php if ( $t_changed_project ) {
				echo "[" . project_get_field( $t_bug->project_id, 'name' ) . "] ";
			} ?>
			<select <?php echo helper_get_tab_index() ?> name="category_id">
				<?php
					print_category_option_list( $f_category_id );
				?>
			</select>
		</td>
	</tr>
<?php }

	if ( $tpl_show_reproducibility ) {
?>

	<tr <?php echo helper_alternate_class() ?>>
		<td class="category">
			<?php print_documentation_link( 'reproducibility' ) ?>
		</td>
		<td>
			<select <?php echo helper_get_tab_index() ?> name="reproducibility">
				<?php print_enum_string_option_list( 'reproducibility', $f_reproducibility ) ?>
			</select>
		</td>
	</tr>
<?php
	}

	if ( $tpl_show_severity ) {
?>
	<tr <?php echo helper_alternate_class() ?>>
		<td class="category">
			<?php print_documentation_link( 'severity' ) ?>
		</td>
		<td>
			<select <?php echo helper_get_tab_index() ?> name="severity">
				<?php print_enum_string_option_list( 'severity', $f_severity ) ?>
			</select>
		</td>
	</tr>
<?php
	}

	if ( $tpl_show_priority ) {
?>
	<tr <?php echo helper_alternate_class() ?>>
		<td class="category">
			<?php print_documentation_link( 'priority' ) ?>
		</td>
		<td>
			<select <?php echo helper_get_tab_index() ?> name="priority">
				<?php print_enum_string_option_list( 'priority', $f_priority ) ?>
			</select>
		</td>
	</tr>
<?php
	}

	if ( $tpl_show_due_date ) {
		$t_date_to_display = '';

		if ( !date_is_null( $f_due_date ) ) {
			$t_date_to_display = date( config_get( 'calendar_date_format' ), $f_due_date );
		}
?>
	<tr <?php echo helper_alternate_class() ?>>
		<td class="category">
			<?php print_documentation_link( 'due_date' ) ?>
		</td>
		<td>
		<?php
		    print "<input ".helper_get_tab_index()." type=\"text\" id=\"due_date\" name=\"due_date\" size=\"20\" maxlength=\"10\" value=\"".$t_date_to_display."\" />";
			date_print_calendar();
		?>
		</td>
	</tr>
<?php } ?>
<?php if ( $tpl_show_platform || $tpl_show_os || $tpl_show_os_version ) { ?>
	<tr <?php echo helper_alternate_class() ?>>
		<td class="category">
			<?php echo lang_get( 'select_profile' ) ?>
		</td>
		<td>
			<?php if (count(profile_get_all_for_user( auth_get_current_user_id() )) > 0) { ?>
				<select <?php echo helper_get_tab_index() ?> name="profile_id">
					<?php print_profile_option_list( auth_get_current_user_id(), $f_profile_id ) ?>
				</select>
			<?php } ?>
		</td>
	</tr>
	<tr <?php echo helper_alternate_class() ?>>
		<td colspan="2" class="none">
			<?php if( ON == config_get( 'use_javascript' ) ) { ?>
				<?php collapse_open( 'profile' ); collapse_icon('profile'); ?>
				<?php echo lang_get( 'or_fill_in' ); ?>
			<table class="width90" cellspacing="0">
					<?php } else { ?>
						<?php echo lang_get( 'or_fill_in' ); ?>
					<?php } ?>
					<tr <?php echo helper_alternate_class() ?>>
						<td class="category">
							<?php echo lang_get( 'platform' ) ?>
						</td>
						<td>
							<?php if ( config_get( 'allow_freetext_in_profile_fields' ) == OFF ) { ?>
							<select name="platform">
								<option value=""></option>
								<?php print_platform_option_list( $f_platform ); ?>
							</select>
							<?php
								} else {
									projax_autocomplete( 'platform_get_with_prefix', 'platform', array( 'value' => $f_platform, 'size' => '32', 'maxlength' => '32', 'tabindex' => helper_get_tab_index_value() ) );
								}
							?>
						</td>
					</tr>
					<tr <?php echo helper_alternate_class() ?>>
						<td class="category">
							<?php echo lang_get( 'os' ) ?>
						</td>
						<td>
							<?php if ( config_get( 'allow_freetext_in_profile_fields' ) == OFF ) { ?>
							<select name="os">
								<option value=""></option>
								<?php print_os_option_list( $f_os ); ?>
							</select>
							<?php
								} else {
									projax_autocomplete( 'os_get_with_prefix', 'os', array( 'value' => $f_os, 'size' => '32', 'maxlength' => '32', 'tabindex' => helper_get_tab_index_value() ) );
								}
							?>
						</td>
					</tr>
					<tr <?php echo helper_alternate_class() ?>>
						<td class="category">
							<?php echo lang_get( 'os_version' ) ?>
						</td>
						<td>
							<?php
								if ( config_get( 'allow_freetext_in_profile_fields' ) == OFF ) {
							?>
							<select name="os_build">
								<option value=""></option>
									<?php print_os_build_option_list( $f_os_build ); ?>
								</select>
							<?php
								} else {
									projax_autocomplete( 'os_build_get_with_prefix', 'os_build', array( 'value' => $f_os_build, 'size' => '16', 'maxlength' => '16', 'tabindex' => helper_get_tab_index_value() ) );
								}
							?>
						</td>
					</tr>
			<?php if( ON == config_get( 'use_javascript' ) ) { ?>
			</table>
			<?php collapse_closed( 'profile' ); collapse_icon('profile'); echo lang_get( 'or_fill_in' );?>
			<?php collapse_end( 'profile' ); ?>
		<?php } ?>
		</td>
	</tr>
<?php } ?>
<?php
	if ( $tpl_show_product_version ) {
		$t_product_version_released_mask = VERSION_RELEASED;

		if (access_has_project_level( config_get( 'report_issues_for_unreleased_versions_threshold' ) ) ) {
			$t_product_version_released_mask = VERSION_ALL;
		}
?>
	<tr <?php echo helper_alternate_class() ?>>
		<td class="category">
			<?php echo lang_get( 'product_version' ) ?>
		</td>
		<td>
			<select <?php echo helper_get_tab_index() ?> name="product_version">
				<?php print_version_option_list( $f_product_version, $t_project_id, $t_product_version_released_mask ) ?>
			</select>
		</td>
	</tr>
<?php
	}
?>
<?php if ( $tpl_show_product_build ) { ?>
	<tr <?php echo helper_alternate_class() ?>>
		<td class="category">
			<?php echo lang_get( 'product_build' ) ?>
		</td>
		<td>
			<input <?php echo helper_get_tab_index() ?> type="text" name="build" size="32" maxlength="32" value="<?php echo string_attribute( $f_build ) ?>" />
		</td>
	</tr>
<?php } ?>

<?php if ( $tpl_show_handler ) { ?>
	<tr <?php echo helper_alternate_class() ?>>
		<td class="category">
			<?php echo lang_get( 'assign_to' ) ?>
		</td>
		<td>
			<select <?php echo helper_get_tab_index() ?> name="handler_id">
				<option value="0" selected="selected"></option>
				<?php print_assign_to_option_list( $f_handler_id ) ?>
			</select>
		</td>
	</tr>
<?php } ?>

<?php // Target Version (if permissions allow)
	if ( $tpl_show_target_version ) { ?>
	<tr <?php echo helper_alternate_class() ?>>
		<td class="category">
			<?php echo lang_get( 'target_version' ) ?>
		</td>
		<td>
			<select <?php echo helper_get_tab_index() ?> name="target_version">
				<?php print_version_option_list() ?>
			</select>
		</td>
	</tr>
<?php } ?>
<?php event_signal( 'EVENT_REPORT_BUG_FORM', array( $t_project_id ) ) ?>
	<tr <?php echo helper_alternate_class() ?>>
		<td class="category">
			<span class="required">*</span><?php print_documentation_link( 'summary' ) ?>
		</td>
		<td>
			<input <?php echo helper_get_tab_index() ?> type="text" name="summary" size="105" maxlength="128" value="<?php echo string_attribute( $f_summary ) ?>" />
		</td>
	</tr>
	<tr <?php echo helper_alternate_class() ?>>
		<td class="category">
			<span class="required">*</span><?php print_documentation_link( 'description' ) ?>
		</td>
		<td>
			<textarea <?php echo helper_get_tab_index() ?> name="description" cols="80" rows="10"><?php echo string_textarea( $f_description ) ?></textarea>
		</td>
	</tr>

<?php if ( $tpl_show_steps_to_reproduce ) { ?>
		<tr <?php echo helper_alternate_class() ?>>
			<td class="category">
				<?php print_documentation_link( 'steps_to_reproduce' ) ?>
			</td>
			<td>
				<textarea <?php echo helper_get_tab_index() ?> name="steps_to_reproduce" cols="80" rows="10"><?php echo string_textarea( $f_steps_to_reproduce ) ?></textarea>
			</td>
		</tr>
<?php } ?>

<?php if ( $tpl_show_additional_info ) { ?>
	<tr <?php echo helper_alternate_class() ?>>
		<td class="category">
			<?php print_documentation_link( 'additional_information' ) ?>
		</td>
		<td>
			<textarea <?php echo helper_get_tab_index() ?> name="additional_info" cols="80" rows="10"><?php echo string_textarea( $f_additional_info ) ?></textarea>
		</td>
	</tr>
<?php
	}

	$t_custom_fields_found = false;
	$t_related_custom_field_ids = custom_field_get_linked_ids( $t_project_id );

	foreach( $t_related_custom_field_ids as $t_id ) {
		$t_def = custom_field_get_definition( $t_id );
		if( ( $t_def['display_report'] || $t_def['require_report']) && custom_field_has_write_access_to_project( $t_id, $t_project_id ) ) {
			$t_custom_fields_found = true;
?>
	<tr <?php echo helper_alternate_class() ?>>
		<td class="category">
			<?php if($t_def['require_report']) {?><span class="required">*</span><?php } echo string_display( lang_get_defaulted( $t_def['name'] ) ) ?>
		</td>
		<td>
			<?php print_custom_field_input( $t_def, ( $f_master_bug_id === 0 ) ? null : $f_master_bug_id ) ?>
		</td>
	</tr>
<?php
		}
	} # foreach( $t_related_custom_field_ids as $t_id )
?>
<?php if ( $tpl_show_attachments ) { // File Upload (if enabled)
	$t_max_file_size = (int)min( ini_get_number( 'upload_max_filesize' ), ini_get_number( 'post_max_size' ), config_get( 'max_file_size' ) );
?>
	<tr <?php echo helper_alternate_class() ?>>
		<td class="category">
			<?php echo lang_get( 'upload_file' ) ?>
			<?php echo '<span class="small">(' . lang_get( 'max_file_size' ) . ': ' . number_format( $t_max_file_size/1000 ) . 'k)</span>'?>
		</td>
		<td>
			<input type="hidden" name="max_file_size" value="<?php echo $t_max_file_size ?>" />
	
	<?php
	For ( $i = 0	; $i < $g_max_file_num	; $i++ ) 
		{?>
		<input id="ufile[]" name="ufile[]" type="file" size="50" /><br>
		<?php 
		} ?>
		
		</td>
	</tr>
	

<?php
}
	if ( $tpl_show_view_state ) {
?>
	<tr <?php echo helper_alternate_class() ?>>
		<td class="category">
			<?php echo lang_get( 'view_status' ) ?>
		</td>
		<td>
			<label><input <?php echo helper_get_tab_index() ?> type="radio" name="view_state" value="<?php echo VS_PUBLIC ?>" <?php check_checked( $f_view_state, VS_PUBLIC ) ?> /> <?php echo lang_get( 'public' ) ?></label>
			<label><input <?php echo helper_get_tab_index() ?> type="radio" name="view_state" value="<?php echo VS_PRIVATE ?>" <?php check_checked( $f_view_state, VS_PRIVATE ) ?> /> <?php echo lang_get( 'private' ) ?></label>
	<?php
		}
	?>
		</td>
	</tr>
<?php //Relationship (in case of cloned bug creation...)
	if( $f_master_bug_id > 0 ) {
?>
	<tr <?php echo helper_alternate_class() ?>>
		<td class="category">
			<?php echo lang_get( 'relationship_with_parent' ) ?>
		</td>
		<td>
			<?php relationship_list_box( /* none */ -2, "rel_type", false, true ) ?>
			<?php echo '<b>' . lang_get( 'bug' ) . ' ' . bug_format_id( $f_master_bug_id ) . '</b>' ?>
		</td>
	</tr>
<?php
	}
?>
	<tr <?php echo helper_alternate_class() ?>>
		<td class="category">
			<?php print_documentation_link( 'report_stay' ) ?>
		</td>
		<td>
			<label><input <?php echo helper_get_tab_index() ?> type="checkbox" id="report_stay" name="report_stay" <?php check_checked( $f_report_stay ) ?> /> <?php echo lang_get( 'check_report_more_bugs' ) ?></label>
		</td>
	</tr>
	<tr>
		<td class="left">
			<span class="required"> * <?php echo lang_get( 'required' ) ?></span>
		</td>
		<td class="center">
			<input <?php echo helper_get_tab_index() ?> type="submit" class="button" value="<?php echo lang_get( 'submit_report_button' ) ?>" />
		</td>
	</tr>
</table>
</form>
</div>

<!-- Autofocus JS -->
<?php if ( ON == config_get( 'use_javascript' ) ) { ?>
<script type="text/javascript" language="JavaScript">
<!--
	window.document.report_bug_form.category_id.focus();
-->
</script>
<?php  }
if ( $tpl_show_due_date ) {
	date_finish_calendar( 'due_date', 'trigger' );
}

html_page_bottom();
bug_report_page.php (19,444 bytes)   

Relationships

duplicate of 0005228 closeddregad Attaching multiple files in one go. 

Activities

istvanb

istvanb

2010-11-11 03:54

reporter   ~0027332

Hello!

The duplicate issue points to the solution against 1.1.6 which is a pretty old release. Besides it changes quite number of a files (including the file_api.php and html_api.php). Can I use those files in my 1.2.3 install without an issue? So is it OK to simply overwrite my existing files with those?

I think this is a demanded feature, can it be added as a feature request against 1.3?

thx for your help!
i-

istvanb

istvanb

2010-11-12 07:47

reporter   ~0027348

0005228 does not solve the problem since users clearly have problems with the installation (last patch applied 1.5 years ago). Not to mention that solution introduces lots of files including js, while this one and 0010223 have only 4 very clean files altogether and as far as I am concerned they completely solve the issue.

I would rather merge 0010223 and this one together and advertise is as a solution. (of course after a careful review)

atrol

atrol

2010-11-16 16:47

developer   ~0027386

@istvanb, feel free to add the valuable information of your issue and 0010223 to 0005228

istvanb

istvanb

2010-11-19 06:20

reporter   ~0027417

I have created a ZIP file and uploaded it to 0005228

This request can be closed now, the discussion will continue in the other issue