Skip to content

Commit

Permalink
Issue #11732: Remove built-in source code integration support
Browse files Browse the repository at this point in the history
The built-in source code integration support is old, restrictive and not
actively maintained. The far superior SourceIntegration plugin
provides the same functionality and much more (in a modular fashion).
  • Loading branch information
davidhicks committed Mar 31, 2010
1 parent 4eb5d9a commit 9527e0e
Show file tree
Hide file tree
Showing 71 changed files with 21 additions and 414 deletions.
17 changes: 0 additions & 17 deletions api/soap/mantisconnect.php
Expand Up @@ -1316,23 +1316,6 @@
'Get the value for the specified configuration variable.'
);

### mc_issue_checkin
$l_oServer->register( 'mc_issue_checkin',
array(
'username' => 'xsd:string',
'password' => 'xsd:string',
'issue_id' => 'xsd:integer',
'comment' => 'xsd:string',
'fixed' => 'xsd:boolean'
),
array(
'return' => 'xsd:boolean'
),
$t_namespace,
false, false, false,
'Notifies MantisBT of a check-in for the issue with the specified id.'
);

###
### IMPLEMENTATION
###
Expand Down
30 changes: 0 additions & 30 deletions api/soap/mc_issue_api.php
Expand Up @@ -1048,36 +1048,6 @@ function mc_issue_relationship_delete( $p_username, $p_password, $p_issue_id, $p
return true;
}

/**
* Log a checkin event on the issue
*
* @param string $p_username The name of the user trying to access the issue.
* @param string $p_password The password of the user.
* @param integer $p_issue_id The id of the issue to log a checkin.
* @param string $p_comment The comment to add
* @param boolean $p_fixed True if the issue is to be set to fixed
* @return boolean true success, false otherwise.
*/
function mc_issue_checkin( $p_username, $p_password, $p_issue_id, $p_comment, $p_fixed ) {
$t_user_id = mci_check_login( $p_username, $p_password );
if( $t_user_id === false ) {
return mci_soap_fault_login_failed();
}

if( !bug_exists( $p_issue_id ) ) {
return new soap_fault( 'Client', '', "Issue '$p_issue_id' not found." );
}

$t_project_id = bug_get_field( $p_issue_id, 'project_id' );
if( !mci_has_readwrite_access( $t_user_id, $t_project_id ) ) {
return mci_soap_fault_access_denied( $t_user_id );
}

helper_call_custom_function( 'checkin', array( $p_issue_id, $p_comment, '', '', $p_fixed ) );

return true;
}

/**
* Returns the date in iso8601 format, with proper timezone offset applied
*
Expand Down
55 changes: 0 additions & 55 deletions config_defaults_inc.php
Expand Up @@ -2711,61 +2711,6 @@
*/
$g_anonymous_account = '';

/**
* CVS linking
* insert the URL to your CVSweb or ViewCVS
* eg: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/mantisbt/mantisbt/
* @global string $g_cvs_web
*/
$g_cvs_web = '';

/**
* For open source projects it is expected that the notes be public, however,
* for non-open source it will probably be VS_PRIVATE.
* @global int $g_source_control_notes_view_status
*/
$g_source_control_notes_view_status = VS_PRIVATE;

/**
* Account to be used by the source control script. The account must be enabled
* and must have the appropriate access level to add notes to all issues even
* private ones (DEVELOPER access recommended).
* @global string $g_source_control_account
*/
$g_source_control_account = '';

/**
* If set to a status, then after a checkin with a log message that matches the
* regular expression in $g_source_control_fixed_regexp, the issue status is
* set to the specified status. If set to OFF, the issue status is not changed.
* @global int $g_source_control_set_status_to
*/
$g_source_control_set_status_to = OFF;

/**
* Whenever an issue status is set to $g_source_control_set_status_to, the
* issue resolution is set to the value specified for this configuration.
* @global int $g_source_control_set_resolution_to
*/
$g_source_control_set_resolution_to = FIXED;

/**
* Regular expression used to detect issue ids within checkin comments.
* see preg_match_all() documentation at
* http://www.php.net/manual/en/function.preg-match-all.php
* @global string $g_source_control_regexp
*/
$g_source_control_regexp = "/\bissue [#]{0,1}(\d+)\b/i";

/**
* Regular expression used to detect the fact that an issue is fixed and
* extracts its issue id. If there is a match to this regular expression, then
* the issue will be marked as resolved and the resolution will be set to
* fixed.
* @global string $g_source_control_fixed_regexp
*/
$g_source_control_fixed_regexp = "%source_control_regexp%";

/**
* Bug Linking
* if a number follows this tag it will create a link to a bug.
Expand Down
1 change: 0 additions & 1 deletion core/constant_inc.php
Expand Up @@ -182,7 +182,6 @@
define( 'BUG_DEL_RELATIONSHIP', 19 );
define( 'BUG_CLONED_TO', 20 );
define( 'BUG_CREATED_FROM', 21 );
define( 'CHECKIN', 22 );
define( 'BUG_REPLACE_RELATIONSHIP', 23 );
define( 'BUG_PAID_SPONSORSHIP', 24 );
define( 'TAG_ATTACHED', 25 );
Expand Down
20 changes: 0 additions & 20 deletions core/custom_function_api.php
Expand Up @@ -155,26 +155,6 @@ function custom_function_default_format_issue_summary( $p_issue_id, $p_context =
return $t_string;
}

# Register a checkin in source control by adding a history entry and a note
# This can be overriden to do extra work.
# The issue status/resolution would only be set if the issue is fixed, and hence $p_fixed is passed as true.
function custom_function_default_checkin( $p_issue_id, $p_comment, $p_file, $p_new_version, $p_fixed ) {
if( bug_exists( $p_issue_id ) ) {
history_log_event_special( $p_issue_id, CHECKIN, $p_file, $p_new_version );
$t_private = false;
if( VS_PRIVATE == config_get( 'source_control_notes_view_status' ) ) {
$t_private = true;
}
bugnote_add( $p_issue_id, $p_comment, 0, $t_private );

$t_status = config_get( 'source_control_set_status_to' );
if(( OFF != $t_status ) && $p_fixed ) {
bug_set_field( $p_issue_id, 'status', $t_status );
bug_set_field( $p_issue_id, 'resolution', config_get( 'source_control_set_resolution_to' ) );
}
}
}

# Hook to validate field issue data before updating
# Verify that the proper fields are set with the appropriate values before proceeding
# to change the status.
Expand Down
3 changes: 0 additions & 3 deletions core/history_api.php
Expand Up @@ -544,9 +544,6 @@ function history_localize_item( $p_field_name, $p_type, $p_old_value, $p_new_val
$t_note = lang_get( 'bug_created_from' );
$t_change = bug_format_id( $p_new_value );
break;
case CHECKIN:
$t_note = lang_get( 'checkin' );
break;
case TAG_ATTACHED:
$t_note = lang_get( 'tag_history_attached' ) . ': ' . $p_old_value;
break;
Expand Down
7 changes: 7 additions & 0 deletions core/obsolete.php
Expand Up @@ -143,3 +143,10 @@
config_obsolete( 'bugnote_allow_user_edit_delete', '' );
config_obsolete( 'password_confirm_hash_magic_string', 'crypto_master_salt' );
config_obsolete( 'rss_key_seed', 'crypto_master_salt' );
config_obsolete( 'cvs_web' );
config_obsolete( 'source_control_notes_view_status' );
config_obsolete( 'source_control_account' );
config_obsolete( 'source_control_set_status_to' );
config_obsolete( 'source_control_set_resolution_to' );
config_obsolete( 'source_control_regexp' );
config_obsolete( 'source_control_fixed_regexp' );
29 changes: 4 additions & 25 deletions core/string_api.php
Expand Up @@ -158,8 +158,8 @@ function string_display_line( $p_string ) {
}

/**
* Prepare a string for display to HTML and add href anchors for URLs, emails,
* bug references, and cvs references
* Prepare a string for display to HTML and add href anchors for URLs, emails
* and bug references
* @param string $p_string
* @return string
*/
Expand All @@ -170,7 +170,7 @@ function string_display_links( $p_string ) {

/**
* Prepare a single line string for display to HTML and add href anchors for
* URLs, emails, bug references, and cvs references
* URLs, emails and bug references
* @param string $p_string
* @return string
*/
Expand Down Expand Up @@ -205,7 +205,7 @@ function string_email( $p_string ) {

/**
* Prepare a string for plain text display in email and add URLs for bug
* links and cvs links
* links
* @param string
* @return string
*/
Expand Down Expand Up @@ -313,27 +313,6 @@ function string_sanitize_url( $p_url, $p_return_absolute = false ) {
}
}

/**
* process the $p_string and convert filenames in the format
* cvs:filename.ext or cvs:filename.ext:n.nn to a html link
* if $p_include_anchor is true, include an <a href="..."> tag,
* otherwise, just insert the URL as text
* @param string $p_string
* @param bool $p_include_anchor
* @return string
*/
function string_process_cvs_link( $p_string, $p_include_anchor = true ) {
$t_cvs_web = config_get( 'cvs_web' );

if( $p_include_anchor ) {
$t_replace_with = '[CVS] <a href="' . $t_cvs_web . '\\1?rev=\\4" target="_new">\\1</a>\\5';
} else {
$t_replace_with = '[CVS] ' . $t_cvs_web . '\\1?rev=\\4\\5';
}

return preg_replace( '/cvs:([^\.\s:,\?!<]+(\.[^\.\s:,\?!<]+)*)(:)?(\d\.[\d\.]+)?([\W\s])?/i', $t_replace_with, $p_string );
}

$string_process_bug_link_callback = array();

/**
Expand Down
58 changes: 0 additions & 58 deletions docbook/adminguide/en/configuration.sgml
Expand Up @@ -2237,14 +2237,6 @@
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>$g_cvs_web</term>
<listitem>
<para>This allows for quick linking to CVS files via CVSweb or
ViewCVS.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>$g_bug_link_tag</term>
<listitem>
Expand Down Expand Up @@ -2650,56 +2642,6 @@
</section>


<section id="admin.config.sourcecontrol">
<title>Source Control Integration</title>


<variablelist>
<varlistentry>
<term>$g_source_control_account</term>
<listitem>
<para>Account to be used by the source control script. The account
must be enabled and must have the appropriate access level to add
notes to all issues even private ones (DEVELOPER access
recommended). The default is '' (not set).
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>$g_source_control_notes_view_status</term>
<listitem>
<para>This sets whether the note added will be public or private
(VS_PUBLIC or VS_PRIVATE). For open source projects it is expected
that the notes be public, however, for non-open source it will
probably be VS_PRIVATE. The default is VS_PRIVATE.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>$g_source_control_set_status_to</term>
<listitem>
<para>If set to a status, then after a checkin, the issue status
is set to the specified status, otherwise if set to OFF, the issue
status is not affected. The default is OFF.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>$g_source_control_regexp</term>
<listitem>
<para>Regular expression used to detect issue ids within checkin
comments. See
<ulink url="http://www.php.net/manual/en/function.preg-match-all.php">preg_match_all()</ulink>
documentation for more details on setting a pattern. The default is
"/\bissue [#]{0,1}(\d+)\b/i" (e.g., issue #745).
</para>
</listitem>
</varlistentry>
</variablelist>

</section>


<section id="admin.config.customfields">
<title>Custom Fields</title>

Expand Down
16 changes: 7 additions & 9 deletions docbook/adminguide/en/customizing_mantis.sgml
Expand Up @@ -770,24 +770,22 @@ functions section.</para>

<para>custom_function_default_changelog_include_issue( $p_issue_id
) returns true or false if the issue if to be included in the
Changelogcustom_function_default_changelog_print_issue( $p_issue_id
Changelog. custom_function_default_changelog_print_issue( $p_issue_id
) returns a formatted string to be included for the issue in the
Changelogcustom_function_default_checkin( $p_issue_id, $p_comment,
$p_file, $p_new_version ) registers a checkin in source control in
MantisBT custom_function_default_issue_update_validate( $p_issue_id,
Changelog. custom_function_default_issue_update_validate( $p_issue_id,
$p_new_bug, $p_bug_note_text ) validate issue field settings before
an update occurs. It returns true or fails with an
error.custom_function_default_issue_update_notify( $p_issue_id )
error. custom_function_default_issue_update_notify( $p_issue_id )
notify after an issue has been
updatedcustom_function_default_issue_create_validate( $p_new_bug )
updated. custom_function_default_issue_create_validate( $p_new_bug )
validate issue field settings before an issue is created. It returns
true or fails with an
error.custom_function_default_issue_create_notify( $p_issue_id )
error. custom_function_default_issue_create_notify( $p_issue_id )
notify after an issue has been
openedcustom_function_default_issue_delete_validate( $p_issue_id )
opened. custom_function_default_issue_delete_validate( $p_issue_id )
validate issue field settings before an issue can be deleted. It
returns true or fails with an
error.custom_function_default_issue_delete_notify( $p_issue_id )
error. custom_function_default_issue_delete_notify( $p_issue_id )
notify after an issue has been deleted
</para>
</section>
Expand Down
1 change: 0 additions & 1 deletion lang/strings_arabic.txt
Expand Up @@ -1074,7 +1074,6 @@ $s_dependency_graph = 'رسمة الاعتماد';
$s_vertical = 'رأسي';
$s_horizontal = 'أفقي';
$s_view_issue = 'عرض قضية';
$s_checkin = 'تسجيل';
$s_perm_rpt_capability = 'القدرة';
$s_view = 'عرض';
$s_issues = 'قضايا';
Expand Down
1 change: 0 additions & 1 deletion lang/strings_arabicegyptianspoken.txt
Expand Up @@ -1074,7 +1074,6 @@ $s_dependency_graph = 'رسمه الاعتماد';
$s_vertical = 'رأسي';
$s_horizontal = 'أفقي';
$s_view_issue = 'عرض قضية';
$s_checkin = 'تسجيل';
$s_perm_rpt_capability = 'القدرة';
$s_view = 'عرض';
$s_issues = 'قضايا';
Expand Down
1 change: 0 additions & 1 deletion lang/strings_breton.txt
Expand Up @@ -1091,7 +1091,6 @@ $s_dependency_graph = 'Grafik sujidigezhioù';
$s_vertical = 'A-hed';
$s_horizontal = 'A-led';
$s_view_issue = 'Gwelet an draen';
$s_checkin = 'Kontroll';
$s_perm_rpt_capability = 'Gouestoni';
$s_view = 'Gwelet';
$s_issues = 'Drein';
Expand Down
1 change: 0 additions & 1 deletion lang/strings_bulgarian.txt
Expand Up @@ -936,7 +936,6 @@ $s_dependency_graph = 'Графика на зависимост';
$s_vertical = 'Вертикален';
$s_horizontal = 'Хоризонтален';
$s_view_issue = 'Визуализация на проблем';
$s_checkin = 'Регистрация';
$s_perm_rpt_capability = 'Дейности';
$s_view = 'Визуализация';
$s_issues = 'ПРОБЛЕМИ';
Expand Down
1 change: 0 additions & 1 deletion lang/strings_catalan.txt
Expand Up @@ -1097,7 +1097,6 @@ $s_dependency_graph = 'Gràfic de Dependències';
$s_vertical = 'Vertical';
$s_horizontal = 'Horitzontal';
$s_view_issue = 'Vista de la incidència';
$s_checkin = 'Control';
$s_perm_rpt_capability = 'Capacitat';
$s_view = 'Examina';
$s_issues = 'Incidències';
Expand Down
1 change: 0 additions & 1 deletion lang/strings_chinese_simplified.txt
Expand Up @@ -926,7 +926,6 @@ $s_dependency_graph = '依赖图表';
$s_vertical = '垂直';
$s_horizontal = '水平';
$s_view_issue = '查看问题';
$s_checkin = '签入';
$s_perm_rpt_capability = '权限';
$s_view = '视图';
$s_issues = '问题';
Expand Down
1 change: 0 additions & 1 deletion lang/strings_chinese_traditional.txt
Expand Up @@ -892,7 +892,6 @@ $s_dependency_graph = '依存問題圖';
$s_vertical = '垂直';
$s_horizontal = '水平';
$s_view_issue = '檢視問題';
$s_checkin = '登入';
$s_perm_rpt_capability = '權限功能';
$s_view = '檢視';
$s_issues = '問題';
Expand Down

0 comments on commit 9527e0e

Please sign in to comment.