Skip to content
Permalink
Browse files

Use VERSION_xxx constants for $p_released param

When calling version_get_all_rows(), use defined constants instead of
relying on true, false or null.

Issue #25661
  • Loading branch information...
dregad committed Apr 18, 2019
1 parent acdadb8 commit ca5545cca53b595e5e2a350d47f4e2c6dcc795ed
Showing with 10 additions and 8 deletions.
  1. +2 −2 api/soap/mc_project_api.php
  2. +1 −1 changelog_page.php
  3. +5 −3 core/print_api.php
  4. +1 −1 core/version_api.php
  5. +1 −1 manage_proj_edit_page.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, true 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, true );
$t_versions = version_get_all_rows( $p_project_id, VERSION_ALL, true );
$t_results = array();
foreach( $t_versions as $t_version ) {
@@ -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 );
@@ -852,11 +852,13 @@ 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();
}
@@ -577,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'];
@@ -492,7 +492,7 @@
<div class="widget-body">
<div class="widget-main no-padding">
<?php
$t_versions = version_get_all_rows( $f_project_id, null, true );
$t_versions = version_get_all_rows( $f_project_id, VERSION_ALL, true );
if( count( $t_versions ) > 0 ) { ?>
<div class="table-responsive">
<table id="versions" class="table table-striped table-bordered table-condensed">

0 comments on commit ca5545c

Please sign in to comment.
You can’t perform that action at this time.