Skip to content

Commit

Permalink
Merge tag 'release-1.2.12' into oracle
Browse files Browse the repository at this point in the history
Conflicts:
	core/file_api.php
  • Loading branch information
dregad committed Nov 16, 2012
2 parents e7625d7 + 9c78ca8 commit 3501189
Show file tree
Hide file tree
Showing 186 changed files with 4,604 additions and 2,983 deletions.
29 changes: 29 additions & 0 deletions .mailmap
@@ -0,0 +1,29 @@
Adrian Spinei <aspinei@users.sourceforge.net> aspinei
André Eisenbach <int2str@users.sourceforge.net> int2str
Bastian Pfenningschmidt <bpfennigschmidt@users.sourceforge.net> bpfennigschmidt
Damien Regad <dr_mantis@regad.org> <damien.regad@merckgroup.com>
Damien Regad <dr_mantis@regad.org> <damien.regad@merckserono.net>
David Hicks <d@hx.id.au> <hickseydr@optusnet.com.au>
David Newcomb <davidnewcomb@users.sourceforge.net> davidnewcomb
Frank Rodgers <frodgers@redcom.com> <frodgers@iowa.redcom.com>
Jim Hanley <dgtlrift@users.sourceforge.net> dgtlrift
Johan Guilbaud <git@lapinkiller.fr>
Johan Guilbaud <git@lapinkiller.fr> Lapinkiller <lapinkiller@hotmail.fr>
John Reese <john@noswap.com> <jreese@leetcode.net>
Kornel Lesinski <kornel@aardvarkmedia.co.uk>
Lincoln Maskey <narcissus@users.sourceforge.net> narcissus
Marcello Scata <marcelloscata@users.sourceforge.net> masc
Michael Lorer <info@01-scripts.de>
Paul Richards <paul@mantisforge.org> Paul
Paul Richards <paul@mantisforge.org> <Paul@.(none)>
Paul Richards <paul@mantisforge.org> root <root@paul.shroudbox.com>
Robert Munteanu <robert@lmn.ro> <robert.munteanu@gmail.com>
Robert Munteanu <robert@lmn.ro> <robert.munteanu@sdc.ro>
Siebrand Mazeland <s.mazeland@xs4all.nl>
Siebrand Mazeland <s.mazeland@xs4all.nl> git <Administrator@.(none)>
Siebrand Mazeland <s.mazeland@xs4all.nl> unknown <Administrator@.(none)>
Stéphane Veyret <sveyret@axway.com>
Tarik Sedlarevic <tazza70@users.sourceforge.net> tazza70
Véronique Maginot <veronique.maginot@credit-agricole-sa.fr>
Victor Boctor <vboctor@gmail.com> root <root@localhost.localdomain>
Victor Boctor <vboctor@gmail.com> <vboctor@new-host-3.home>
11 changes: 10 additions & 1 deletion account_prefs_inc.php
Expand Up @@ -75,7 +75,16 @@ function edit_account_prefs($p_user_id = null, $p_error_if_protected = true, $p_
</td>
<td width="50%">
<select name="default_project">
<?php print_project_option_list( $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( $t_pref->default_project, $t_num_proj > 1 );
?>
</select>
</td>
</tr>
Expand Down
13 changes: 11 additions & 2 deletions admin/check.php
Expand Up @@ -243,13 +243,22 @@ function test_database_utf8() {
# ADOConnection::Version() is broken as it treats v5.1 the same as v5.10
# Therefore we must extract the correct version ourselves
# Upstream bug report: http://phplens.com/lens/lensforum/msgs.php?id=18320
# This bug has been fixed in ADOdb 5.11 (May 5, 2010) but we still
# need to use the backwards compatible approach to detect ADOdb <5.11.
if( preg_match( '/^[Vv]([0-9\.]+)/', $ADODB_vers, $t_matches ) == 1 ) {
$t_adodb_version_check_ok = version_compare( $t_matches[1], '5.10', '>=' );
}
}
print_test_warn_row( 'Checking adodb version...', $t_adodb_version_check_ok, $ADODB_vers );
print_test_warn_row( 'Checking ADOdb version...', $t_adodb_version_check_ok, $ADODB_vers );

print_test_row('Checking using bundled adodb with some drivers...', !(db_is_pgsql() || db_is_mssql() || db_is_db2()) || strstr($ADODB_vers, 'MantisBT Version') !== false );
# Making sure we're not using the ADOdb extension (see #14552)
print_test_row(
'Checking use of the <a href="http://adodb.sourceforge.net/#extension">ADOdb extension</a>',
!extension_loaded( 'ADOdb' ),
"The 'ADOdb' extension is not supported and must be disabled"
);

print_test_row( 'Checking using bundled ADOdb with some drivers...', !(db_is_pgsql() || db_is_mssql() || db_is_db2()) || strstr($ADODB_vers, 'MantisBT Version') !== false );
$t_serverinfo = $g_db->ServerInfo();

print_info_row( 'Database Type (adodb)', $g_db->databaseType );
Expand Down
9 changes: 7 additions & 2 deletions admin/email_queue.php
Expand Up @@ -38,7 +38,7 @@
echo "Sending or deleting emails...<br />";
email_send_all(true);
echo "Done";

} else {
$t_email_data = email_queue_get( (int) $f_to );

Expand All @@ -65,7 +65,12 @@
foreach( $t_ids as $t_id ) {
$row = email_queue_get( $t_id );

echo '<tr><td>' . $row->email_id . '</td><td>' . $row->email . '</td><td>' . $row->submitted . '</td><td>' , html_button( 'email_queue.php', 'Send Or Delete', array( 'send' => $row->email_id ) ) , '</td></tr>';
echo '<tr><td>'
. $row->email_id . '</td><td>'
. $row->email . '</td><td>'
. date( config_get( 'complete_date_format' ), $row->submitted ) . '</td><td>'
, html_button( 'email_queue.php', 'Send Or Delete', array( 'send' => $row->email_id ) )
, '</td></tr>';
}
echo '</table>';
} else {
Expand Down
14 changes: 9 additions & 5 deletions admin/install.php
Expand Up @@ -382,9 +382,13 @@ function InsertData( $p_table, $p_data ) {
$t_error = 'MySQL 4.1.0 or later is required for installation.';
}
break;
case 'pgsql':
case 'mssql':
case 'mssqlnative':
if( version_compare( $t_version_info['version'], '9.0.0', '<' ) ) {
$t_error = 'SQL Server 2005 or later is required for installation.';
}
break;
case 'pgsql':
case 'db2':
default:
break;
Expand Down Expand Up @@ -528,7 +532,7 @@ function InsertData( $p_table, $p_data ) {
Attempt Installation
</td>
<td>
<input name="go" type="submit" value="Install/Upgrade Database"></input>
<input name="go" type="submit" class="button" value="Install/Upgrade Database"></input>
</td>
</tr>
<input name="install" type="hidden" value="2"></input>
Expand Down Expand Up @@ -593,7 +597,7 @@ function InsertData( $p_table, $p_data ) {
}
} else {
$sqlarray = $dict->CreateDatabase( $f_database_name, Array( 'mysql' => 'DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_general_ci' ) );
$ret = $dict->ExecuteSQLArray( $sqlarray );
$ret = $dict->ExecuteSQLArray( $sqlarray, false );
if( $ret == 2 ) {
print_test_result( GOOD );
$t_db_open = true;
Expand Down Expand Up @@ -747,7 +751,7 @@ function InsertData( $p_table, $p_data ) {
} else {
echo 'Schema ' . $upgrade[$i][0] . ' ( ' . $t_target . ' )</td>';
if( $t_sql ) {
$ret = $dict->ExecuteSQLArray( $sqlarray );
$ret = $dict->ExecuteSQLArray( $sqlarray, false );
} else {
if( isset( $sqlarray[1] ) ) {
$ret = call_user_func( 'install_' . $sqlarray[0], $sqlarray[1] );
Expand Down Expand Up @@ -1041,8 +1045,8 @@ function InsertData( $p_table, $p_data ) {
<input name="admin_username" type="hidden" value="<?php echo $f_admin_username?>"></input>
<input name="admin_password" type="hidden" value="<?php echo $f_admin_password?>"></input>
<input name="log_queries" type="hidden" value="<?php echo( $f_log_queries ? 1 : 0 )?>"></input>
<input name="retry" type="submit" value="Retry"></input>
<input name="db_exists" type="hidden" value="<?php echo( $f_db_exists ? 1 : 0 )?>"></input>
<input name="retry" type="submit" class="button" value="Retry"></input>
</td>
</tr>
</table>
Expand Down
70 changes: 33 additions & 37 deletions admin/install_functions.php
Expand Up @@ -23,23 +23,38 @@
* @link http://www.mantisbt.org
*/

/**
* Set the value of $g_db_log_queries as specified
* This is used by install callback functions to ensure that only the relevant
* queries are logged
* @global int $g_db_log_queries
* @param int $p_new_state new value to set $g_db_log_queries to (defaults to OFF)
* @return int old value of $g_db_log_queries
*/
function install_set_log_queries( $p_new_state = OFF ) {
global $g_db_log_queries;

$t_log_queries = $g_db_log_queries;

if ( $g_db_log_queries !== $p_new_state ) {
$g_db_log_queries = $p_new_state;
}

# Return the old value of $g_db_log_queries
return $t_log_queries;
}

/**
* Migrate the legacy category data to the new category_id-based schema.
*/
function install_category_migrate() {
global $g_db_log_queries;

$t_bug_table = db_get_table( 'mantis_bug_table' );
$t_category_table = db_get_table( 'mantis_category_table' );
$t_project_category_table = db_get_table( 'mantis_project_category_table' );

// disable query logging (even if it's enabled in config for this)
if ( $g_db_log_queries !== 0 ) {
$t_log_queries = $g_db_log_queries;
$g_db_log_queries = 0;
} else {
$t_log_queries = null;
}
# Disable query logging even if enabled in config, due to possibility of mass spam
$t_log_queries = install_set_log_queries();

$query = "SELECT project_id, category, user_id FROM $t_project_category_table ORDER BY project_id, category";
$t_category_result = db_query_bound( $query );
Expand Down Expand Up @@ -87,26 +102,18 @@ function install_category_migrate() {
}
}

// re-enabled query logging if we disabled it
if ( $t_log_queries !== null ) {
$g_db_log_queries = $t_log_queries;
}
# Re-enable query logging if we disabled it
install_set_log_queries( $t_log_queries );

# return 2 because that's what ADOdb/DataDict does when things happen properly
return 2;
}

function install_date_migrate( $p_data) {
// $p_data[0] = tablename, [1] id column, [2] = old column, [3] = new column
global $g_db_log_queries;

// disable query logging (even if it's enabled in config for this)
if ( $g_db_log_queries !== 0 ) {
$t_log_queries = $g_db_log_queries;
$g_db_log_queries = 0;
} else {
$t_log_queries = null;
}
# Disable query logging even if enabled in config, due to possibility of mass spam
$t_log_queries = install_set_log_queries();

$t_table = db_get_table( $p_data[0] );
$t_id_column = $p_data[1];
Expand Down Expand Up @@ -179,10 +186,8 @@ function install_date_migrate( $p_data) {
db_query_bound( $query, $t_values );
}

// re-enabled query logging if we disabled it
if ( $t_log_queries !== null ) {
$g_db_log_queries = $t_log_queries;
}
# Re-enable query logging if we disabled it
install_set_log_queries( $t_log_queries );

# return 2 because that's what ADOdb/DataDict does when things happen properly
return 2;
Expand All @@ -198,15 +203,8 @@ function install_date_migrate( $p_data) {
* one possible value that can be assigned to a radio field.
*/
function install_correct_multiselect_custom_fields_db_format() {
global $g_db_log_queries;

# Disable query logging due to possibility of mass spam.
if ( $g_db_log_queries !== 0 ) {
$t_log_queries = $g_db_log_queries;
$g_db_log_queries = 0;
} else {
$t_log_queries = null;
}
# Disable query logging even if enabled in config, due to possibility of mass spam
$t_log_queries = install_set_log_queries();

$t_value_table = db_get_table( 'mantis_custom_field_string_table' );
$t_field_table = db_get_table( 'mantis_custom_field_table' );
Expand Down Expand Up @@ -252,10 +250,8 @@ function install_correct_multiselect_custom_fields_db_format() {
$t_update_result = db_query_bound( $t_update_query );
}

# Re-enable query logging if we disabled it.
if ( $t_log_queries !== null ) {
$g_db_log_queries = $t_log_queries;
}
# Re-enable query logging if we disabled it
install_set_log_queries( $t_log_queries );

# Return 2 because that's what ADOdb/DataDict does when things happen properly
return 2;
Expand Down
2 changes: 1 addition & 1 deletion admin/test_email.php
Expand Up @@ -66,7 +66,7 @@
?>
<form method="post" action="<?php echo $_SERVER['SCRIPT_NAME']?>#email">
Email Address: <?php echo config_get_global( 'administrator_email' );?><br />
<input type="submit" value="Send Mail" name="mail_test" />
<input type="submit" class="button" value="Send Mail" name="mail_test" />
</form>
</td>
</tr>
Expand Down
36 changes: 32 additions & 4 deletions api/soap/mantisconnect.php
Expand Up @@ -94,6 +94,20 @@
)
);

### UserData
$l_oServer->wsdl->addComplexType(
'UserData',
'complexType',
'struct',
'all',
'',
array(
'account_data' => array( 'name' => 'account_data', 'type' => 'tns:AccountData', 'minOccurs' => '0'),
'access_level' => array( 'name' => 'global_access_level', 'type' => 'xsd:integer', 'minOccurs' => '0'),
'timezone' => array( 'name' => 'timezone', 'type' => 'xsd:string', 'minOccurs' => '0'),
)
);

### AccountDataArray
$l_oServer->wsdl->addComplexType(
'AccountDataArray',
Expand Down Expand Up @@ -664,6 +678,20 @@
### PUBLIC METHODS (defined in mc_enum_api.php)
###

### mc_login
$l_oServer->register( 'mc_login',
array(
'username' => 'xsd:string',
'password' => 'xsd:string'
),
array(
'return' => 'tns:UserData'
),
$t_namespace,
false, false, false,
'Log the user in and get their information.'
);

### mc_enum_status
$l_oServer->register( 'mc_enum_status',
array(
Expand Down Expand Up @@ -1178,7 +1206,7 @@
),
$t_namespace,
false, false, false,
'Get the issues that match the specified project id and paging details.'
'Get the issues that match the specified project id and paging details. Pass "-1" for the per_page parameter to get all issues.'
);

### mc_project_get_issue_headers
Expand All @@ -1195,7 +1223,7 @@
),
$t_namespace,
false, false, false,
'Get the issue headers that match the specified project id and paging details.'
'Get the issue headers that match the specified project id and paging details. Pass "-1" for the per_page parameter to get all issues.'
);

### mc_project_get_users
Expand Down Expand Up @@ -1516,7 +1544,7 @@
),
$t_namespace,
false, false, false,
'Get the issues that match the specified filter and paging details.'
'Get the issues that match the specified filter and paging details. Pass "-1" for the per_page parameter to get all issues.'
);

### mc_filter_get_issue_headers
Expand All @@ -1534,7 +1562,7 @@
),
$t_namespace,
false, false, false,
'Get the issue headers that match the specified filter and paging details.'
'Get the issue headers that match the specified filter and paging details. Pass "-1" for the per_page parameter to get all issues.'
);

### mc_config_get_string
Expand Down

0 comments on commit 3501189

Please sign in to comment.