Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: mantisbt/mantisbt
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: ac7effb4aa59
Choose a base ref
...
head repository: mantisbt/mantisbt
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: cfa022bc1c7d
Choose a head ref
  • 3 commits
  • 3 files changed
  • 2 contributors

Commits on Sep 10, 2012

  1. Hide file upload path on project edit page if storage is DB

    The upload_file_path config option is not needed when attachments are
    stored in DB, and displaying it is confusing to user.
    
    Fixes #14700
    
    Original patch updated to comply with coding guidelines
    
    Signed-off-by: Damien Regad <damien.regad@merckgroup.com>
    JGuilbaud authored and dregad committed Sep 10, 2012

    Verified

    This commit was signed with the committer’s verified signature.
    jtojnar Jan Tojnar
    Copy the full SHA
    b6e9022 View commit details
  2. Missing project override in project edit page

    This is causing the config_get() calls to return the option for the
    default project instead of the one being edited, which is potentially
    incorrect.
    
    Fixes #14701
    dregad committed Sep 10, 2012

    Verified

    This commit was signed with the committer’s verified signature.
    jtojnar Jan Tojnar
    Copy the full SHA
    87c7423 View commit details
  3. User with access to single project defaults to it, not all projects

    Since 1.2, if a user has access to only one project, the project
    selection box at top right isn't shown. This was causing issues as new
    users accounts have 'All projects' as their default:
    
     - user can't report issues (no link for all projects)
     - categories displayed are prefixed with [project]
    
    Until this commit, users had to define their (single) project as default
    using preferences to work around the problem; this is no longer needed.
    
    Function html_login_info() now sets the current project as appropriate
    if user has only access to a single one, and also defines that as the
    default.
    
    The account preferences page has also been modified to only include 'All
    projects' in the selection list when user has more than one project
    available.
    
    Fixes #9826, #14268
    dregad committed Sep 10, 2012

    Verified

    This commit was signed with the committer’s verified signature.
    vcunat Vladimír Čunát
    Copy the full SHA
    cfa022b View commit details
Showing with 23 additions and 7 deletions.
  1. +10 −1 account_prefs_inc.php
  2. +11 −5 core/html_api.php
  3. +2 −1 manage_proj_edit_page.php
11 changes: 10 additions & 1 deletion account_prefs_inc.php
Original file line number Diff line number Diff line change
@@ -92,7 +92,16 @@ function edit_account_prefs($p_user_id = null, $p_error_if_protected = true, $p_
<label for="default-project-id"><span><?php echo lang_get( 'default_project' ) ?></span></label>
<span class="select">
<select id="default-project-id" name="default_project">
<?php print_project_option_list( (int)$t_pref->default_project ) ?>
<?php
# Count number of available projects
$t_projects = current_user_get_accessible_projects();
$t_num_proj = count( $t_projects );
if( $t_num_proj == 1 ) {
$t_num_proj += count( current_user_get_accessible_subprojects( $t_projects[0] ) );
}
# Only display "All projects" in selection list if there is more than 1
print_project_option_list( (int)$t_pref->default_project, $t_num_proj > 1 );
?>
</select>
</span>
<span class="label-style"></span>
16 changes: 11 additions & 5 deletions core/html_api.php
Original file line number Diff line number Diff line change
@@ -544,12 +544,10 @@ function html_login_info() {
}
echo '</div>';


# Project Selector hidden if only one project visisble to user
$t_show_project_selector = true;
if( count( current_user_get_accessible_projects() ) == 1 ) {

// >1
$t_project_ids = current_user_get_accessible_projects();
$t_project_ids = current_user_get_accessible_projects();
if( count( $t_project_ids ) == 1 ) {
$t_project_id = (int) $t_project_ids[0];
if( count( current_user_get_accessible_subprojects( $t_project_id ) ) == 0 ) {
$t_show_project_selector = false;
@@ -579,6 +577,14 @@ function html_login_info() {
echo '</form>';
echo '<div id="current-time">' . $t_now . '</div>';
} else {
# User has only one project, set it as both current and default
if( ALL_PROJECTS == helper_get_current_project() ) {
helper_set_current_project( $t_project_id );
current_user_set_default_project( $t_project_id );
# Force reload of current page
$t_redirect_url = str_replace( config_get( 'short_path' ), '', $_SERVER['REQUEST_URI'] );
html_meta_redirect( $t_redirect_url, 0, false );
}
echo '<div id="current-time-centered">' . $t_now . '</div>';
}
}
3 changes: 2 additions & 1 deletion manage_proj_edit_page.php
Original file line number Diff line number Diff line change
@@ -78,6 +78,7 @@
$f_show_global_users = gpc_get_bool( 'show_global_users' );

project_ensure_exists( $f_project_id );
$g_project_override = $f_project_id;
access_ensure_project_level( config_get( 'manage_project_threshold' ), $f_project_id );

$row = project_get_row( $f_project_id );
@@ -130,7 +131,7 @@
<span class="label-style"></span>
</div>
<?php
if ( file_is_uploading_enabled() ) { ?>
if ( file_is_uploading_enabled() && DATABASE !== config_get( 'file_upload_method' ) ) { ?>
<div class="field-container <?php echo helper_alternate_class_no_attribute(); ?>">
<label for="project-file-path"><span><?php echo lang_get( 'upload_file_path' ) ?></span></label>
<?php