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: 5d6b1bb40ecf
Choose a base ref
...
head repository: mantisbt/mantisbt
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: c606f78dc81e
Choose a head ref
  • 5 commits
  • 18 files changed
  • 1 contributor

Commits on Mar 2, 2013

  1. PHPdoc updates

    mantis committed Mar 2, 2013
    Copy the full SHA
    6a0ebf0 View commit details
  2. Copy the full SHA
    f289ddf View commit details

Commits on Apr 4, 2013

  1. Copy the full SHA
    c43cd0f View commit details
  2. Copy the full SHA
    8d1091d View commit details
  3. Copy the full SHA
    c606f78 View commit details
1 change: 0 additions & 1 deletion config_defaults_inc.php
Original file line number Diff line number Diff line change
@@ -3390,7 +3390,6 @@

// Path Settings
'path',
'icon_path',
'short_path',
'absolute_path',
'core_path',
4 changes: 2 additions & 2 deletions core/classes/Locale/LocaleManager.php
Original file line number Diff line number Diff line change
@@ -40,7 +40,7 @@ public function setLocale($newLocales = null) {
if ($newLocales === null) {
if (!$_SERVER['HTTP_ACCEPT_LANGUAGE'])
throw new MantisBT\Exception\Locale\LocaleNotProvidedByUserAgent();
$newLocales = Locale::acceptFromHttp($_SERVER['HTTP_ACCEPT_LANGUAGE']);
$newLocales = LocaleManager::getParsedAcceptLanguageHeader();
}
$result = setlocale(LC_ALL, $newLocales);
if ($result === false) {
@@ -71,7 +71,7 @@ public function addTextDomain($textDomainName, $path) {
* @TODO: Cater for the "*" catch-all so we know with certainty whether
* the browser can accept any language as a fall back.
*/
public function getParsedAcceptLanguageHeader() {
public static function getParsedAcceptLanguageHeader() {
$languageTags = array();

/* Ensure that the browser has sent an Accept-Language header */
35 changes: 18 additions & 17 deletions core/classes/MantisBug.class.php
Original file line number Diff line number Diff line change
@@ -286,17 +286,17 @@ function bug_get_extended_row( $p_bug_id ) {
*/
function bug_get_row( $p_bug_id ) {
return $this->bug_cache_row( $p_bug_id );
}
}

/**
* Cache a bug row if necessary and return the cached copy
* @param array $p_bug_id id of bug to cache from mantis_bug_table
* @param array $p_trigger_errors set to true to trigger an error if the bug does not exist.
* @return bool|array returns an array representing the bug row if bug exists or false if bug does not exist
* @access public
* @uses database_api.php
/**
* Cache a bug row if necessary and return the cached copy
* @param array $p_bug_id id of bug to cache from mantis_bug_table
* @param array|bool $p_trigger_errors set to true to trigger an error if the bug does not exist.
* @throws MantisBT\Exception\Issue\IssueNotFound
*/
* @return bool|array returns an array representing the bug row if bug exists or false if bug does not exist
* @access public
* @uses database_api.php
*/
function bug_cache_row( $p_bug_id, $p_trigger_errors = false ) {
global $g_cache_bug;

@@ -594,14 +594,15 @@ function create() {
return $this->id;
}

/**
* Update a bug from the given data structure
* If the third parameter is true, also update the longer strings table
* @param bool $p_update_extended
* @param bool $p_bypass_email Default false, set to true to avoid generating emails (if sending elsewhere)
* @return bool (always true)
* @access public
*/
/**
* Update a bug from the given data structure
* If the third parameter is true, also update the longer strings table
* @param bool $p_update_extended
* @param bool $p_bypass_mail
* @internal param bool $p_bypass_email Default false, set to true to avoid generating emails (if sending elsewhere)
* @return bool (always true)
* @access public
*/
function update( $p_update_extended = false, $p_bypass_mail = false ) {
self::validate( $p_update_extended );

50 changes: 26 additions & 24 deletions core/classes/MantisDatabaseDict/MantisDatabaseDict.class.php
Original file line number Diff line number Diff line change
@@ -242,18 +242,19 @@ function AddColumnSQL($tabname, $flds)
}
return $sql;
}

/**
* Change the definition of one column
*
* As some DBM's can't do that on there own, you need to supply the complete defintion of the new table,
* to allow, recreating the table and copying the content over to the new table
* @param string $tabname table-name
* @param string $flds column-name and type for the changed column
* @param string $tableflds='' complete defintion of the new table, eg. for postgres, default ''
* @param array/string $tableoptions='' options for the new table see CreateTableSQL, default ''
* @return array with SQL strings
*/

/**
* Change the definition of one column
*
* As some DBM's can't do that on there own, you need to supply the complete defintion of the new table,
* to allow, recreating the table and copying the content over to the new table
* @param string $tabname table-name
* @param string $flds column-name and type for the changed column
* @param string $tableflds='' complete defintion of the new table, eg. for postgres, default ''
* @param string $tableoptions
* @internal param $array /string $tableoptions='' options for the new table see CreateTableSQL, default ''
* @return array with SQL strings
*/
function AlterColumnSQL($tabname, $flds, $tableflds='',$tableoptions='')
{
$tabname = $this->TableName ($tabname);
@@ -299,18 +300,19 @@ function RenameColumnSQL($tabname,$oldcolumn,$newcolumn,$flds='')
}
return array(sprintf($this->renameColumn,$tabname,$this->NameQuote($oldcolumn),$this->NameQuote($newcolumn),$column_def));
}

/**
* Drop one column
*
* Some DBM's can't do that on there own, you need to supply the complete defintion of the new table,
* to allow, recreating the table and copying the content over to the new table
* @param string $tabname table-name
* @param string $flds column-name and type for the changed column
* @param string $tableflds='' complete defintion of the new table, eg. for postgres, default ''
* @param array/string $tableoptions='' options for the new table see CreateTableSQL, default ''
* @return array with SQL strings
*/

/**
* Drop one column
*
* Some DBM's can't do that on there own, you need to supply the complete defintion of the new table,
* to allow, recreating the table and copying the content over to the new table
* @param string $tabname table-name
* @param string $flds column-name and type for the changed column
* @param string $tableflds='' complete defintion of the new table, eg. for postgres, default ''
* @param string $tableoptions
* @internal param $array /string $tableoptions='' options for the new table see CreateTableSQL, default ''
* @return array with SQL strings
*/
function DropColumnSQL($tabname, $flds, $tableflds='',$tableoptions='')
{
$tabname = $this->TableName ($tabname);
56 changes: 30 additions & 26 deletions core/classes/MantisUser.class.php
Original file line number Diff line number Diff line change
@@ -168,12 +168,13 @@ public static function getByArray($p_field, $p_values ) {

return $t_users;
}

/**
* Get MantisUser by username
* @param string $p_name user name
* @return MantisUser
*/

/**
* Get MantisUser by username
* @param string $p_name user name
* @throws MantisBT\Exception\User_By_UserName_Not_Found
* @return MantisUser
*/
public static function getByUserName($p_name) {
$t_row = self::GetFromDatabase( 'username', $p_name );
if ( $t_row === null ) {
@@ -186,11 +187,12 @@ public static function getByUserName($p_name) {
return $t_user;
}

/**
* Get MantisUser by cookiestring
* @param string $p_cookie cookie string
* @return MantisUser
*/
/**
* Get MantisUser by cookiestring
* @param string $p_cookie cookie string
* @throws MantisBT\Exception\User_By_Cookie_Not_Found
* @return MantisUser
*/
public static function getByCookieString($p_cookie) {
$t_row = self::GetFromDatabase( 'cookie_string', $p_cookie );
if ( $t_row === null ) {
@@ -203,11 +205,12 @@ public static function getByCookieString($p_cookie) {
return $t_user;
}

/**
* Get MantisUser by user id
* @param string $p_user_id user id
* @return MantisUser
*/
/**
* Get MantisUser by user id
* @param string $p_user_id user id
* @throws MantisBT\Exception\User_By_UserID_Not_Found
* @return MantisUser
*/
public static function getByUserID($p_user_id) {
$t_row = self::GetFromDatabase( 'id', $p_user_id );
if ( $t_row === null ) {
@@ -263,16 +266,17 @@ private static function GetFromDatabase( $p_field, $p_value ) {
return null;
}
}
}

/**
* Cache a user row if necessary and return the cached copy
* If the second parameter is true (default), trigger an error if the user can't be found.
* If the second parameter is false, return false if the user can't be found.
* @param int $p_user_id user id
* @param bool $p_trigger_errors trigger errors
* @return array
*/
}

/**
* Cache a user row if necessary and return the cached copy
* If the second parameter is true (default), trigger an error if the user can't be found.
* If the second parameter is false, return false if the user can't be found.
* @param int $p_user_id user id
* @param bool $p_trigger_errors trigger errors
* @throws MantisBT\Exception\User_By_ID_Not_Found
* @return array
*/
function user_cache_row( $p_user_id, $p_trigger_errors = true ) {
$t_query = 'SELECT * FROM {user} WHERE id=%d';
$t_result = db_query( $t_query, array( $p_user_id ) );
5 changes: 2 additions & 3 deletions core/compress_api.php
Original file line number Diff line number Diff line change
@@ -91,10 +91,9 @@ function compress_start_handler() {
# headers from being sent if there's a blank line in an included file
ob_start( 'compress_handler' );
} else if ( ini_get_bool( 'zlib.output_compression' ) == true ) {
if( defined( 'COMPRESSION_DISABLED' ) ) {
return;
if( !defined( 'COMPRESSION_DISABLED' ) ) {
ob_start();
}
ob_start();
}
}

2 changes: 1 addition & 1 deletion core/current_user_api.php
Original file line number Diff line number Diff line change
@@ -117,7 +117,7 @@ function current_user_set_pref( $p_pref_name, $p_pref_value ) {
* @access public
*/
function current_user_set_default_project( $p_project_id ) {
return user_set_default_project( auth_get_current_user_id(), $p_project_id );
user_set_default_project( auth_get_current_user_id(), $p_project_id );
}

/**
9 changes: 5 additions & 4 deletions core/event_api.php
Original file line number Diff line number Diff line change
@@ -73,9 +73,9 @@ function event_declare_many( $p_events ) {
* A plugin's basename must be specified for proper handling of plugin callbacks.
* @param string $p_name Event name
* @param string $p_callback Callback function
* @param string $p_plugin Plugin basename
* @access public
* @param int|string $p_plugin Plugin basename
* @throws MantisBT\Exception\Plugin\EventNotDeclared
* @access public
*/
function event_hook( $p_name, $p_callback, $p_plugin = 0 ) {
global $g_event_cache;
@@ -90,7 +90,7 @@ function event_hook( $p_name, $p_callback, $p_plugin = 0 ) {
/**
* Hook multiple callback functions to multiple events.
* @param array $p_hooks Event name/callback pairs
* @param string $p_plugin Plugin basename
* @param int|string $p_plugin Plugin basename
* @access public
*/
function event_hook_many( $p_hooks, $p_plugin = 0 ) {
@@ -222,8 +222,9 @@ function event_type_execute( $p_event, $p_callbacks, $p_params ) {
* return values will be echoed to the client, separated by a given string.
* If there are no callbacks, then nothing will be sent as output.
* @param string $p_event Event name
* @param array $p_callback Array of callback function/plugin base name key/value pairs
* @param $p_callbacks
* @param mixed $p_params Output separator (if single string) or indexed array of pre, mid, and post strings
* @internal param array $p_callback Array of callback function/plugin base name key/value pairs
* @access public
*/
function event_type_output( $p_event, $p_callbacks, $p_params = null ) {
2 changes: 2 additions & 0 deletions core/html_api.php
Original file line number Diff line number Diff line change
@@ -1671,6 +1671,8 @@ function html_buttons_view_bug_page( $p_bug ) {
/**
* get the css class name for the given status, user and project
* @param int $p_status
* @param null $p_user
* @param null $p_project
* @return string
*/
function html_get_status_css_class( $p_status, $p_user = null, $p_project = null ) {
1 change: 1 addition & 0 deletions core/icon_api.php
Original file line number Diff line number Diff line change
@@ -86,6 +86,7 @@ function print_sort_icon( $p_dir, $p_sort_by, $p_field ) {
$t_icon = 'down.png';
break;
case ASCENDING:
case 'ASC':
$t_icon = 'up.png';
break;
default:
6 changes: 3 additions & 3 deletions core/print_api.php
Original file line number Diff line number Diff line change
@@ -488,7 +488,7 @@ function print_news_string_by_news_id( $p_news_id ) {

/**
* Print User option list for assigned to field
* @param int $p_user_id user id
* @param int|string $p_user_id user id
* @param int $p_project_id project id
* @param int $p_threshold access level
*/
@@ -503,10 +503,10 @@ function print_assign_to_option_list( $p_user_id = '', $p_project_id = null, $p_
/**
* List projects that the current user has access to.
*
* @param integer $p_project_id The current project id or null to use cookie.
* @param integer $p_project_id The current project id or null to use cookie.
* @param bool $p_include_all_projects true: include "All Projects", otherwise false.
* @param mixed $p_filter_project_id The id of a project to exclude or null.
* @param string $p_trace The current project trace, identifies the sub-project via a path from top to bottom.
* @param bool|string $p_trace The current project trace, identifies the sub-project via a path from top to bottom.
* @return void
*/
function print_project_option_list( $p_project_id = null, $p_include_all_projects = true, $p_filter_project_id = null, $p_trace = false ) {
6 changes: 4 additions & 2 deletions core/project_api.php
Original file line number Diff line number Diff line change
@@ -263,8 +263,9 @@ function project_includes_user( $p_project_id, $p_user_id ) {
* @param int $p_view_state view state
* @param string $p_file_path file path
* @param bool $p_enabled enabled
* @param bool $p_inherit_globals inherit globals
* @param bool $p_inherit_global
* @throws MantisBT\Exception\Project\ProjectNameNotValid
* @internal param bool $p_inherit_globals inherit globals
* @return int
*/
function project_create( $p_name, $p_description, $p_status, $p_view_state = VS_PUBLIC, $p_file_path = '', $p_enabled = true, $p_inherit_global = true ) {
@@ -354,8 +355,9 @@ function project_delete( $p_project_id ) {
* @param int $p_view_state view state
* @param string $p_file_path file path
* @param bool $p_enabled enabled
* @param bool $p_inherit_globals inherit globals
* @param $p_inherit_global
* @throws MantisBT\Exception\Project\ProjectNameNotValid
* @internal param bool $p_inherit_globals inherit globals
* @return bool
*/
function project_update( $p_project_id, $p_name, $p_description, $p_status, $p_view_state, $p_file_path, $p_enabled, $p_inherit_global ) {
6 changes: 5 additions & 1 deletion core/user_api.php
Original file line number Diff line number Diff line change
@@ -74,6 +74,7 @@ function user_cache_array_rows( $p_user_id_array ) {
*
* @param int $p_user_id User ID
* @return bool
* @throws MantisBT\Exception\User_By_UserID_Not_Found
*/
function user_exists( $p_user_id ) {
try {
@@ -89,6 +90,7 @@ function user_exists( $p_user_id ) {
* if the user does not exist, throw a user not found exception
*
* @param int $p_user_id User ID
* @throws MantisBT\Exception\User_By_ID_Not_Found
*/
function user_ensure_exists( $p_user_id ) {
if ( !user_exists( $p_user_id ) ) {
@@ -153,6 +155,7 @@ function user_is_realname_unique( $p_username, $p_realname ) {
*
* @param string $p_username username
* @param string $p_realname realname
* @throws MantisBT\Exception\User_Real_Match_User
*/
function user_ensure_realname_unique( $p_username, $p_realname ) {
if( 1 > user_is_realname_unique( $p_username, $p_realname ) ) {
@@ -418,8 +421,9 @@ function user_get_row( $p_user_id ) {
*
* @param int $p_user_id User ID
* @param string $p_field_name Field Name
* @return string
* @throws MantisBT\Exception\User_By_UserID_Not_Found
* @throws MantisBT\Exception\Database\FieldNotFound
* @return string
*/
function user_get_field( $p_user_id, $p_field_name ) {
if( NO_USER == $p_user_id ) {
3 changes: 1 addition & 2 deletions core/utility_api.php
Original file line number Diff line number Diff line change
@@ -105,9 +105,8 @@ function ini_get_bool( $p_name ) {
return true;
break;
}
} else {
return (bool) $t_result;
}
return (bool) $t_result;
}

/**
2 changes: 1 addition & 1 deletion javascript_config.php
Original file line number Diff line number Diff line change
@@ -60,5 +60,5 @@ function print_config_value( $p_config_key ) {

echo "var config = new Array();\n";
print_config_value( 'calendar_js_date_format' );
print_config_value( 'icon_path' );
print_config_value( 'short_path' );
print_config_value( 'theme' );
Loading