Blame Identity/Models/Html/Mantis/1.1.2-1.fc9/core/my_view_inc.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
	#   $Revision: 2643 $
4c79b5
	#     $Author: al $    
4c79b5
	#       $Date: 2009-06-18 19:06:27 -0400 (Thu, 18 Jun 2009) $  
4c79b5
	#------------------------------
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 . 'string_api.php' );
4c79b5
	require_once( $t_core_path . 'date_api.php' );
4c79b5
	require_once( $t_core_path . 'icon_api.php' );
4c79b5
4c79b5
	$t_filter = current_user_get_bug_filter();
4c79b5
4c79b5
	if ( $t_filter === false ) {
4c79b5
		$t_filter = filter_get_default();
4c79b5
	}
4c79b5
4c79b5
	$t_sort = $t_filter['sort'];
4c79b5
	$t_dir = $t_filter['dir'];
4c79b5
4c79b5
	$t_checkboxes_exist = false;
4c79b5
4c79b5
	$t_icon_path = config_get( 'icon_path' );
4c79b5
	$t_update_bug_threshold = config_get( 'update_bug_threshold' );
4c79b5
	$t_bug_resolved_status_threshold = config_get( 'bug_resolved_status_threshold' );
4c79b5
	$t_hide_status_default = config_get( 'hide_status_default' );
4c79b5
	$t_default_show_changed = config_get( 'default_show_changed' );
4c79b5
4c79b5
	$c_filter['assigned'] = array(
4c79b5
		'show_category'		=> Array ( '0' => META_FILTER_ANY ),
4c79b5
		'show_severity'		=> Array ( '0' => META_FILTER_ANY ),
4c79b5
		'show_status'		=> Array ( '0' => META_FILTER_ANY ),
4c79b5
		'highlight_changed'	=> $t_default_show_changed,
4c79b5
		'reporter_id'		=> Array ( '0' => META_FILTER_ANY ),
4c79b5
		'handler_id'		=> Array ( '0' => $t_current_user_id ),
4c79b5
		'show_resolution'	=> Array ( '0' => META_FILTER_ANY ),
4c79b5
		'show_build'		=> Array ( '0' => META_FILTER_ANY ),
4c79b5
		'show_version'		=> Array ( '0' => META_FILTER_ANY ),
4c79b5
		'hide_status'		=> Array ( '0' => $t_bug_resolved_status_threshold ),
4c79b5
		'user_monitor'		=> Array ( '0' => META_FILTER_ANY )
4c79b5
	);
4c79b5
	$url_link_parameters['assigned'] = 'handler_id=' . $t_current_user_id . '&hide_status=' . $t_bug_resolved_status_threshold;
4c79b5
4c79b5
	$c_filter['recent_mod'] = array(
4c79b5
		'show_category'		=> Array ( '0' => META_FILTER_ANY ),
4c79b5
		'show_severity'		=> Array ( '0' => META_FILTER_ANY ),
4c79b5
		'show_status'		=> Array ( '0' => META_FILTER_ANY ),
4c79b5
		'highlight_changed'	=> $t_default_show_changed,
4c79b5
		'reporter_id'		=> Array ( '0' => META_FILTER_ANY ),
4c79b5
		'handler_id'		=> Array ( '0' => META_FILTER_ANY ),
4c79b5
		'show_resolution'	=> Array ( '0' => META_FILTER_ANY ),
4c79b5
		'show_build'		=> Array ( '0' => META_FILTER_ANY ),
4c79b5
		'show_version'		=> Array ( '0' => META_FILTER_ANY ),
4c79b5
		'hide_status'		=> Array ( '0' => META_FILTER_NONE ),
4c79b5
		'user_monitor'		=> Array ( '0' => META_FILTER_ANY )
4c79b5
	);
4c79b5
	$url_link_parameters['recent_mod'] = 'hide_status=none';
4c79b5
4c79b5
	$c_filter['reported'] = array(
4c79b5
		'show_category'		=> Array ( '0' => META_FILTER_ANY ),
4c79b5
		'show_severity'		=> Array ( '0' => META_FILTER_ANY ),
4c79b5
		'show_status'		=> Array ( '0' => META_FILTER_ANY ),
4c79b5
		'highlight_changed'	=> $t_default_show_changed,
4c79b5
		'reporter_id'		=> Array ( '0' => $t_current_user_id ),
4c79b5
		'handler_id'		=> Array ( '0' => META_FILTER_ANY ),
4c79b5
		'sort'			=> 'last_updated',
4c79b5
		'show_resolution'	=> Array ( '0' => META_FILTER_ANY ),
4c79b5
		'show_build'		=> Array ( '0' => META_FILTER_ANY ),
4c79b5
		'show_version'		=> Array ( '0' => META_FILTER_ANY ),
4c79b5
		'hide_status'		=> Array ( '0' => $t_hide_status_default ),
4c79b5
		'user_monitor'		=> Array ( '0' => META_FILTER_ANY )
4c79b5
	);
4c79b5
	$url_link_parameters['reported'] = 'reporter_id=' . $t_current_user_id . '&hide_status=' . $t_hide_status_default;
4c79b5
4c79b5
	$c_filter['resolved'] = array(
4c79b5
		'show_category'		=> Array ( '0' => META_FILTER_ANY ),
4c79b5
		'show_severity'		=> Array ( '0' => META_FILTER_ANY ),
4c79b5
		'show_status'		=> Array ( '0' => $t_bug_resolved_status_threshold ),
4c79b5
		'highlight_changed'	=> $t_default_show_changed,
4c79b5
		'reporter_id'		=> Array ( '0' => META_FILTER_ANY ),
4c79b5
		'handler_id'		=> Array ( '0' => META_FILTER_ANY ),
4c79b5
		'show_resolution'	=> Array ( '0' => META_FILTER_ANY ),
4c79b5
		'show_build'		=> Array ( '0' => META_FILTER_ANY ),
4c79b5
		'show_version'		=> Array ( '0' => META_FILTER_ANY ),
4c79b5
		'hide_status'		=> Array ( '0' => $t_hide_status_default ),
4c79b5
		'user_monitor'		=> Array ( '0' => META_FILTER_ANY )
4c79b5
	);
4c79b5
	$url_link_parameters['resolved'] = 'show_status=' . $t_bug_resolved_status_threshold . '&hide_status=' . $t_bug_resolved_status_threshold;
4c79b5
4c79b5
	$c_filter['unassigned'] = array(
4c79b5
		'show_category'		=> Array ( '0' => META_FILTER_ANY ),
4c79b5
		'show_severity'		=> Array ( '0' => META_FILTER_ANY ),
4c79b5
		'show_status'		=> Array ( '0' => META_FILTER_ANY ),
4c79b5
		'highlight_changed'	=> $t_default_show_changed,
4c79b5
		'reporter_id'		=> Array ( '0' => META_FILTER_ANY ),
4c79b5
		'handler_id'		=> Array ( '0' => META_FILTER_NONE ),
4c79b5
		'show_resolution'	=> Array ( '0' => META_FILTER_ANY ),
4c79b5
		'show_build'		=> Array ( '0' => META_FILTER_ANY ),
4c79b5
		'show_version'		=> Array ( '0' => META_FILTER_ANY ),
4c79b5
		'hide_status'		=> Array ( '0' => $t_hide_status_default ),
4c79b5
		'user_monitor'		=> Array ( '0' => META_FILTER_ANY )
4c79b5
	);
4c79b5
	$url_link_parameters['unassigned'] = 'handler_id=[none]' . '&hide_status=' . $t_hide_status_default;
4c79b5
4c79b5
	$c_filter['monitored'] = array(
4c79b5
		'show_category'		=> Array ( '0' => META_FILTER_ANY ),
4c79b5
		'show_severity'		=> Array ( '0' => META_FILTER_ANY ),
4c79b5
		'show_status'		=> Array ( '0' => META_FILTER_ANY ),
4c79b5
		'highlight_changed'	=> $t_default_show_changed,
4c79b5
		'reporter_id'		=> Array ( '0' => META_FILTER_ANY ),
4c79b5
		'handler_id'		=> Array ( '0' => META_FILTER_ANY ),
4c79b5
		'show_resolution'	=> Array ( '0' => META_FILTER_ANY ),
4c79b5
		'show_build'		=> Array ( '0' => META_FILTER_ANY ),
4c79b5
		'show_version'		=> Array ( '0' => META_FILTER_ANY ),
4c79b5
		'hide_status'		=> Array ( '0' => $t_hide_status_default ),
4c79b5
		'user_monitor'		=> Array ( '0' => $t_current_user_id )
4c79b5
	);
4c79b5
	$url_link_parameters['monitored'] = 'user_monitor=' . $t_current_user_id . '&hide_status=' . $t_hide_status_default;
4c79b5
4c79b5
4c79b5
	$c_filter['feedback'] = array(
4c79b5
		'show_category'		=> Array ( '0' => META_FILTER_ANY ),
4c79b5
		'show_severity'		=> Array ( '0' => META_FILTER_ANY ),
4c79b5
		'show_status'		=> Array ( '0' => FEEDBACK ),
4c79b5
		'highlight_changed'	=> $t_default_show_changed,
4c79b5
		'reporter_id'		=> Array ( '0' => $t_current_user_id ),
4c79b5
		'handler_id'		=> Array ( '0' => META_FILTER_ANY ),
4c79b5
		'show_resolution'	=> Array ( '0' => META_FILTER_ANY ),
4c79b5
		'show_build'		=> Array ( '0' => META_FILTER_ANY ),
4c79b5
		'show_version'		=> Array ( '0' => META_FILTER_ANY ),
4c79b5
		'hide_status'		=> Array ( '0' => $t_hide_status_default ),
4c79b5
		'user_monitor'		=> Array ( '0' => META_FILTER_ANY )
4c79b5
	);
4c79b5
	$url_link_parameters['feedback'] = 'reporter_id=' . $t_current_user_id . '&show_status=' . FEEDBACK . '&hide_status=' . $t_hide_status_default;
4c79b5
4c79b5
	$c_filter['verify'] = array(
4c79b5
		'show_category'		=> Array ( '0' => META_FILTER_ANY ),
4c79b5
		'show_severity'		=> Array ( '0' => META_FILTER_ANY ),
4c79b5
		'show_status'		=> Array ( '0' => $t_bug_resolved_status_threshold ),
4c79b5
		'highlight_changed'	=> $t_default_show_changed,
4c79b5
		'reporter_id'		=> Array ( '0' => $t_current_user_id ),
4c79b5
		'handler_id'		=> Array ( '0' => META_FILTER_ANY ),
4c79b5
		'show_resolution'	=> Array ( '0' => META_FILTER_ANY ),
4c79b5
		'show_build'		=> Array ( '0' => META_FILTER_ANY ),
4c79b5
		'show_version'		=> Array ( '0' => META_FILTER_ANY ),
4c79b5
		'hide_status'		=> Array ( '0' => $t_hide_status_default ),
4c79b5
		'user_monitor'		=> Array ( '0' => META_FILTER_ANY )
4c79b5
	);
4c79b5
	$url_link_parameters['verify'] = 'reporter_id=' . $t_current_user_id . '&show_status=' . $t_bug_resolved_status_threshold;
4c79b5
4c79b5
        $rows = filter_get_bug_rows ( $f_page_number, $t_per_page, $t_page_count, $t_bug_count, $c_filter[$t_box_title]  );
4c79b5
		$t_filter = array_merge( $c_filter[$t_box_title], $t_filter );
4c79b5
4c79b5
        $box_title = lang_get( 'my_view_title_' . $t_box_title );
4c79b5
?>
4c79b5
4c79b5
4c79b5
4c79b5
4c79b5
4c79b5
4c79b5
4c79b5
	
4c79b5
	
4c79b5
		
4c79b5
			echo '';
4c79b5
			echo $box_title;
4c79b5
			echo '';
4c79b5
			echo ' [';
4c79b5
			echo '';
4c79b5
			echo '^';
4c79b5
			echo ']';
4c79b5
		?>
4c79b5
		
4c79b5
			if ( sizeof( $rows ) > 0 ) {
4c79b5
				$v_start = $t_filter['per_page'] * ($f_page_number-1) +1;
4c79b5
				$v_end   = $v_start + sizeof( $rows ) -1;
4c79b5
			} else {
4c79b5
				$v_start = 0;
4c79b5
				$v_end   = 0;
4c79b5
			}
4c79b5
			echo "($v_start - $v_end / $t_bug_count)";
4c79b5
		?>
4c79b5
	
4c79b5
4c79b5
4c79b5
4c79b5
4c79b5
4c79b5
	for($i=0; $i < sizeof( $rows ); $i++) {
4c79b5
		# prefix bug data with v_
4c79b5
4c79b5
		extract( $rows[$i], EXTR_PREFIX_ALL, 'v' );
4c79b5
4c79b5
		$t_summary = string_attribute( $v_summary );
4c79b5
		$t_last_updated = date( config_get( 'normal_date_format' ), $v_last_updated );
4c79b5
4c79b5
		# choose color based on status
4c79b5
		$status_color = get_status_color( $v_status );
4c79b5
4c79b5
		# grab the bugnote count
4c79b5
		# @@@ thraxisp - not used???
4c79b5
#		$bugnote_info = bug_get_bugnote_stats( $v_id );
4c79b5
4c79b5
		# Check for attachments
4c79b5
		$t_attachment_count = 0;
4c79b5
		if (  ( file_can_view_bug_attachments( $v_id ) ) ) {
4c79b5
		   $t_attachment_count = file_bug_attachment_count( $v_id );
4c79b5
		}
4c79b5
4c79b5
		# grab the project name
4c79b5
		$project_name = project_get_field( $v_project_id, 'name' );
4c79b5
?>
4c79b5
4c79b5
4c79b5
	
4c79b5
	
4c79b5
		
4c79b5
		
4c79b5
			print_bug_link( $v_id );
4c79b5
4c79b5
			echo '
';
4c79b5
4c79b5
			if ( !bug_is_readonly( $v_id ) && access_has_bug_level( $t_update_bug_threshold, $v_id ) ) {
4c79b5
				echo '' . lang_get( 'update_bug_button' ) . '';
4c79b5
			}
4c79b5
4c79b5
			if ( ON == config_get( 'show_priority_text' ) ) {
4c79b5
				print_formatted_priority_string( $v_status, $v_priority );
4c79b5
			} else {
4c79b5
				print_status_icon( $v_priority );
4c79b5
			}
4c79b5
4c79b5
			if ( 0 < $t_attachment_count ) {
4c79b5
				echo '';
4c79b5
				echo '
4c79b5
				echo ' alt="' . lang_get( 'attachment_alt' ) . '"';
4c79b5
				echo ' title="' . $t_attachment_count . ' ' . lang_get( 'attachments' ) . '"';
4c79b5
				echo ' />';
4c79b5
				echo '';
4c79b5
			}
4c79b5
			if ( VS_PRIVATE == $v_view_state ) {
4c79b5
				echo '' . lang_get( 'private' ) . '';
4c79b5
			}
4c79b5
		?>
4c79b5
		
4c79b5
	
4c79b5
4c79b5
	
4c79b5
	
4c79b5
		
4c79b5
		
4c79b5
			echo $t_summary;
4c79b5
		?>
4c79b5
		
4c79b5
		
4c79b5
			# type project name if viewing 'all projects' or bug is in subproject
4c79b5
			if ( ON == config_get( 'show_bug_project_links' ) &&
4c79b5
				helper_get_current_project() != $v_project_id ) {
4c79b5
				echo '[';
4c79b5
				print( $project_name );
4c79b5
				echo '] ';
4c79b5
			}
4c79b5
			echo string_display( $v_category );
4c79b5
4c79b5
			if ( $v_last_updated > strtotime( '-'.$t_filter['highlight_changed'].' hours' ) ) {
4c79b5
				echo ' - ' . $t_last_updated . '';
4c79b5
			} else {
4c79b5
				echo ' - ' . $t_last_updated;
4c79b5
			}
4c79b5
		?>
4c79b5
		
4c79b5
	
4c79b5
4c79b5
4c79b5
4c79b5
	}
4c79b5
?>
4c79b5
4c79b5
4c79b5
4c79b5
4c79b5