Blame Extras/Mantis/1.1.2-1.fc9/print_all_bug_page.php

4c79b5
4c79b5
# Mantis - a php based bugtracking system
4c79b5
4c79b5
# Copyright (C) 2000 - 2002  Kenzaburo Ito - kenito@300baud.org
4c79b5
# Copyright (C) 2002 - 2007  Mantis Team   - mantisbt-dev@lists.sourceforge.net
4c79b5
4c79b5
# Mantis is free software: you can redistribute it and/or modify
4c79b5
# it under the terms of the GNU General Public License as published by
4c79b5
# the Free Software Foundation, either version 2 of the License, or
4c79b5
# (at your option) any later version.
4c79b5
#
4c79b5
# Mantis is distributed in the hope that it will be useful,
4c79b5
# but WITHOUT ANY WARRANTY; without even the implied warranty of
4c79b5
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
4c79b5
# GNU General Public License for more details.
4c79b5
#
4c79b5
# You should have received a copy of the GNU General Public License
4c79b5
# along with Mantis.  If not, see <http://www.gnu.org/licenses/>.
4c79b5
4c79b5
	# --------------------------------------------------------
4c79b5
	# $Id: print_all_bug_page.php,v 1.89.2.1 2007-10-13 22:34:15 giallu Exp $
4c79b5
	# --------------------------------------------------------
4c79b5
?>
4c79b5
4c79b5
	# Bugs to display / print / export can be selected with the checkboxes
4c79b5
	# A printing Options link allows to choose the fields to export
4c79b5
	# Export :
4c79b5
	#	- the bugs displayed in print_all_bug_page.php are saved in a .doc or .xls file
4c79b5
	#   - the IE icons allows to see or directly print the same result
4c79b5
?>
4c79b5
4c79b5
	require_once( 'core.php' );
4c79b5
4c79b5
	$t_core_path = config_get( 'core_path' );
4c79b5
4c79b5
	require_once( $t_core_path.'current_user_api.php' );
4c79b5
	require_once( $t_core_path.'bug_api.php' );
4c79b5
	require_once( $t_core_path.'date_api.php' );
4c79b5
	require_once( $t_core_path.'icon_api.php' );
4c79b5
	require_once( $t_core_path.'string_api.php' );
4c79b5
	require_once( $t_core_path.'columns_api.php' );
4c79b5
4c79b5
	auth_ensure_user_authenticated();
4c79b5
4c79b5
	$f_search		= gpc_get_string( 'search', false ); # @@@ need a better default
4c79b5
	$f_offset		= gpc_get_int( 'offset', 0 );
4c79b5
4c79b5
	$t_cookie_value_id = gpc_get_cookie( config_get( 'view_all_cookie' ), '' );
4c79b5
	$t_cookie_value = filter_db_get_filter( $t_cookie_value_id );
4c79b5
4c79b5
	$f_highlight_changed 	= 0;
4c79b5
	$f_sort 				= null;
4c79b5
	$f_dir		 			= null;
4c79b5
	$t_project_id 			= 0;
4c79b5
4c79b5
	$t_columns = helper_get_columns_to_view( COLUMNS_TARGET_PRINT_PAGE );
4c79b5
	$t_num_of_columns = sizeof( $t_columns );
4c79b5
4c79b5
	# check to see if the cookie exists
4c79b5
	if ( ! is_blank( $t_cookie_value ) ) {
4c79b5
4c79b5
		# check to see if new cookie is needed
4c79b5
		if ( ! filter_is_cookie_valid() ) {
4c79b5
			print_header_redirect( 'view_all_set.php?type=0&print=1' );
4c79b5
		}
4c79b5
4c79b5
		$t_setting_arr = explode( '#', $t_cookie_value, 2 );
4c79b5
		$t_filter_cookie_arr = unserialize( $t_setting_arr[1] );
4c79b5
4c79b5
		$f_highlight_changed 	= $t_filter_cookie_arr['highlight_changed'];
4c79b5
		$f_sort 				= $t_filter_cookie_arr['sort'];
4c79b5
		$f_dir		 			= $t_filter_cookie_arr['dir'];
4c79b5
		$t_project_id 			= helper_get_current_project( );
4c79b5
	}
4c79b5
4c79b5
	# This replaces the actual search that used to be here
4c79b5
	$f_page_number = gpc_get_int( 'page_number', 1 );
4c79b5
	$t_per_page = -1;
4c79b5
	$t_bug_count = null;
4c79b5
	$t_page_count = null;
4c79b5
4c79b5
	$result = filter_get_bug_rows( $t_page_number, $t_per_page, $t_page_count, $t_bug_count );
4c79b5
	$row_count = sizeof( $result );
4c79b5
4c79b5
	# for export
4c79b5
	$t_show_flag = gpc_get_int( 'show_flag', 0 );
4c79b5
?>
4c79b5
4c79b5
4c79b5
4c79b5
4c79b5
4c79b5
4c79b5
4c79b5
	
4c79b5
		
4c79b5
	
4c79b5
4c79b5
4c79b5
4c79b5
4c79b5

4c79b5
4c79b5
<form method="post" action="view_all_set.php">
4c79b5
<input type="hidden" name="type" value="1" />
4c79b5
<input type="hidden" name="print" value="1" />
4c79b5
<input type="hidden" name="offset" value="0" />
4c79b5
<input type="hidden" name="sort" value="<?php echo $f_sort ?>" />
4c79b5
<input type="hidden" name="dir" value="<?php echo $f_dir ?>" />
4c79b5
4c79b5
4c79b5
4c79b5
	#<SQLI> Excel & Print export
4c79b5
	#$f_bug_array stores the number of the selected rows
4c79b5
	#$t_bug_arr_sort is used for displaying
4c79b5
	#$f_export is a string for the word and excel pages
4c79b5
4c79b5
	$f_bug_arr = gpc_get_int_array( 'bug_arr', array() );
4c79b5
	$f_bug_arr[$row_count]=-1;
4c79b5
4c79b5
	for( $i=0; $i < $row_count; $i++ ) {
4c79b5
		if ( isset( $f_bug_arr[$i] ) ) {
4c79b5
			$index = $f_bug_arr[$i];
4c79b5
			$t_bug_arr_sort[$index]=1;
4c79b5
		}
4c79b5
	}
4c79b5
	$f_export = implode( ',', $f_bug_arr );
4c79b5
4c79b5
	$t_icon_path = config_get( 'icon_path' );
4c79b5
?>
4c79b5
4c79b5
4c79b5
	
4c79b5
4c79b5
		if ( 'DESC' == $f_dir ) {
4c79b5
			$t_new_dir = 'ASC';
4c79b5
		} else {
4c79b5
			$t_new_dir = 'DESC';
4c79b5
		}
4c79b5
4c79b5
		$t_search = urlencode( $f_search );
4c79b5
4c79b5
		$t_icons = array(
4c79b5
			array( 'print_all_bug_page_excel', 'excel', '', 'fileicons/xls.gif', 'Excel 2000' ),
4c79b5
			array( 'print_all_bug_page_excel', 'html', 'target="_blank"', 'ie.gif', 'Excel View' ),
4c79b5
			array( 'print_all_bug_page_word', 'word', '', 'fileicons/doc.gif', 'Word 2000' ),
4c79b5
			array( 'print_all_bug_page_word', 'html', 'target="_blank"', 'ie.gif', 'Word View' ) );
4c79b5
4c79b5
		foreach ( $t_icons as $t_icon ) {
4c79b5
			echo '
4c79b5
				"?search=$t_search" .
4c79b5
				"&sort=$f_sort" .
4c79b5
				"&dir=$t_new_dir" .
4c79b5
				'&type_page=' . $t_icon[1] .
4c79b5
				"&export=$f_export" .
4c79b5
				"&show_flag=$t_show_flag" .
4c79b5
				'" ' . $t_icon[2] . '>' .
4c79b5
				'' . $t_icon[4] . ' ';
4c79b5
		}
4c79b5
?>
4c79b5
	
4c79b5
4c79b5
 ?>
4c79b5
4c79b5
4c79b5
</form>
4c79b5
4c79b5

4c79b5
4c79b5
<form method="post" action="print_all_bug_page.php">
4c79b5
4c79b5
4c79b5
	
4c79b5
		
4c79b5
		
4c79b5
			if ( $row_count > 0 ) {
4c79b5
				$v_start = $f_offset+1;
4c79b5
				$v_end   = $f_offset+$row_count;
4c79b5
			} else {
4c79b5
				$v_start = 0;
4c79b5
				$v_end   = 0;
4c79b5
			}
4c79b5
			echo "( $v_start - $v_end )";
4c79b5
		?>
4c79b5
	
4c79b5
	
4c79b5
		
4c79b5
		
4c79b5
		
4c79b5
	
4c79b5
4c79b5
4c79b5
	
4c79b5
		$t_sort = $f_sort;	// used within the custom function called in the loop (@@@ cleanup)
4c79b5
		$t_dir = $f_dir;    // used within the custom function called in the loop (@@@ cleanup)
4c79b5
4c79b5
		foreach( $t_columns as $t_column ) {
4c79b5
			$t_title_function = 'print_column_title';
4c79b5
			helper_call_custom_function( $t_title_function, array( $t_column, COLUMNS_TARGET_PRINT_PAGE ) );
4c79b5
		}
4c79b5
	?>
4c79b5
4c79b5
4c79b5
	
4c79b5
4c79b5
4c79b5
	for( $i=0; $i < $row_count; $i++ ) {
4c79b5
		$t_row = $result[$i];
4c79b5
4c79b5
		# alternate row colors
4c79b5
		$status_color = helper_alternate_colors( $i, '#ffffff', '#dddddd' );
4c79b5
		if ( isset( $t_bug_arr_sort[ $t_row['id'] ] ) || ( $t_show_flag==0 ) ) {
4c79b5
?>
4c79b5
4c79b5
4c79b5
		foreach( $t_columns as $t_column ) {
4c79b5
			$t_column_value_function = 'print_column_value';
4c79b5
			helper_call_custom_function( $t_column_value_function, array( $t_column, $t_row, COLUMNS_TARGET_PRINT_PAGE ) );
4c79b5
		}
4c79b5
?>
4c79b5
4c79b5
4c79b5
	} # isset_loop
4c79b5
} # for_loop
4c79b5
?>
4c79b5
<input type="hidden" name="show_flag" value="1" />
4c79b5
4c79b5
4c79b5

4c79b5
4c79b5
<input type="submit" class="button" value="<?php echo lang_get( 'hide_button' ) ?>" />
4c79b5
</form>