logo       
Google Custom Search
    AddThis Social Bookmark Button
-->

mantisbt changelog_page.php,1.10,1.11: msg#00059

Subject: mantisbt changelog_page.php,1.10,1.11
Update of /cvsroot/mantisbt/mantisbt
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9737

Modified Files:
        changelog_page.php 
Log Message:
Implemented 5143: Possibility to extend the changelog

Index: changelog_page.php
===================================================================
RCS file: /cvsroot/mantisbt/mantisbt/changelog_page.php,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -d -r1.10 -r1.11
--- changelog_page.php  24 Jan 2005 20:15:54 -0000      1.10
+++ changelog_page.php  27 Jan 2005 13:45:31 -0000      1.11
@@ -10,9 +10,9 @@
        # --------------------------------------------------------
 
        require_once( 'core.php' );
-       
+
        $t_core_path = config_get( 'core_path' );
-       
+
        require_once( $t_core_path.'bug_api.php' );
 
        # Print header for the specified project version.
@@ -31,95 +31,109 @@
                }
        }
 
+       $t_user_id = auth_get_current_user_id();
        $f_project_id = gpc_get_int( 'project_id', helper_get_current_project() 
);
 
-       # this page is invalid for the 'All Project' selection
        if ( ALL_PROJECTS == $f_project_id ) {
-               print_header_redirect( 
'login_select_proj_page.php?ref=changelog_page.php' );
+               $t_project_ids = user_get_accessible_projects( $t_user_id );
+       } else {
+               access_ensure_project_level( config_get( 
'view_changelog_threshold' ), $f_project_id );
+               $t_project_ids = array( $f_project_id );
        }
 
-       access_ensure_project_level( config_get( 'view_changelog_threshold' ), 
$f_project_id );
+       # this page is invalid for the 'All Project' selection
+       #if ( ALL_PROJECTS == $f_project_id ) {
+       #       print_header_redirect( 
'login_select_proj_page.php?ref=changelog_page.php' );
+       #}
 
        html_page_top1( lang_get( 'changelog' ) );  // title
        html_page_top2();
 
-       $c_project_id   = db_prepare_int( $f_project_id );
-       $t_project_name = project_get_field( $f_project_id, 'name' );
-       $t_can_view_private = access_has_project_level( config_get( 
'private_bug_threshold' ), $f_project_id );
+       $t_project_index = 0;
 
-       $t_limit_reporters = config_get( 'limit_reporters' );
-       $t_user_id = auth_get_current_user_id();
-       $t_user_access_level_is_reporter = ( current_user_get_access_level() <= 
config_get( 'report_bug_threshold' ) );
+       foreach( $t_project_ids as $t_project_id ) {
+               if ( $t_project_index > 0 ) {
+                       echo '<br />';
+               }
 
-       $t_resolved = config_get( 'bug_resolved_status_threshold' );
-       $t_bug_table    = config_get( 'mantis_bug_table' );
+               $c_project_id   = db_prepare_int( $t_project_id );
+               $t_project_name = project_get_field( $t_project_id, 'name' );
+               $t_can_view_private = access_has_project_level( config_get( 
'private_bug_threshold' ), $t_project_id );
 
-       $t_version_rows = version_get_all_rows( $f_project_id );
+               $t_limit_reporters = config_get( 'limit_reporters' );
+               $t_user_access_level_is_reporter = ( 
current_user_get_access_level() <= config_get( 'report_bug_threshold' ) );
 
-       echo '<br /><span class="pagetitle">', $t_project_name, ' - ', 
lang_get( 'changelog' ), '</span><br /><br />';
-       echo '<tt>';
+               $t_resolved = config_get( 'bug_resolved_status_threshold' );
+               $t_bug_table    = config_get( 'mantis_bug_table' );
 
-       $i = 0;
+               $t_version_rows = version_get_all_rows( $t_project_id );
 
-       foreach( $t_version_rows as $t_version_row ) {
-               $t_version = $t_version_row['version'];
-               $c_version = db_prepare_string( $t_version );
+               echo '<br /><span class="pagetitle">', $t_project_name, ' - ', 
lang_get( 'changelog' ), '</span><br /><br />';
+               echo '<tt>';
 
-               $t_version_id = version_get_id( $t_version, $f_project_id );
+               $i = 0;
 
-               $query = "SELECT id, view_state FROM $t_bug_table WHERE 
project_id='$c_project_id' AND fixed_in_version='$c_version' ORDER BY 
last_updated DESC";
+               foreach( $t_version_rows as $t_version_row ) {
+                       $t_version = $t_version_row['version'];
+                       $c_version = db_prepare_string( $t_version );
 
-               $t_description = version_get_field( $t_version_id, 
'description' );
-               if ( !is_blank( $t_description ) ) {
-                       if ( $i > 0 ) {
-                               echo '<br />';
-                       }
+                       $t_version_id = version_get_id( $t_version, 
$t_project_id );
 
-                       print_version_header( $t_version_id );
-                       $t_version_header_printed = true;
-               } else {
-                       $t_version_header_printed = false;
-               }
-               $t_first_entry = true;
-               
-               for ( $t_result = db_query( $query ); !$t_result->EOF; 
$t_result->MoveNext() ) {
-                       # hide private bugs if user doesn't have access to view 
them.
-                       if ( !$t_can_view_private && ( 
$t_result->fields['view_state'] == VS_PRIVATE ) ) {
-                               continue;
-                       }
+                       $query = "SELECT id, view_state FROM $t_bug_table WHERE 
project_id='$c_project_id' AND fixed_in_version='$c_version' ORDER BY 
last_updated DESC";
 
-                       # check limit_Reporter (Issue #4770)
-                       # reporters can view just issues they reported
-                       if ( ON === $t_limit_reporters && 
$t_user_access_level_is_reporter &&
-                            !bug_is_user_reporter( $t_result->fields['id'], 
$t_user_id )) {
-                         continue;
+                       $t_description = version_get_field( $t_version_id, 
'description' );
+                       if ( !is_blank( $t_description ) ) {
+                               if ( $i > 0 ) {
+                                       echo '<br />';
+                               }
+
+                               print_version_header( $t_version_id );
+                               $t_version_header_printed = true;
+                       } else {
+                               $t_version_header_printed = false;
                        }
+                       $t_first_entry = true;
 
-                       $t_issue_id = $t_result->fields['id'];
+                       for ( $t_result = db_query( $query ); !$t_result->EOF; 
$t_result->MoveNext() ) {
+                               # hide private bugs if user doesn't have access 
to view them.
+                               if ( !$t_can_view_private && ( 
$t_result->fields['view_state'] == VS_PRIVATE ) ) {
+                                       continue;
+                               }
 
-                       if ( !helper_call_custom_function( 
'changelog_include_issue', array( $t_issue_id ) ) ) {
-                               continue;
-                       }
+                               # check limit_Reporter (Issue #4770)
+                               # reporters can view just issues they reported
+                               if ( ON === $t_limit_reporters && 
$t_user_access_level_is_reporter &&
+                                        !bug_is_user_reporter( 
$t_result->fields['id'], $t_user_id )) {
+                                 continue;
+                               }
 
-                       # Print the header for the version with the first 
changelog entry to be added.
-                       if ( $t_first_entry && !$t_version_header_printed ) {
-                               if ( $i > 0 ) {
-                                       echo '<br />';
+                               $t_issue_id = $t_result->fields['id'];
+
+                               if ( !helper_call_custom_function( 
'changelog_include_issue', array( $t_issue_id ) ) ) {
+                                       continue;
                                }
 
-                               print_version_header( $t_version_id );
+                               # Print the header for the version with the 
first changelog entry to be added.
+                               if ( $t_first_entry && 
!$t_version_header_printed ) {
+                                       if ( $i > 0 ) {
+                                               echo '<br />';
+                                       }
 
-                               $t_version_header_printed = true;
-                               $t_first_entry = false;
+                                       print_version_header( $t_version_id );
+
+                                       $t_version_header_printed = true;
+                                       $t_first_entry = false;
+                               }
+
+                               helper_call_custom_function( 
'changelog_print_issue', array( $t_issue_id ) );
                        }
 
-                       helper_call_custom_function( 'changelog_print_issue', 
array( $t_issue_id ) );
+                       $i++;
                }
 
-               $i++;
+               echo '</tt>';
+               $t_project_index++;
        }
 
-       echo '</tt>';
-
        html_page_bottom1( __FILE__ );
 ?>
\ No newline at end of file



-------------------------------------------------------
This SF.Net email is sponsored by: IntelliVIEW -- Interactive Reporting
Tool for open source databases. Create drag-&-drop reports. Save time
by over 75%! Publish reports on the web. Export to DOC, XLS, RTF, etc.
Download a FREE copy at http://www.intelliview.com/go/osdn_nl


<Prev in Thread] Current Thread [Next in Thread>