From faa0aa7db9d9ad5a2396f04b34e694a73a2ca9c6 Mon Sep 17 00:00:00 2001 From: Glenn Henshaw Date: Tue, 19 Jul 2005 15:31:50 +0000 Subject: [PATCH] fix for 0005979: Enhancements to My Sponsorship page git-svn-id: http://mantisbt.svn.sourceforge.net/svnroot/mantisbt/trunk@3710 f5dc347c-c33d-0410-90a0-b07cc1902cb9 --- account_sponsor_page.php | 70 +++++++++++++++++++++++++++++----------- lang/strings_english.txt | 11 +++++-- 2 files changed, 59 insertions(+), 22 deletions(-) diff --git a/account_sponsor_page.php b/account_sponsor_page.php index fcaa4fd2ad..f045f06b09 100644 --- a/account_sponsor_page.php +++ b/account_sponsor_page.php @@ -6,7 +6,7 @@ # See the README and LICENSE files for details # -------------------------------------------------------- - # $Id: account_sponsor_page.php,v 1.1 2005-07-03 15:09:09 thraxisp Exp $ + # $Id: account_sponsor_page.php,v 1.2 2005-07-19 15:31:34 thraxisp Exp $ # -------------------------------------------------------- # CALLERS @@ -20,12 +20,11 @@ # CALLS # This page calls the following pages: - # - account_update.php (to save changes) - # - account_delete.php (to delete the user's account) + # - account_sponsor_update.php (to save changes) # RESTRICTIONS & PERMISSIONS - # - User must be authenticated - # - The user's account must not be protected + # - User must be authenticated, and not anonymous + # - sponsorship must be enabled require_once( 'core.php' ); @@ -41,10 +40,21 @@ if ( current_user_is_anonymous() ) { access_denied(); } + + $t_show_all = gpc_get_bool( 'show_all', false ); # start the page html_page_top1( lang_get( 'my_sponsorship' ) ); html_page_top2(); + + $t_project = helper_get_current_project(); + if ( ALL_PROJECTS == $t_project ) { + $t_project_title = lang_get( 'sponsor_all_projects' ); + } else { + $t_project_title = sprintf( lang_get( 'sponsor_project' ) , project_get_name( $t_project ) ); + } + echo '

' . $t_project_title . '

' . "\n"; + ?>
@@ -65,9 +75,12 @@ $t_sponsor_table = config_get( 'mantis_sponsorship_table' ); $t_payment = config_get( 'payment_enable', 0 ); + $t_show_clause = $t_show_all ? '' : 'AND ( b.status < ' . $t_resolved . ' OR s.paid < ' . SPONSORSHIP_PAID . ')'; + $t_project_clause = helper_project_specific_where( $t_project ); + $query = "SELECT b.id as bug, s.id as sponsor, s.paid, b.project_id, b.fixed_in_version, b.status FROM $t_bug_table b, $t_sponsor_table s - WHERE s.user_id=$t_user AND b.status >= $t_resolved AND s.bug_id = b.id + WHERE s.user_id=$t_user AND s.bug_id = b.id $t_show_clause AND $t_project_clause ORDER BY s.paid ASC, b.project_id ASC, b.fixed_in_version ASC, b.status ASC, b.id DESC"; $result = db_query( $query ); @@ -90,21 +103,20 @@ - + - - + + '; $row = db_fetch_array( $result ); $t_bug = bug_get( $row['bug'] ); $t_sponsor = sponsorship_get( $row['sponsor'] ); @@ -112,11 +124,18 @@ # describe bug $t_status = string_attribute( get_enum_element( 'status', $t_bug->status ) ); $t_resolution = string_attribute( get_enum_element( 'resolution', $t_bug->resolution ) ); + $t_version_id = version_get_id( $t_bug->fixed_in_version, $t_project ); + if ( ( false !== $t_version_id ) && ( VERSION_RELEASED == version_get_field( $t_version_id, 'released' ) ) ) { + $t_released_label = '' . $t_bug->fixed_in_version . ''; + } else { + $t_released_label = $t_bug->fixed_in_version; + } + echo ''; echo ''; echo ''; - echo ''; - echo ''; + echo ''; + echo ''; echo ''; @@ -166,7 +185,7 @@ $query = "SELECT b.id as bug, s.id as sponsor, s.paid, b.project_id, b.fixed_in_version, b.status FROM $t_bug_table b, $t_sponsor_table s - WHERE b.handler_id=$t_user AND b.status >= $t_resolved AND s.bug_id = b.id + WHERE b.handler_id=$t_user AND s.bug_id = b.id $t_show_clause AND $t_project_clause ORDER BY s.paid ASC, b.project_id ASC, b.fixed_in_version ASC, b.status ASC, b.id DESC"; $result = db_query( $query ); @@ -189,21 +208,20 @@ - + - - + + '; $row = db_fetch_array( $result ); $t_bug = bug_get( $row['bug'] ); $t_sponsor = sponsorship_get( $row['sponsor'] ); @@ -212,11 +230,18 @@ # describe bug $t_status = string_attribute( get_enum_element( 'status', $t_bug->status ) ); $t_resolution = string_attribute( get_enum_element( 'resolution', $t_bug->resolution ) ); + $t_version_id = version_get_id( $t_bug->fixed_in_version, $t_project ); + if ( ( false !== $t_version_id ) && ( VERSION_RELEASED == version_get_field( $t_version_id, 'released' ) ) ) { + $t_released_label = '' . $t_bug->fixed_in_version . ''; + } else { + $t_released_label = $t_bug->fixed_in_version; + } + echo ''; echo ''; echo ''; - echo ''; - echo ''; + echo ''; + echo ''; # summary echo '
      
' . bug_format_id( $row['bug'] ) . '' . project_get_field( $t_bug->project_id, 'name' ) . ' ' . $t_bug->fixed_in_version . ' ' . $t_status . ' ' . $t_released_label . ' ' . $t_status . ' '; print_user( $t_bug->handler_id ); echo '
    
' . bug_format_id( $row['bug'] ) . '' . project_get_field( $t_bug->project_id, 'name' ) . ' ' . $t_bug->fixed_in_version . ' ' . $t_status . ' ' . $t_released_label . ' ' . $t_status . ' ' . $t_bug->summary; @@ -271,5 +296,12 @@
+
+ ( $t_show_all ? 0 : 1 ) ) ); +?> +
\ No newline at end of file diff --git a/lang/strings_english.txt b/lang/strings_english.txt index 765e6031f4..336c78a080 100644 --- a/lang/strings_english.txt +++ b/lang/strings_english.txt @@ -9,11 +9,11 @@ ########################################################################### # English strings for Mantis # ------------------------------------------------- - # $Revision: 1.261 $ + # $Revision: 1.262 $ # $Author: thraxisp $ - # $Date: 2005-07-11 19:08:10 $ + # $Date: 2005-07-19 15:31:50 $ # - # $Id: strings_english.txt,v 1.261 2005-07-11 19:08:10 thraxisp Exp $ + # $Id: strings_english.txt,v 1.262 2005-07-19 15:31:50 thraxisp Exp $ ########################################################################### ?>