Skip to content
Browse files

Fixes #17411, #17412 for empty changelog/roadmap

This change provides the user with a message that explains why the change log or roadmap pages are empty.

- Changelog message wasn't explaining what is going on.
- Changelog message wasn't showing when there were no issues, only when there were no projects.
- Changelog message formatting was using page title style.
- Roadmap had no messages.
- Roadmap had a variable to check usage that wasn't being used.

Now we show a different message based on whether the user is manager (hence can create versions)
or a regular user.

Conflicts:
	changelog_page.php
  • Loading branch information...
1 parent ccd78ba commit 3a4ae91ec1db7030d4067e69d0f8b9f082dca984 @vboctor vboctor committed Jun 29, 2014
Showing with 32 additions and 9 deletions.
  1. +14 −6 changelog_page.php
  2. +3 −0 lang/strings_english.txt
  3. +15 −3 roadmap_page.php
View
20 changelog_page.php
@@ -108,6 +108,7 @@ function print_project_header_changelog ( $p_project_name ) {
echo '<tt>';
}
+$t_issues_found = false;
$t_user_id = auth_get_current_user_id();
$f_project = gpc_get_string( 'project', '' );
@@ -173,9 +174,9 @@ function print_project_header_changelog ( $p_project_name ) {
array_unshift( $t_project_ids, $t_project_id );
}
-html_page_top( lang_get( 'changelog' ) );
+$t_project_id_for_access_check = $t_project_id;
-$t_project_index = 0;
+html_page_top( lang_get( 'changelog' ) );
version_cache_array_rows( $t_project_ids );
category_cache_array_rows_by_project( $t_project_ids );
@@ -335,6 +336,8 @@ function print_project_header_changelog ( $p_project_name ) {
$t_issue_set_level = $t_issue_set_levels[$j];
helper_call_custom_function( 'changelog_print_issue', array( $t_issue_set_id, $t_issue_set_level ) );
+
+ $t_issues_found = true;
}
$t_bug_string = $t_issues_resolved == 1 ? 'bug' : 'bugs';
@@ -344,11 +347,16 @@ function print_project_header_changelog ( $p_project_name ) {
if( $t_project_header_printed ) {
echo '</tt>';
}
-
- $t_project_index++;
}
-if( $t_project_index == 0 ) {
- echo '<br /><span class="pagetitle">' . lang_get('changelog_empty') . '</span>';
+if( !$t_issues_found ) {
+ if( access_has_project_level( config_get( 'manage_project_threshold' ), $t_project_id_for_access_check ) ) {
+ $t_string = 'changelog_empty_manager';
+ } else {
+ $t_string = 'changelog_empty';
+ }
+
+ echo '<p>' . lang_get( $t_string ) . '</p>';
}
+
html_page_bottom();
View
3 lang/strings_english.txt
@@ -1328,10 +1328,13 @@ $s_sponsorship_process_url = '';
# Changelog
$s_changelog = 'Change Log';
$s_changelog_empty = 'No Change Log information available';
+$s_changelog_empty_manager = 'No Change Log information available. Issues are included once projects have versions and issues are resolved with "fixed in version" set.';
# Roadmap
$s_roadmap = 'Roadmap';
$s_resolved_progress = '%1$d of %2$d issue(s) resolved. Progress (%3$d%%).';
+$s_roadmap_empty = 'No Roadmap information available';
+$s_roadmap_empty_manager = 'No Roadmap information available. Issues are included once projects have versions and issues have "target version" set.';
# Http auth
$s_http_auth_realm = 'MantisBT Login';
View
18 roadmap_page.php
@@ -104,6 +104,8 @@ function print_project_header_roadmap( $p_project_name ) {
echo '<br /><span class="pagetitle">', string_display( $p_project_name ), ' - ', lang_get( 'roadmap' ), '</span><br />';
}
+$t_issues_found = false;
+
$t_user_id = auth_get_current_user_id();
$f_project = gpc_get_string( 'project', '' );
@@ -169,9 +171,9 @@ function print_project_header_roadmap( $p_project_name ) {
array_unshift( $t_project_ids, $t_project_id );
}
-html_page_top( lang_get( 'roadmap' ) );
+$t_project_id_for_access_check = $t_project_id;
-$t_project_index = 0;
+html_page_top( lang_get( 'roadmap' ) );
version_cache_array_rows( $t_project_ids );
category_cache_array_rows_by_project( $t_project_ids );
@@ -350,6 +352,8 @@ function print_project_header_roadmap( $p_project_name ) {
$t_issue_set_level = $t_issue_set_levels[$j];
helper_call_custom_function( 'roadmap_print_issue', array( $t_issue_set_id, $t_issue_set_level ) );
+
+ $t_issues_found = true;
}
if( $t_issues_planned > 0 ) {
@@ -358,8 +362,16 @@ function print_project_header_roadmap( $p_project_name ) {
echo '<br /></tt>';
}
}
+}
+
+if( !$t_issues_found ) {
+ if( access_has_project_level( config_get( 'manage_project_threshold' ), $t_project_id_for_access_check ) ) {
+ $t_string = 'roadmap_empty_manager';
+ } else {
+ $t_string = 'roadmap_empty';
+ }
- $t_project_index++;
+ echo '<p>' . lang_get( $t_string ) . '</p>';
}
html_page_bottom();

0 comments on commit 3a4ae91

Please sign in to comment.
Something went wrong with that request. Please try again.