diff --git a/api/soap/mc_project_api.php b/api/soap/mc_project_api.php index 053d2dcc16..17f87582ce 100644 --- a/api/soap/mc_project_api.php +++ b/api/soap/mc_project_api.php @@ -834,9 +834,9 @@ function mci_custom_field_type_name( $p_type_id ) { * @return array The project versions. */ function mci_project_versions( $p_project_id ) { - # use null, null as the fastest way (no additional where clause in query) + # use VERSION_ALL, true as the fastest way (no additional where clause in query) # to get all released / non-released and obsolete / non-obsolete versions - $t_versions = version_get_all_rows( $p_project_id, null, null ); + $t_versions = version_get_all_rows( $p_project_id, VERSION_ALL, true ); $t_results = array(); foreach( $t_versions as $t_version ) { diff --git a/changelog_page.php b/changelog_page.php index 39b0916ee7..6fa8750b8a 100644 --- a/changelog_page.php +++ b/changelog_page.php @@ -245,7 +245,7 @@ function print_project_header_changelog( $p_project_name ) { $t_resolved = config_get( 'bug_resolved_status_threshold' ); # grab versions info for later use, excluding obsolete ones - $t_version_rows = version_get_all_rows( $t_project_id, null, false ); + $t_version_rows = version_get_all_rows( $t_project_id, VERSION_ALL, false ); # cache category info, but ignore the results for now category_get_all_rows( $t_project_id ); diff --git a/core/print_api.php b/core/print_api.php index 4340e0238c..6c83048eb2 100644 --- a/core/print_api.php +++ b/core/print_api.php @@ -852,17 +852,19 @@ function print_os_build_option_list( $p_os_build, $p_user_id = null ) { * * @param string $p_version The currently selected version. * @param integer|array|null $p_project_ids A project id, or array of ids, or null to use current project. - * @param integer $p_released Null to get all, 1: only released, 0: only future versions. - * @param boolean $p_leading_blank Allow selection of no version. + * @param integer $p_released One of VERSION_ALL, VERSION_FUTURE or VERSION_RELEASED + * to define which versions to include in the list (defaults to ALL). + * @param boolean $p_leading_blank Allow selection of no version. + * * @return void */ -function print_version_option_list( $p_version = '', $p_project_ids = null, $p_released = null, $p_leading_blank = true ) { +function print_version_option_list( $p_version = '', $p_project_ids = null, $p_released = VERSION_ALL, $p_leading_blank = true ) { if( null === $p_project_ids ) { $p_project_ids = helper_get_current_project(); } $t_project_ids = is_array( $p_project_ids ) ? $p_project_ids : array( $p_project_ids ); - $t_versions = version_get_all_rows( $t_project_ids, $p_released, null ); + $t_versions = version_get_all_rows( $t_project_ids, $p_released, true ); # Ensure the selected version (if specified) is included in the list # Note: Filter API specifies selected versions as an array diff --git a/core/version_api.php b/core/version_api.php index 1c972f4387..1015702702 100644 --- a/core/version_api.php +++ b/core/version_api.php @@ -492,7 +492,11 @@ function version_remove_all( $p_project_id ) { * Return all versions for the specified project or projects list * Returned versions are ordered by reverse 'date_order' * @param integer|array $p_project_ids A valid project id, or array of ids - * @param boolean $p_released Whether to include released versions. + * @param boolean $p_released Whether to show only released, unreleased, or both. + * For this parameter, use constants defined as: + * VERSION_ALL (null): returns any + * VERSION_FUTURE (false): returns only unreleased versions + * VERSION_RELEASED (true): returns only released versions * @param boolean $p_obsolete Whether to include obsolete versions. * @param boolean $p_inherit True to include versions from parent projects, * false not to, or null to use configuration @@ -530,7 +534,7 @@ function version_get_all_rows( $p_project_ids, $p_released = null, $p_obsolete = if( !empty( $g_cache_versions_project[$t_project_id]) ) { foreach( $g_cache_versions_project[$t_project_id] as $t_id ) { $t_version_row = version_cache_row( $t_id ); - if( $p_obsolete == false && (int)$t_version_row['obsolete'] == 1 ) { + if( $p_obsolete === false && (int)$t_version_row['obsolete'] == 1 ) { continue; } if( $p_released !== null ) { @@ -573,7 +577,7 @@ function version_get_id( $p_version, $p_project_id = null, $p_inherit = null ) { $c_project_id = (int)$p_project_id; } - $t_versions = version_get_all_rows( $c_project_id, null /* released: any */, true /* incl. obsolete */ , $p_inherit ); + $t_versions = version_get_all_rows( $c_project_id, VERSION_ALL, true /* incl. obsolete */ , $p_inherit ); foreach( $t_versions as $t_version ) { if( $t_version['version'] === $p_version ) { return $t_version['id']; diff --git a/manage_proj_edit_page.php b/manage_proj_edit_page.php index f59e49c5fc..7b02cdd2cb 100644 --- a/manage_proj_edit_page.php +++ b/manage_proj_edit_page.php @@ -492,7 +492,7 @@
0 ) { ?>
diff --git a/vendor/.htaccess b/vendor/.htaccess new file mode 100644 index 0000000000..d6d03c2802 --- /dev/null +++ b/vendor/.htaccess @@ -0,0 +1,12 @@ +## no access to this folder + +# Apache 2.4 + + Require all denied + + +# Apache 2.2 + + Order Allow,Deny + Deny from all + diff --git a/vendor/Web.config b/vendor/Web.config new file mode 100644 index 0000000000..a57a8c6a85 --- /dev/null +++ b/vendor/Web.config @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file