.
/**
* Word 2000 export page
* The bugs displayed in print_all_bug_page.php are saved in a .doc file
* The IE icon allows to see or directly print the same result
*
* @package MantisBT
* @copyright Copyright (C) 2000 - 2002 Kenzaburo Ito - kenito@300baud.org
* @copyright Copyright (C) 2002 - 2014 MantisBT Team - mantisbt-dev@lists.sourceforge.net
* @link http://www.mantisbt.org
*/
/**
* MantisBT Core API's
*/
require_once( 'core.php' );
require_once( 'current_user_api.php' );
require_once( 'bug_api.php' );
require_once( 'custom_field_api.php' );
require_once( 'string_api.php' );
require_once( 'date_api.php' );
auth_ensure_user_authenticated();
$f_type_page = gpc_get_string( 'type_page', 'word' );
$f_search = gpc_get_string( 'search', false ); /** @todo need a better default */
$f_offset = gpc_get_int( 'offset', 0 );
$f_export = gpc_get_string( 'export' );
$f_show_flag = gpc_get_bool( 'show_flag' );
helper_begin_long_process();
# word or html export
if ( $f_type_page != 'html' ) {
$t_export_title = helper_get_default_export_filename( '' );
$t_export_title = preg_replace( '/[\/:*?"<>|]/', '', $t_export_title );
$t_export_title .= '.doc';
# Make sure that IE can download the attachments under https.
header( 'Pragma: public' );
header( 'Content-Type: application/msword' );
http_content_disposition_header( $t_export_title );
}
# This is where we used to do the entire actual filter ourselves
$t_page_number = gpc_get_int( 'page_number', 1 );
$t_per_page = -1;
$t_bug_count = null;
$t_page_count = null;
$result = filter_get_bug_rows( $t_page_number, $t_per_page, $t_page_count, $t_bug_count );
$t_row_count = count( $result );
?>
id;
if ( $j % 50 == 0 ) {
# to save ram as report will list data once, clear cache after 50 bugs
bug_text_clear_cache();
bug_clear_cache();
bugnote_clear_cache();
}
# display the available and selected bugs
if ( in_array( $t_id, $f_bug_arr ) || !$f_show_flag ) {
if ( $t_count_exported > 0 ) {
echo "
";
}
$t_count_exported++;
$t_last_updated = date( $g_short_date_format, $t_bug->last_updated );
# grab the project name
$t_project_name = project_get_field( $t_bug->project_id, 'name' );
$t_category_name = category_full_name( $t_bug->category_id, false );
?>
|
|
:
|
:
|
:
|
:
|
:
|
:
|
|
|
severity, auth_get_current_user_id(), $t_bug->project_id ) ?>
|
reproducibility, auth_get_current_user_id(), $t_bug->project_id ) ?>
|
date_submitted ) ?>
|
last_updated ) ?>
|
|
:
|
reporter_id, $t_id ) ?>
|
:
|
platform ) ?>
|
:
|
|
due_date ) ) {
echo date( $t_short_date_format, $t_bug->due_date );
print "\t\t | \n";
}
} else {
?>
|
:
|
handler_id, $t_id );
}
?>
|
:
|
os ) ?>
|
|
:
|
priority, auth_get_current_user_id(), $t_bug->project_id ) ?>
|
:
|
os_build ) ?>
|
|
:
|
status, auth_get_current_user_id(), $t_bug->project_id ) ?>
|
:
|
version ) ?>
|
|
:
|
build ) ?>
|
:
|
resolution, auth_get_current_user_id(), $t_bug->project_id ) ?>
|
|
:
|
projection, auth_get_current_user_id(), $t_bug->project_id ) ?>
|
|
|
|
:
|
eta, auth_get_current_user_id(), $t_bug->project_id ) ?>
|
:
|
fixed_in_version ) ?>
|
|
|
|
:
|
target_version ) ?>
|
|
project_id );
foreach( $t_related_custom_field_ids as $t_custom_field_id ) {
# Don't display the field if user does not have read access to it
if ( !custom_field_has_read_access_by_project_id( $t_custom_field_id, $t_bug->project_id ) ) {
continue;
}
$t_def = custom_field_get_definition( $t_custom_field_id );
?>
:
|
|
|
:
|
summary ) ?>
|
:
|
description ) ?>
|
:
|
steps_to_reproduce ) ?>
|
:
|
additional_information ) ?>
|
profile_id > 0 ) {
$t_profile_row = profile_get_row_direct( $t_bug->profile_id );
$t_profile_description = string_display( $t_profile_row['description'] );
?>
|
|
:
|
';
}
$c_filename = string_display_line( $t_attachment['display_name'] );
$c_download_url = $t_path . htmlspecialchars( $t_attachment['download_url'] );
$c_filesize = number_format( $t_attachment['size'] );
$c_date_added = date( $t_date_format, $t_attachment['date_added'] );
echo "$c_filename ($c_filesize) $c_date_added $c_download_url";
if ( $t_attachment['preview'] && $t_attachment['type'] == 'image' && $f_type_page == 'html' ) {
echo '
';
}
}
?>
|
|
|
date_submitted );
$t_last_modified = date( $t_date_format, $t_bugnote->last_modified );
# grab the bugnote text and id and prefix with v3_
$t_note = string_display_links( $t_bugnote->note );
?>
|
(id ) ?>)
|
reporter_id ) ?>
|
date_submitted != $t_bugnote->last_modified ) {
echo ' (' . lang_get( 'edited_on') . lang_get( 'word_separator' ) . $t_last_modified . ')';
} ?>
|
|
note_type ) {
case REMINDER:
echo lang_get( 'reminder_sent_to' ) . ': ';
$t_note_attr = utf8_substr( $t_bugnote->note_attr, 1, utf8_strlen( $t_bugnote->note_attr ) - 2 );
$t_to = array();
foreach ( explode( '|', $t_note_attr ) as $t_recipient ) {
$t_to[] = prepare_user_name( $t_recipient );
}
echo implode( ', ', $t_to ) . ' ';
default:
echo string_display_links( $t_bugnote->note );
}
?>
|
|
';
} # end in_array
} # end main loop