Blame Identity/Models/Html/Mantis/1.1.2-1.fc9/print_all_bug_page.php

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

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

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

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