Blame Identity/Webenv/Mantis/1.1.2-1.fc9/print_all_bug_page.php

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

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

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

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