Skip to content

Commit

Permalink
Fixed #7003: Error in version 1.1.0-CVS when exporting to CVS.
Browse files Browse the repository at this point in the history
Fixed #7110: Option to customise columns on CSV export.
Fixed #7111: Option to customise columns on Print Issues page.


git-svn-id: http://mantisbt.svn.sourceforge.net/svnroot/mantisbt/trunk@4100 f5dc347c-c33d-0410-90a0-b07cc1902cb9
  • Loading branch information
vboctor committed May 18, 2006
1 parent 57c6d9f commit e18208e
Show file tree
Hide file tree
Showing 5 changed files with 45 additions and 43 deletions.
18 changes: 17 additions & 1 deletion config_defaults_inc.php
Expand Up @@ -6,7 +6,7 @@
# See the README and LICENSE files for details

# --------------------------------------------------------
# $Id: config_defaults_inc.php,v 1.303 2006-05-18 05:14:27 vboctor Exp $
# $Id: config_defaults_inc.php,v 1.304 2006-05-18 05:53:44 vboctor Exp $
# --------------------------------------------------------


Expand Down Expand Up @@ -447,11 +447,27 @@
$g_show_priority_text = OFF;

# A configuration option that identifies the columns to be shown on the View Issues page.
# In Mantis 1.1, this option can be overriden using the Generic Configuration screen.
# This configuration can be overriden dynamically by overriding the custom function "get_columns_to_view".
# Some of the columns specified here can be removed automatically if they conflict with other configuration.
# For example, sponsorship_total will be removed if sponsorships are disabled.
# To include custom field 'xyz', include the column name as 'custom_xyz'.
#
# Standard Column Names (i.e. names to choose from):
# selection, edit, id, project_id, reporter_id, handler_id, priority, reproducibility, projection, eta,
# resolution, fixed_in_version, view_state, os, os_build, platform, version, date_submitted, attachment,
# category, sponsorship_total, severity, status, last_updated, summary, bugnotes_count
$g_view_issues_page_columns = array ( 'selection', 'edit', 'priority', 'id', 'sponsorship_total', 'bugnotes_count', 'attachment', 'category', 'severity', 'status', 'last_updated', 'summary' );

# A configuration option that identifies the columns to be show on the print issues page.
# In Mantis 1.1, this option can be overriden using the Generic Configuration screen.
# This configuration can be overriden dynamically by overriding the custom function "get_columns_to_view".
$g_print_issues_page_columns = array ( 'selection', 'priority', 'id', 'sponsorship_total', 'bugnotes_count', 'attachment', 'category', 'severity', 'status', 'last_updated', 'summary' );

# A configuration option that identifies the columns to be include in the CSV export.
# In Mantis 1.1, this option can be overriden using the Generic Configuration screen.
# This configuration can be overriden dynamically by overriding the custom function "get_columns_to_view".
$g_csv_columns = array ( 'id', 'project_id', 'reporter_id', 'handler_id', 'priority', 'severity', 'reproducibility', 'version', 'projection', 'category', 'date_submitted', 'eta', 'os', 'os_build', 'platform', 'view_state', 'last_updated', 'summary', 'status', 'resolution', 'fixed_in_version', 'duplicate_id' );

# --- show projects when in All Projects mode ---
$g_show_bug_project_links = ON;
Expand Down
15 changes: 14 additions & 1 deletion core/columns_api.php
Expand Up @@ -6,7 +6,7 @@
# See the README and LICENSE files for details

# --------------------------------------------------------
# $Id: columns_api.php,v 1.12 2005-08-10 19:59:13 thraxisp Exp $
# $Id: columns_api.php,v 1.13 2006-05-18 05:53:44 vboctor Exp $
# --------------------------------------------------------
?>
<?php
Expand Down Expand Up @@ -53,6 +53,19 @@ function print_column_title_project_id( $p_sort, $p_dir, $p_columns_target = COL
}
}

# --------------------
# $p_columns_target: see COLUMNS_TARGET_* in constant_inc.php
function print_column_title_duplicate_id( $p_sort, $p_dir, $p_columns_target = COLUMNS_TARGET_VIEW_PAGE ) {
if ( $p_columns_target != COLUMNS_TARGET_CSV_PAGE ) {
echo '<td>';
print_view_bug_sort_link( lang_get( 'duplicate_id' ), 'duplicate_id', $p_sort, $p_dir, $p_columns_target );
print_sort_icon( $p_dir, $p_sort, 'duplicate_id' );
echo '</td>';
} else {
echo lang_get( 'duplicate_id' );
}
}

# --------------------
# $p_columns_target: see COLUMNS_TARGET_* in constant_inc.php
function print_column_title_reporter_id( $p_sort, $p_dir, $p_columns_target = COLUMNS_TARGET_VIEW_PAGE ) {
Expand Down
8 changes: 7 additions & 1 deletion core/csv_api.php
Expand Up @@ -6,7 +6,7 @@
# See the README and LICENSE files for details

# --------------------------------------------------------
# $Id: csv_api.php,v 1.8 2006-04-22 04:33:04 vboctor Exp $
# $Id: csv_api.php,v 1.9 2006-05-18 05:53:44 vboctor Exp $
# --------------------------------------------------------

### CSV API ###
Expand Down Expand Up @@ -195,4 +195,10 @@ function csv_format_resolution( $p_resolution ) {
function csv_format_duplicate_id( $p_duplicate_id ) {
return bug_format_id( $p_duplicate_id );
}

# --------------------
# return the selection
function csv_format_selection( $p_duplicate_id ) {
return csv_escape_string( '' );
}
?>
39 changes: 3 additions & 36 deletions core/custom_function_api.php
Expand Up @@ -6,7 +6,7 @@
# See the README and LICENSE files for details

# --------------------------------------------------------
# $Id: custom_function_api.php,v 1.26 2006-04-22 04:33:04 vboctor Exp $
# $Id: custom_function_api.php,v 1.27 2006-05-18 05:53:44 vboctor Exp $
# --------------------------------------------------------

$t_core_dir = dirname( __FILE__ ).DIRECTORY_SEPARATOR;
Expand Down Expand Up @@ -148,45 +148,12 @@ function custom_function_default_auth_can_change_password( ) {
# not applicable.
# $p_columns_target: see COLUMNS_TARGET_* in constant_inc.php
function custom_function_default_get_columns_to_view( $p_columns_target = COLUMNS_TARGET_VIEW_PAGE ) {
$t_columns = array();

if ( $p_columns_target == COLUMNS_TARGET_CSV_PAGE ) {
$t_columns[] = 'id'; // localized: 'id',
$t_columns[] = 'project_id'; // 'email_project'
$t_columns[] = 'reporter_id'; // 'reporter'
$t_columns[] = 'handler_id'; // 'assigned_to'
$t_columns[] = 'priority'; // 'priority'
$t_columns[] = 'severity'; // 'severity'
$t_columns[] = 'reproducibility'; // 'reproducibility'
$t_columns[] = 'version'; // 'version'
$t_columns[] = 'projection'; // 'projection'
$t_columns[] = 'category'; // 'category'
$t_columns[] = 'date_submitted'; // 'date_submitted'
$t_columns[] = 'eta'; // 'eta'
$t_columns[] = 'os'; // 'os'
$t_columns[] = 'os_build'; // 'os_version'
$t_columns[] = 'platform'; // 'platform'
$t_columns[] = 'view_state'; // 'view_status'
$t_columns[] = 'last_updated'; // 'last_update'
$t_columns[] = 'summary'; // 'summary'
$t_columns[] = 'status'; // 'status'
$t_columns[] = 'resolution'; // 'resolution'
$t_columns[] = 'fixed_in_version'; // 'fixed_in_version';
$t_columns[] = 'duplicate_id'; // 'duplicate_id'
$t_columns = config_get( 'csv_columns' );
} else if ( $p_columns_target == COLUMNS_TARGET_VIEW_PAGE ) {
$t_columns = config_get( 'view_issues_page_columns' );
} else {
$t_columns[] = 'selection';
$t_columns[] = 'priority';
$t_columns[] = 'id';
$t_columns[] = 'sponsorship_total';
$t_columns[] = 'bugnotes_count';
$t_columns[] = 'attachment';
$t_columns[] = 'category';
$t_columns[] = 'severity';
$t_columns[] = 'status';
$t_columns[] = 'last_updated';
$t_columns[] = 'summary';
$t_columns = config_get( 'print_issues_page_columns' );
}

return $t_columns;
Expand Down
8 changes: 4 additions & 4 deletions core/helper_api.php
Expand Up @@ -6,7 +6,7 @@
# See the README and LICENSE files for details

# --------------------------------------------------------
# $Id: helper_api.php,v 1.65 2006-05-02 14:05:08 vboctor Exp $
# $Id: helper_api.php,v 1.66 2006-05-18 05:53:44 vboctor Exp $
# --------------------------------------------------------

### Helper API ###
Expand Down Expand Up @@ -321,8 +321,8 @@ function helper_project_specific_where( $p_project_id, $p_user_id = null ) {

# --------------------
function helper_get_columns_to_view( $p_columns_target = COLUMNS_TARGET_VIEW_PAGE ) {
$t_columns = helper_call_custom_function( 'get_columns_to_view', array( COLUMNS_TARGET_VIEW_PAGE ) );
$t_columns = helper_call_custom_function( 'get_columns_to_view', array( $p_columns_target ) );

$t_enable_sponsorship = config_get( 'enable_sponsorship' );
if ( OFF == $t_enable_sponsorship ) {
$t_keys = array_keys( $t_columns, 'sponsorship_total' );
Expand All @@ -338,7 +338,7 @@ function helper_get_columns_to_view( $p_columns_target = COLUMNS_TARGET_VIEW_PAG
unset( $t_columns[$t_key] );
}
}

if ( OFF == config_get( 'enable_relationship' ) ) {
$t_keys = array_keys( $t_columns, 'duplicate_id' );
foreach ( $t_keys as $t_key ) {
Expand Down

0 comments on commit e18208e

Please sign in to comment.