From d23cf5dde37c1ff3f54dd2f6833b50567cdb3093 Mon Sep 17 00:00:00 2001 From: Kornel Date: Tue, 4 May 2010 16:08:27 +0100 Subject: [PATCH 1/2] Option to linkify bug summaries on My View page --- config_defaults_inc.php | 8 +++++++- my_view_inc.php | 9 ++++++++- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/config_defaults_inc.php b/config_defaults_inc.php index 7fb5225..b7a3f79 100644 --- a/config_defaults_inc.php +++ b/config_defaults_inc.php @@ -871,7 +871,7 @@ $g_severity_significant_threshold = MAJOR; * they conflict with other configuration. Or if the current user doesn't have * the necessary access level to view them. For example, sponsorship_total will * be removed if sponsorships are disabled. To include custom field 'xyz', - include the column name as 'custom_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, @@ -1032,6 +1032,12 @@ $g_show_changelog_dates = ON; */ $g_show_roadmap_dates = ON; +/** + * Show summaries on My View page as links to bugs + * @global int $g_show_summary_as_link + */ +$g_show_summary_as_link = ON; + /************************** * MantisBT Time Settings * **************************/ diff --git a/my_view_inc.php b/my_view_inc.php index 21284a5..c730974 100644 --- a/my_view_inc.php +++ b/my_view_inc.php @@ -508,7 +508,14 @@ echo "($v_start - $v_end / $t_bug_count) if( ON == config_get( 'show_bug_project_links' ) && helper_get_current_project() != $t_bug->project_id ) { echo '[', string_display_line( project_get_name( $t_bug->project_id ) ), '] '; } - echo '', $t_summary, '
'; + + echo ''; + if ( ON == config_get( 'show_summary_as_link' ) ) { + echo '', $t_summary, ''; + } else { + echo $t_summary; + } + echo '
'; ?> Date: Wed, 5 May 2010 12:03:38 +0100 Subject: [PATCH 2/2] Added config option to disable showing of new window links ([^]). --- config_defaults_inc.php | 5 +++++ core/html_api.php | 9 ++++++++- core/print_api.php | 6 +++++- core/string_api.php | 8 +++++++- my_view_inc.php | 4 +++- 5 files changed, 28 insertions(+), 4 deletions(-) diff --git a/config_defaults_inc.php b/config_defaults_inc.php index b7a3f79..2303cb8 100644 --- a/config_defaults_inc.php +++ b/config_defaults_inc.php @@ -1038,6 +1038,11 @@ $g_show_roadmap_dates = ON; */ $g_show_summary_as_link = ON; +/** + * Append [ ^ ] new-window link to some links + */ +$g_show_new_window_links = ON; + /************************** * MantisBT Time Settings * **************************/ diff --git a/core/html_api.php b/core/html_api.php index dc3f65c..1e99f61 100644 --- a/core/html_api.php +++ b/core/html_api.php @@ -605,7 +605,14 @@ function html_footer( $p_file = null ) { echo '
'; if( ON == config_get( 'show_version' ) ) { $t_version_suffix = config_get_global( 'version_suffix' ); - echo "\t", 'MantisBT ', MANTIS_VERSION, ( $t_version_suffix ? " $t_version_suffix" : '' ), '', '[^]', "\n"; + + if ( ON === config_get('show_new_window_links') ) { + $t_new_window_link = '[^]'; + } else { + $t_new_window_link = ''; + } + + echo "\t", 'MantisBT ', MANTIS_VERSION, ( $t_version_suffix ? " $t_version_suffix" : '' ), '', $t_new_window_link , "\n"; } echo "\t", '
Copyright © 2000 - 2010 MantisBT Group
', "\n"; diff --git a/core/print_api.php b/core/print_api.php index 7a7486a..0127c93 100644 --- a/core/print_api.php +++ b/core/print_api.php @@ -1677,7 +1677,11 @@ function print_bug_attachments_list( $p_bug_id ) { $t_href_start = ""; $t_href_end = ''; - $t_href_clicket = " [^]"; + if ( ON === config_get('show_new_window_links') ) { + $t_href_clicket = " [^]"; + } else { + $t_href_clicket = ''; + } } else { $t_href_start = ''; $t_href_end = ''; diff --git a/core/string_api.php b/core/string_api.php index 8f1367f..ac015d9 100644 --- a/core/string_api.php +++ b/core/string_api.php @@ -473,7 +473,13 @@ function string_insert_hrefs( $p_string ) { $s_url_regex = "/(([[:alpha:]][-+.[:alnum:]]*):\/\/(${t_url_part1}*?${t_url_part2}+))/sue"; } - $p_string = preg_replace( $s_url_regex, "'\\1 [^]'", $p_string ); + if ( ON === config_get('show_new_window_links') ) { + $t_new_window_link_regex = " [^]"; + } else { + $t_new_window_link_regex = ''; + } + + $p_string = preg_replace( $s_url_regex, "'\\1$t_new_window_link_regex'", $p_string ); if( $t_change_quotes ) { ini_set( 'magic_quotes_sybase', true ); } diff --git a/my_view_inc.php b/my_view_inc.php index c730974..62e8d86 100644 --- a/my_view_inc.php +++ b/my_view_inc.php @@ -423,7 +423,9 @@ $box_title = lang_get( 'my_view_title_' . $t_box_title ); 0 ) { $v_start = $t_filter[FILTER_PROPERTY_ISSUES_PER_PAGE] * ( $f_page_number - 1 ) + 1; -- 1.7.0.2