How do I add more options in the notification? /1.2.15

Get help from other users here.

Moderators: Developer, Contributor

Post Reply
pkowal007
Posts: 3
Joined: 24 Feb 2014, 22:53

How do I add more options in the notification? /1.2.15

Post by pkowal007 »

Hello. Mantis - 1.2.15

Can you help me add the code responsible for additional fields in the notification? I tried to add it myself but it's too complicated for me.

I mean an additional field work on the principle "OS", "Os Version" or "Summary" - New fields are for example name (in attachement #2), surname (in attachement #3), phone no (in attachement #4).
Just that you will help me describe the scheme in one field, the restI do accordingly.

I will be grateful for your help. It's important to me. Thank you.

In attachement I attach a picture showing what I mean. My code from bug_view_inc.php :

Code: Select all

<?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 include file prints out the bug information
	 * $f_bug_id MUST be specified before the file is included
	 *
	 * @package MantisBT
	 * @copyright Copyright (C) 2000 - 2002  Kenzaburo Ito - kenito@300baud.org
	 * @copyright Copyright (C) 2002 - 2013  MantisBT Team - mantisbt-dev@lists.sourceforge.net
	 * @link http://www.mantisbt.org
	 */

	if ( !defined( 'BUG_VIEW_INC_ALLOW' ) ) {
		access_denied();
	}

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

	require_once( 'bug_api.php' );
	require_once( 'custom_field_api.php' );
	require_once( 'file_api.php' );
	require_once( 'date_api.php' );
	require_once( 'relationship_api.php' );
	require_once( 'last_visited_api.php' );
	require_once( 'tag_api.php' );

	$f_bug_id = gpc_get_int( 'id' );

	bug_ensure_exists( $f_bug_id );

	$tpl_bug = bug_get( $f_bug_id, true );

	# In case the current project is not the same project of the bug we are
	# viewing, override the current project. This ensures all config_get and other
	# per-project function calls use the project ID of this bug.
	$g_project_override = $tpl_bug->project_id;

	access_ensure_bug_level( VIEWER, $f_bug_id );

	$f_history = gpc_get_bool( 'history', config_get( 'history_default_visible' ) );

	$t_fields = config_get( $tpl_fields_config_option );
	$t_fields = columns_filter_disabled( $t_fields );

	compress_enable();

	if ( $tpl_show_page_header ) {
		html_page_top( bug_format_summary( $f_bug_id, SUMMARY_CAPTION ) );
		print_recently_visited();
	}

	$t_action_button_position = config_get( 'action_button_position' );

	$t_bugslist = gpc_get_cookie( config_get( 'bug_list_cookie' ), false );

	$tpl_show_versions = version_should_show_product_version( $tpl_bug->project_id );
	$tpl_show_product_version = $tpl_show_versions && in_array( 'product_version', $t_fields );
	$tpl_show_fixed_in_version = $tpl_show_versions && in_array( 'fixed_in_version', $t_fields );
	$tpl_show_product_build = $tpl_show_versions && in_array( 'product_build', $t_fields )
		&& ( config_get( 'enable_product_build' ) == ON );
	$tpl_product_build = $tpl_show_product_build ? string_display_line( $tpl_bug->build ) : '';
	$tpl_show_target_version = $tpl_show_versions && in_array( 'target_version', $t_fields )
		&& access_has_bug_level( config_get( 'roadmap_view_threshold' ), $f_bug_id );

	$tpl_product_version_string  = '';
	$tpl_target_version_string   = '';
	$tpl_fixed_in_version_string = '';

	if ( $tpl_show_product_version || $tpl_show_fixed_in_version || $tpl_show_target_version ) {
		$t_version_rows = version_get_all_rows( $tpl_bug->project_id );

		if ( $tpl_show_product_version ) {
			$tpl_product_version_string  = prepare_version_string( $tpl_bug->project_id, version_get_id( $tpl_bug->version, $tpl_bug->project_id ), $t_version_rows );
		}

		if ( $tpl_show_target_version ) {
			$tpl_target_version_string   = prepare_version_string( $tpl_bug->project_id, version_get_id( $tpl_bug->target_version, $tpl_bug->project_id) , $t_version_rows );
		}

		if ( $tpl_show_fixed_in_version ) {
			$tpl_fixed_in_version_string = prepare_version_string( $tpl_bug->project_id, version_get_id( $tpl_bug->fixed_in_version, $tpl_bug->project_id ), $t_version_rows );
		}
	}

	$tpl_product_version_string = string_display_line( $tpl_product_version_string );
	$tpl_target_version_string = string_display_line( $tpl_target_version_string );
	$tpl_fixed_in_version_string = string_display_line( $tpl_fixed_in_version_string );

	$tpl_bug_id = $f_bug_id;
	$tpl_form_title = lang_get( 'bug_view_title' );
	$tpl_wiki_link = config_get_global( 'wiki_enable' ) == ON ? 'wiki.php?id=' . $f_bug_id : '';

	if ( access_has_bug_level( config_get( 'view_history_threshold' ), $f_bug_id ) ) {
		$tpl_history_link = "view.php?id=$f_bug_id&history=1#history";
	} else {
		$tpl_history_link = '';
	}

	$tpl_show_reminder_link = !current_user_is_anonymous() && !bug_is_readonly( $f_bug_id ) &&
		  access_has_bug_level( config_get( 'bug_reminder_threshold' ), $f_bug_id );
	$tpl_bug_reminder_link = 'bug_reminder_page.php?bug_id=' . $f_bug_id;

	$tpl_print_link = 'print_bug_page.php?bug_id=' . $f_bug_id;

	$tpl_top_buttons_enabled = !$tpl_force_readonly && ( $t_action_button_position == POSITION_TOP || $t_action_button_position == POSITION_BOTH );
	$tpl_bottom_buttons_enabled = !$tpl_force_readonly && ( $t_action_button_position == POSITION_BOTTOM || $t_action_button_position == POSITION_BOTH );

	$tpl_show_project = in_array( 'project', $t_fields );
	$tpl_project_name = $tpl_show_project ? string_display_line( project_get_name( $tpl_bug->project_id ) ): '';
	$tpl_show_id = in_array( 'id', $t_fields );
	$tpl_formatted_bug_id = $tpl_show_id ? string_display_line( bug_format_id( $f_bug_id ) ) : '';

	$tpl_show_date_submitted = in_array( 'date_submitted', $t_fields );
	$tpl_date_submitted = $tpl_show_date_submitted ? date( config_get( 'normal_date_format' ), $tpl_bug->date_submitted ) : '';

	$tpl_show_last_updated = in_array( 'last_updated', $t_fields );
	$tpl_last_updated = $tpl_show_last_updated ? date( config_get( 'normal_date_format' ), $tpl_bug->last_updated ) : '';

	$tpl_show_tags = in_array( 'tags', $t_fields ) && access_has_global_level( config_get( 'tag_view_threshold' ) );

	$tpl_bug_overdue = bug_is_overdue( $f_bug_id );

	$tpl_show_view_state = in_array( 'view_state', $t_fields );
	$tpl_bug_view_state_enum = $tpl_show_view_state ? string_display_line( get_enum_element( 'view_state', $tpl_bug->view_state ) ) : '';

	$tpl_show_due_date = in_array( 'due_date', $t_fields ) && access_has_bug_level( config_get( 'due_date_view_threshold' ), $f_bug_id );

	if ( $tpl_show_due_date ) {
		if ( !date_is_null( $tpl_bug->due_date ) ) {
			$tpl_bug_due_date = date( config_get( 'normal_date_format' ), $tpl_bug->due_date );
		} else {
			$tpl_bug_due_date = '';
		}
	}

	$tpl_show_reporter = in_array( 'reporter', $t_fields );
	$tpl_show_handler = in_array( 'handler', $t_fields ) && access_has_bug_level( config_get( 'view_handler_threshold' ), $f_bug_id );
	$tpl_show_additional_information = !is_blank( $tpl_bug->additional_information ) && in_array( 'additional_info', $t_fields );
	$tpl_show_steps_to_reproduce = !is_blank( $tpl_bug->steps_to_reproduce ) && in_array( 'steps_to_reproduce', $t_fields );
	$tpl_show_monitor_box = !$tpl_force_readonly;
	$tpl_show_relationships_box = !$tpl_force_readonly;
	$tpl_show_upload_form = !$tpl_force_readonly && !bug_is_readonly( $f_bug_id );
	$tpl_show_history = $f_history;
	$tpl_show_profiles = config_get( 'enable_profiles' );
	$tpl_show_platform = $tpl_show_profiles && in_array( 'platform', $t_fields );
	$tpl_platform = $tpl_show_platform ? string_display_line( $tpl_bug->platform ) : '';
	$tpl_show_os = $tpl_show_profiles && in_array( 'os', $t_fields );
	$tpl_os = $tpl_show_os ? string_display_line( $tpl_bug->os ) : '';
	$tpl_show_os_version = $tpl_show_profiles && in_array( 'os_version', $t_fields );
	$tpl_os_version = $tpl_show_os_version ? string_display_line( $tpl_bug->os_build ) : '';
	$tpl_show_projection = in_array( 'projection', $t_fields );
	$tpl_projection = $tpl_show_projection ? string_display_line( get_enum_element( 'projection', $tpl_bug->projection ) ) : '';
	$tpl_show_eta = in_array( 'eta', $t_fields );
	$tpl_eta = $tpl_show_eta ? string_display_line( get_enum_element( 'eta', $tpl_bug->eta ) ) : '';
	$tpl_show_attachments = in_array( 'attachments', $t_fields );
	$tpl_can_attach_tag = $tpl_show_tags && !$tpl_force_readonly && access_has_bug_level( config_get( 'tag_attach_threshold' ), $f_bug_id );
	$tpl_show_category = in_array( 'category_id', $t_fields );
	$tpl_category = $tpl_show_category ? string_display_line( category_full_name( $tpl_bug->category_id ) ) : '';
	$tpl_show_priority = in_array( 'priority', $t_fields );
	$tpl_priority = $tpl_show_priority ? string_display_line( get_enum_element( 'priority', $tpl_bug->priority ) ) : '';
	/*$tpl_show_severity = in_array( 'severity', $t_fields );
	$tpl_severity = $tpl_show_severity ? string_display_line( get_enum_element( 'severity', $tpl_bug->severity ) ) : '';
	tpl_show_reproducibility = in_array( 'reproducibility', $t_fields ); */
	$tpl_reproducibility = $tpl_show_reproducibility ? string_display_line( get_enum_element( 'reproducibility', $tpl_bug->reproducibility ) ): '';
	$tpl_show_status = in_array( 'status', $t_fields );
	$tpl_status = $tpl_show_status ? string_display_line( get_enum_element( 'status', $tpl_bug->status ) ) : '';
	/*$tpl_show_resolution = in_array( 'resolution', $t_fields );*/
	$tpl_resolution = $tpl_show_resolution ? string_display_line( get_enum_element( 'resolution', $tpl_bug->resolution ) ) : '';
	$tpl_show_summary = in_array( 'summary', $t_fields );
	$tpl_show_description = in_array( 'description', $t_fields );

	$tpl_summary = $tpl_show_summary ? bug_format_summary( $f_bug_id, SUMMARY_FIELD ) : '';
	$tpl_description = $tpl_show_description ? string_display_links( $tpl_bug->description ) : '';
	$tpl_steps_to_reproduce = $tpl_show_steps_to_reproduce ? string_display_links( $tpl_bug->steps_to_reproduce ) : '';
	$tpl_additional_information = $tpl_show_additional_information ? string_display_links( $tpl_bug->additional_information ) : '';

	$tpl_links = event_signal( 'EVENT_MENU_ISSUE', $f_bug_id );

	#
	# Start of Template
	#

	echo '<br />';
	echo '<table class="width100" cellspacing="1">';
	echo '<tr>';

	# Form Title
	echo '<td class="form-title" colspan="', $t_bugslist ? '3' : '4', '">';

	echo $tpl_form_title;

	echo '&#160;<span class="small">';

	# Jump to Bugnotes
	print_bracket_link( "#bugnotes", lang_get( 'jump_to_bugnotes' ) );

	# Send Bug Reminder
	if ( $tpl_show_reminder_link ) {
		print_bracket_link( $tpl_bug_reminder_link, lang_get( 'bug_reminder' ) );
	}

	if ( !is_blank( $tpl_wiki_link ) ) {
		print_bracket_link( $tpl_wiki_link, lang_get( 'wiki' ) );
	}

	foreach ( $tpl_links as $t_plugin => $t_hooks ) {
		foreach( $t_hooks as $t_hook ) {
			if ( is_array( $t_hook ) ) {
				foreach( $t_hook as $t_label => $t_href ) {
					if ( is_numeric( $t_label ) ) {
						print_bracket_link_prepared( $t_href );
					} else {
						print_bracket_link( $t_href, $t_label );
					}
				}
			} else {
				print_bracket_link_prepared( $t_hook );
			}
		}
	}

	echo '</span></td>';

	# prev/next links
	if ( $t_bugslist ) {
		echo '<td class="center"><span class="small">';

		$t_bugslist = explode( ',', $t_bugslist );
		$t_index = array_search( $f_bug_id, $t_bugslist );
		if ( false !== $t_index ) {
			if ( isset( $t_bugslist[$t_index-1] ) ) {
				print_bracket_link( 'view.php?id='.$t_bugslist[$t_index-1], '<<' );
			}

			if ( isset( $t_bugslist[$t_index+1] ) ) {
				print_bracket_link( 'view.php?id='.$t_bugslist[$t_index+1], '>>' );
			}
		}
		echo '</span></td>';
	}


	# Links
	echo '<td class="right" colspan="2">';

	if ( !is_blank( $tpl_history_link ) ) {
		# History
		echo '<span class="small">';
		print_bracket_link( $tpl_history_link, lang_get( 'bug_history' ) );
		echo '</span>';
	}

	# Print Bug
	echo '<span class="small">';
	print_bracket_link( $tpl_print_link, lang_get( 'print' ) );
	echo '</span>';
	echo '</td>';
	echo '</tr>';

	if ( $tpl_top_buttons_enabled ) {
		echo '<tr align="center">';
		echo '<td align="center" colspan="6">';
		html_buttons_view_bug_page( $tpl_bug_id );
		echo '</td>';
		echo '</tr>';
	}

	if ( $tpl_show_id || $tpl_show_project || $tpl_show_category || $tpl_show_view_state || $tpl_show_date_submitted || $tpl_show_last_updated ) {
		# Labels
		echo '<tr>';
		echo '<td class="category" width="15%">', $tpl_show_id ? lang_get( 'id' ) : '', '</td>';
		echo '<td class="category" width="20%">', $tpl_show_project ? lang_get( 'email_project' ) : '', '</td>';
		echo '<td class="category" width="15%">', $tpl_show_category ? lang_get( 'category' ) : '', '</td>';
		echo '<td class="category" width="15%">', $tpl_show_view_state ? lang_get( 'view_status' ) : '', '</td>';
		echo '<td class="category" width="15%">', $tpl_show_date_submitted ? lang_get( 'date_submitted' ) : '', '</td>';
		echo '<td class="category" width="20%">', $tpl_show_last_updated ? lang_get( 'last_update' ) : '','</td>';
		echo '</tr>';

		echo '<tr ', helper_alternate_class(), '>';

		# Bug ID
		echo '<td>', $tpl_formatted_bug_id, '</td>';

		# Project
		echo '<td>', $tpl_project_name, '</td>';

		# Category
		echo '<td>', $tpl_category, '</td>';

		# View Status
		echo '<td>', $tpl_bug_view_state_enum, '</td>';

		# Date Submitted
		echo '<td>', $tpl_date_submitted, '</td>';

		# Date Updated
		echo '<td>', $tpl_last_updated, '</td>';

		echo '</tr>';

		# spacer
		echo '<tr class="spacer"><td colspan="6"></td></tr>';
	}

	#
	# Reporter
	#

	if ( $tpl_show_reporter ) {
		echo '<tr ', helper_alternate_class(), '>';

		$t_spacer = 4;

		# Reporter
		if ( $tpl_show_reporter ) {
			echo '<td class="category">', lang_get( 'reporter' ), '</td>';
			echo '<td>';
			print_user_with_subject( $tpl_bug->reporter_id, $tpl_bug_id );
			echo '</td>';
		} else {
			$t_spacer += 2;
		}

		echo '<td colspan="', $t_spacer, '">&#160;</td>';

		echo '</tr>';
	}

	#
	# Handler, Due Date
	#

	if ( $tpl_show_handler || $tpl_show_due_date ) {
		echo '<tr ', helper_alternate_class(), '>';

		$t_spacer = 2;

		# Handler
		if ( $tpl_show_handler ) {
			echo '<td class="category">', lang_get( 'assigned_to' ), '</td>';
			echo '<td>';
			print_user_with_subject( $tpl_bug->handler_id, $tpl_bug_id );
			echo '</td>';
		} else {
			$t_spacer += 2;
		}

		# Due Date
		if ( $tpl_show_due_date ) {
			echo '<td class="category">', lang_get( 'due_date' ), '</td>';

			if ( $tpl_bug_overdue ) {
				echo '<td class="overdue">', $tpl_bug_due_date, '</td>';
			} else {
				echo '<td>', $tpl_bug_due_date, '</td>';
			}
		} else {
			$t_spacer += 2;
		}

		echo '<td colspan="', $t_spacer, '">&#160;</td>';
		echo '</tr>';
	}

	#
	# Priority, Severity, Reproducibility
	#

	if ( $tpl_show_priority || $tpl_show_severity || $tpl_show_reproducibility ) {
		echo '<tr ', helper_alternate_class(), '>';

		$t_spacer = 0;

		# Priority
		if ( $tpl_show_priority ) {
			echo '<td class="category">', lang_get( 'priority' ), '</td>';
			echo '<td>', $tpl_priority, '</td>';
		} else {
			$t_spacer += 2;
		}

		# Severity
		if ( $tpl_show_severity ) {
			echo '<td class="category">', lang_get( 'severity' ), '</td>';
			echo '<td>', $tpl_severity, '</td>';
		} else {
			$t_spacer += 2;
		}

		# Reproducibility
		if ( $tpl_show_reproducibility ) {
			echo '<td class="category">', lang_get( 'reproducibility' ), '</td>';
			echo '<td>', $tpl_reproducibility, '</td>';
		} else {
			$t_spacer += 2;
		}

		# spacer
		if ( $t_spacer > 0 ) {
			echo '<td colspan="', $t_spacer, '">&#160;</td>';
		}

		echo '</tr>';
	}

	#
	# Status, Resolution
	#

	if ( $tpl_show_status || $tpl_show_resolution ) {
		echo '<tr ', helper_alternate_class(), '>';

		$t_spacer = 2;

		# Status
		if ( $tpl_show_status ) {
			echo '<td class="category">', lang_get( 'status' ), '</td>';
			echo '<td bgcolor="', get_status_color( $tpl_bug->status ), '">', $tpl_status, '</td>';
		} else {
			$t_spacer += 2;
		}

		# Resolution
		if ( $tpl_show_resolution ) {
			echo '<td class="category">', lang_get( 'resolution' ), '</td>';
			echo '<td>', $tpl_resolution, '</td>';
		} else {
			$t_spacer += 2;
		}

		# spacer
		if ( $t_spacer > 0 ) {
			echo '<td colspan="', $t_spacer, '">&#160;</td>';
		}

		echo '</tr>';
	}

	#
	# Projection, ETA
	#

	if ( $tpl_show_projection || $tpl_show_eta ) {
		echo '<tr ', helper_alternate_class(), '>';

		$t_spacer = 2;

		if ( $tpl_show_projection ) {
			# Projection
			echo '<td class="category">', lang_get( 'projection' ), '</td>';
			echo '<td>', $tpl_projection, '</td>';
		} else {
			$t_spacer += 2;
		}

		# ETA
		if ( $tpl_show_eta ) {
			echo '<td class="category">', lang_get( 'eta' ), '</td>';
			echo '<td>', $tpl_eta, '</td>';
		} else {
			$t_spacer += 2;
		}

		echo '<td colspan="', $t_spacer, '">&#160;</td>';
		echo '</tr>';
	}

	#
	# Platform, OS, OS Version
	#

	if ( $tpl_show_platform || $tpl_show_os || $tpl_show_os_version ) {
		$t_spacer = 0;

		echo '<tr ', helper_alternate_class(), '>';

		# Platform
		if ( $tpl_show_platform ) {
			echo '<td class="category" style="background-color: #E36C09">', lang_get( 'platform' ), '</td>';
			echo '<td style="background-color: #FAC08F; font-size: 13px">', $tpl_platform, '</td>';
		} else {
			$t_spacer += 2;
		}

		# Operating System
		if ( $tpl_show_os ) {
			echo '<td class="category" style="background-color: #E36C09">', lang_get( 'os' ), '</td>';
			echo '<td style="background-color: #FAC08F; font-size: 13px">', $tpl_os, '</td>';
		} else {
			$t_spacer += 2;
		}

		# OS Version
		if ( $tpl_show_os_version ) {
			echo '<td class="category" style="background-color: #E36C09">', lang_get( 'os_version' ), '</td>';
			echo '<td style="background-color: #FAC08F; font-size: 13px">', $tpl_os_version, '</td>';
		} else {
			$t_spacer += 2;
		}

		if ( $t_spacer > 0 ) {
			echo '<td colspan="', $t_spacer, '">&#160;</td>';
		}

		echo '</tr>';
	}

	#
	# Product Version, Product Build
	#

	if ( $tpl_show_product_version || $tpl_show_product_build ) {
		$t_spacer = 2;

		echo '<tr ', helper_alternate_class(), '>';

		# Product Version
		if ( $tpl_show_product_version ) {
			echo '<td class="category">', lang_get( 'product_version' ), '</td>';
			echo '<td>', $tpl_product_version_string, '</td>';
		} else {
			$t_spacer += 2;
		}

		# Product Build
		if ( $tpl_show_product_build ) {
			echo '<td class="category">', lang_get( 'product_build' ), '</td>';
			echo '<td>', $tpl_product_build, '</td>';
		} else {
			$t_spacer += 2;
		}

		# spacer
		echo '<td colspan="', $t_spacer, '">&#160;</td>';

		echo '</tr>';
	}

	#
	# Target Version, Fixed In Version
	#

	if ( $tpl_show_target_version || $tpl_show_fixed_in_version ) {
		$t_spacer = 2;

		echo '<tr ', helper_alternate_class(), '>';

		# target version
		if ( $tpl_show_target_version ) {
			# Target Version
			echo '<td class="category">', lang_get( 'target_version' ), '</td>';
			echo '<td>', $tpl_target_version_string, '</td>';
		} else {
			$t_spacer += 2;
		}

		# fixed in version
		if ( $tpl_show_fixed_in_version ) {
			echo '<td class="category">', lang_get( 'fixed_in_version' ), '</td>';
			echo '<td>', $tpl_fixed_in_version_string, '</td>';
		} else {
			$t_spacer += 2;
		}

		# spacer
		echo '<td colspan="', $t_spacer, '">&#160;</td>';

		echo '</tr>';
	}

	#
	# Bug Details Event Signal
	#

	event_signal( 'EVENT_VIEW_BUG_DETAILS', array( $tpl_bug_id ) );

	# spacer
	echo '<tr class="spacer"><td colspan="6"></td></tr>';

	#
	# Bug Details (screen wide fields)
	#

	# Summary - TEMAT
	if ( $tpl_show_summary ) {
		echo '<tr ', helper_alternate_class(), '>';
		echo '<td class="category" style="background-color: #E36C09">', lang_get( 'summary' ), '</td>';
		echo '<td colspan="5" style="background-color: #FAC08F; font-size: 13px">', $tpl_summary, '</td>';
		echo '</tr>';
	}

	# Description - OPIS
	if ( $tpl_show_description ) {
		echo '<tr ', helper_alternate_class(), '>';
		echo '<td class="category" style="background-color: #E36C09">', lang_get( 'description' ), '</td>';
		echo '<td colspan="5" style="background-color: #FAC08F">', $tpl_description, '</td>';
		echo '</tr>';
	}

	# Steps to Reproduce
	if ( $tpl_show_steps_to_reproduce ) {
		echo '<tr ', helper_alternate_class(), '>';
		echo '<td class="category">', lang_get( 'steps_to_reproduce' ), '</td>';
		echo '<td colspan="5">', $tpl_steps_to_reproduce, '</td>';
		echo '</tr>';
	}

	# Additional Information
	if ( $tpl_show_additional_information ) {
		echo '<tr ', helper_alternate_class(), '>';
		echo '<td class="category">', lang_get( 'additional_information' ), '</td>';
		echo '<td colspan="5">', $tpl_additional_information, '</td>';
		echo '</tr>';
	}

	# Tagging
	if ( $tpl_show_tags ) {
		echo '<tr ', helper_alternate_class(), '>';
		echo '<td class="category">', lang_get( 'tags' ), '</td>';
		echo '<td colspan="5">';
		tag_display_attached( $tpl_bug_id );
		echo '</td></tr>';
	}

	# Attachments Form
	if ( $tpl_can_attach_tag ) {
		echo '<tr ', helper_alternate_class(), '>';
		echo '<td class="category">', lang_get( 'tag_attach_long' ), '</td>';
		echo '<td colspan="5">';
		print_tag_attach_form( $tpl_bug_id );
		echo '</td></tr>';
	}

	# spacer
	echo '<tr class="spacer"><td colspan="6"></td></tr>';

	# Custom Fields
	$t_custom_fields_found = false;
	$t_related_custom_field_ids = custom_field_get_linked_ids( $tpl_bug->project_id );

	foreach( $t_related_custom_field_ids as $t_id ) {
		if ( !custom_field_has_read_access( $t_id, $f_bug_id ) ) {
			continue;
		} # has read access

		$t_custom_fields_found = true;
		$t_def = custom_field_get_definition( $t_id );

		echo '<tr ', helper_alternate_class(), '>';
		echo '<td class="category">', string_display( lang_get_defaulted( $t_def['name'] ) ), '</td>';
		echo '<td colspan="5">';
		print_custom_field_value( $t_def, $t_id, $f_bug_id );
		echo '</td></tr>';
	}

	if ( $t_custom_fields_found ) {
		# spacer
		echo '<tr class="spacer"><td colspan="6"></td></tr>';
	} # custom fields found

	# Attachments
	if ( $tpl_show_attachments ) {
		echo '<tr ', helper_alternate_class(), '>';
		echo '<td class="category"><a name="attachments" id="attachments" />', lang_get( 'attached_files' ), '</td>';
		echo '<td colspan="5">';
		print_bug_attachments_list( $tpl_bug_id );
		echo '</td></tr>';
	}

	if ( $tpl_bottom_buttons_enabled ) {
		echo '<tr align="center"><td align="center" colspan="6">';
		html_buttons_view_bug_page( $tpl_bug_id );
		echo '</td></tr>';
	}

	echo '</table>';

	# User list sponsoring the bug
	include( $tpl_mantis_dir . 'bug_sponsorship_list_view_inc.php' );

	# Bug Relationships
	if ( $tpl_show_relationships_box ) {
		relationship_view_box ( $tpl_bug->id );
	}

	# File upload box
	if ( $tpl_show_upload_form ) {
		include( $tpl_mantis_dir . 'bug_file_upload_inc.php' );
	}

	# User list monitoring the bug
	if ( $tpl_show_monitor_box ) {
		include( $tpl_mantis_dir . 'bug_monitor_list_view_inc.php' );
	}

	# Bugnotes and "Add Note" box
	if ( 'ASC' == current_user_get_pref( 'bugnote_order' ) ) {
		include( $tpl_mantis_dir . 'bugnote_view_inc.php' );

		if ( !$tpl_force_readonly ) {
			include( $tpl_mantis_dir . 'bugnote_add_inc.php' );
		}
	} else {
		if ( !$tpl_force_readonly ) {
			include( $tpl_mantis_dir . 'bugnote_add_inc.php' );
		}

		include( $tpl_mantis_dir . 'bugnote_view_inc.php' );
	}

	# Allow plugins to display stuff after notes
	event_signal( 'EVENT_VIEW_BUG_EXTRA', array( $f_bug_id ) );

	# Time tracking statistics
	if ( config_get( 'time_tracking_enabled' ) &&
		access_has_bug_level( config_get( 'time_tracking_view_threshold' ), $f_bug_id ) ) {
		include( $tpl_mantis_dir . 'bugnote_stats_inc.php' );
	}

	# History
	if ( $tpl_show_history ) {
		include( $tpl_mantis_dir . 'history_inc.php' );
	}

	html_page_bottom();

	last_visited_issue( $tpl_bug_id );
and bug_report_page.php

Code: Select all

<?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 - 2012  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 );

	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, 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_eta					= $t_bug->eta;
		$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 {
		# Get Project Id and set it as current
		$t_project_id = gpc_get_int( 'project_id', helper_get_current_project() );
		if( ( ALL_PROJECTS == $t_project_id || project_exists( $t_project_id ) )
		 && $t_project_id != helper_get_current_project()
		) {
			helper_set_current_project( $t_project_id );
			# Reloading the page is required so that the project browser
			# reflects the new current project
			print_header_redirect( $_SERVER['REQUEST_URI'], true, false, true );
		}

		# New issues cannot be reported for the 'All Project' selection
		if ( ( ALL_PROJECTS == helper_get_current_project() ) ) {
			print_header_redirect( 'login_select_proj_page.php?ref=bug_report_page.php' );
		}

		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_eta					= gpc_get_int( 'eta', config_get( 'default_bug_eta' ) );
		$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_changed_project		= false;
	}

	$f_report_stay			          = gpc_get_bool( 'report_stay', false );
	$f_copy_notes_from_parent         = gpc_get_bool( 'copy_notes_from_parent', false);
	$f_copy_attachments_from_parent   = gpc_get_bool( 'copy_attachments_from_parent', 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_eta = in_array( 'eta', $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_resolution = in_array('resolution', $t_fields);
	$tpl_show_status = in_array('status', $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 ) {
?>
<!-- SCHOWANE - WAŻNOŚĆ
	<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_eta ) {
?>
<!--
	<tr <?php echo helper_alternate_class() ?>>
		<td class="category">
			<label for="eta"><?php print_documentation_link( 'eta' ) ?></label>
		</td>
		<td>
			<select <?php echo helper_get_tab_index() ?> id="eta" name="eta">
				<?php print_enum_string_option_list( 'eta', $f_eta ) ?>
			</select>
		</td>
	</tr>-->
<?php
	}

	if ( $tpl_show_severity ) {
?><!-- SCHOWANE - POWTARZALNOŚĆ
	<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=\"16\" value=\"".$t_date_to_display."\" />";
			date_print_calendar();
		?>
		</td>
	</tr>
<?php } ?>
<?php if ( $tpl_show_platform || $tpl_show_os || $tpl_show_os_version ) { ?>
	
	<!-- WYBIERZ PROFIL -->
	<!--<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' ) ?><br><span style="font-size: 10px; color: #BB0000; font-family: Verdana, sans-serif;">(np. Chirurgia, Okulistyka itp.)</span>
						</td>
						<td>
							<?php if ( config_get( 'allow_freetext_in_profile_fields' ) == ON ) { ?>
							<select name="platform" style="width:274px">
								<option></option>
								<option value="Apteka">Apteka</option>
								<option value="Chirurgia">Chirurgia</option>
								<option value="Interna Góra">Interna Góra</option>
								<option value="Interna Dół">Interna Dół</option>
								<option value="Laryngologia">Laryngologia</option>
								<option value="Neurologia">Neurologia</option>
								<option value="OIOM">OIOM</option>
								<option value="Ortopedia">Ortopedia</option>
								<option value="Okulistyka">Okulistyka</option>
								<option value="Przychodnia">Przychodnia</option>
								<option value="Rehabilitacja">Rehabilitacja</option>
								<option value="SOR">SOR</option>
								<option></option>
								<option value="Administracja">Administracja</option>
								<option value="Biuro Zamówień Publicznych">Biuro Zamówień Publicznych</option>
								<option value="Finansowy">Finansowy</option>
								<option value="Kadry">Kadry</option>
								<option value="Techniczny">Techniczny</option>
								<option value="Zaopatrzenie">Zaopatrzenie</option>
								<option></option>
								<option value="Informatyka">Informatyka</option>
								<?php print_platform_option_list( $f_platform ); ?>
							</select>
							<?php
								} else {
									projax_autocomplete( 'platform_get_with_prefix', 'platform', array( 'value' => string_attribute( $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' => string_attribute( $f_os ), 'size' => '16', 'maxlength' => '16', 'tabindex' => helper_get_tab_index_value() ) );
								}
							?>
						</td>
					</tr>
					<tr <?php echo helper_alternate_class() ?>>
						<td class="category">
							<?php echo lang_get( 'os_version' ) ?><br><span style="font-size: 10px; color: #BB0000; font-family: Verdana, sans-serif;">(np. A-4/198/2013)</span>
						</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' => string_attribute( $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 if ( $tpl_show_status ) { ?>
	<tr <?php echo helper_alternate_class() ?>>
		<td class="category">
			<?php echo lang_get( 'status' ) ?>
		</td>
		<td>
			<select <?php echo helper_get_tab_index() ?> name="status">
			<?php 
			$resolution_options = get_status_option_list(access_get_project_level( $t_project_id), 
					config_get('bug_submit_status'), true, 
					ON == config_get( 'allow_reporter_close' ), $t_project_id );
			foreach ( $resolution_options as $key => $value ) {
			?>
				<option value="<?php echo $key ?>" <?php check_selected($key, config_get('bug_submit_status')); ?> >
					<?php echo $value ?>
				</option>
			<?php } ?>
			</select>
		</td>
	</tr>
<?php } ?>

<?php if ( $tpl_show_resolution ) { ?>
	<tr <?php echo helper_alternate_class() ?>>
		<td class="category">
			<?php echo lang_get( 'resolution' ) ?>
		</td>
		<td>
			<select <?php echo helper_get_tab_index() ?> name="resolution">
				<?php 
				print_enum_string_option_list('resolution', config_get('default_bug_resolution'));
				?>
			</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 ) ) ?>
	
	<!-- TEMAT -->
	<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>
	
	<!-- OPIS -->
	<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>

<!-- $s_steps_to_reproduce = 'Kroki, by powtórzyć'; SCHOWANE -->
<?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 } ?>

<!-- $s_additional_information = 'Dodatkowe informacje'; SCHOWANE -->
<?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
	// File Upload (if enabled)
	if ( $tpl_show_attachments ) {
		$t_max_file_size = (int)min( ini_get_number( 'upload_max_filesize' ), ini_get_number( 'post_max_size' ), config_get( 'max_file_size' ) );
		$t_file_upload_max_num = max( 1, config_get( 'file_upload_max_num' ) );
?>
	<tr <?php echo helper_alternate_class() ?>>
		<td class="category">
			<?php echo lang_get( $t_file_upload_max_num == 1 ? 'upload_file' : 'upload_files' ) ?>
			<?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
		// Display multiple file upload fields
		for( $i = 0; $i < $t_file_upload_max_num; $i++ ) {
?>
			<input <?php echo helper_get_tab_index() ?> id="ufile[]" name="ufile[]" type="file" size="50" />
<?php
			if( $t_file_upload_max_num > 1 ) {
				echo '<br />';
			}
		}
	}
?>
		</td>
	</tr>


<?php
	if ( $tpl_show_view_state ) {
?>
	<!-- $s_view_status = 'Widoczność'; -->
	<!--<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( config_get( 'default_bug_relationship_clone' ), "rel_type", false, true ) ?>
			<?php echo '<b>' . lang_get( 'bug' ) . ' ' . bug_format_id( $f_master_bug_id ) . '</b>' ?>
		</td>
	</tr>

	<tr <?php echo helper_alternate_class() ?>>
		<td class="category">
			<?php echo lang_get( 'copy_from_parent' ) ?>
		</td>
		<td>
			<label><input <?php echo helper_get_tab_index() ?> type="checkbox" id="copy_notes_from_parent" name="copy_notes_from_parent" <?php check_checked( $f_copy_notes_from_parent ) ?> /> <?php echo lang_get( 'copy_notes_from_parent' ) ?></label>
			<label><input <?php echo helper_get_tab_index() ?> type="checkbox" id="copy_attachments_from_parent" name="copy_attachments_from_parent" <?php check_checked( $f_copy_attachments_from_parent ) ?> /> <?php echo lang_get( 'copy_attachments_from_parent' ) ?></label>
		</td>
	</tr>
<?php
	}
?>
	<!-- $s_report_stay = 'Pozostań w zgłoszeniu'; -->
	<!--<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();
Attachments
dodatkowe_opcje.jpg
dodatkowe_opcje.jpg (26.77 KiB) Viewed 10256 times
Post Reply