View Issue Details

IDProjectCategoryView StatusLast Update
0013323mantisbtrelationshipspublic2012-01-24 02:19
Reportervincent_sels Assigned Todregad  
PrioritynormalSeverityfeatureReproducibilityN/A
Status closedResolutionduplicate 
Product Version1.2.8 
Summary0013323: Add the option to be able to link to read-only tickets
Description

Adding a relationship to another ticket isn't really 'altering' the ticket, in my opinion. Same goes for cloning (which requires adding a relationship).

I would like an option where you could specify that adding relationships to (and from) read-only tickets is allowed.

Tagspatch
Attached Files
0013323_2.diff (2,461 bytes)   
--- C:/Documents and Settings/vsel/mantisbt-1.2.8/config_defaults_inc.php	Mon Sep 26 21:54:19 2011
+++ C:/Documents and Settings/vsel/mantisbt-edited/config_defaults_inc.php	Mon Sep 26 22:01:48 2011
@@ -2723,6 +2723,13 @@
 	 * @global int $g_view_additional_information_threshold
 	 */
 	$g_view_additional_information_threshold = DEVELOPER;
+	
+	/**
+	 * when set to ON, it is allowed to link other tickets to a read-only ticket.
+	 * This will allow reporters to link to tickets too.
+	 * @global int $g_allow_link_to_readonly_tickets
+	 */
+	$g_allow_link_to_readonly_tickets = ON;
 
 	/************************************
 	 * MantisBT Look and Feel Variables *
--- C:/Documents and Settings/vsel/mantisbt-1.2.8/bug_report.php	Mon Sep 26 22:03:22 2011
+++ C:/Documents and Settings/vsel/mantisbt-edited/bug_report.php	Tue Sep 20 14:59:24 2011
@@ -44,7 +44,9 @@
 		}
 		$t_master_bug = bug_get( $f_master_bug_id, true );
 		project_ensure_exists( $t_master_bug->project_id );
+		if ( config_get( 'allow_link_to_readonly_tickets' ) == OFF ) {
 		access_ensure_bug_level( config_get( 'update_bug_threshold', null, null, $t_master_bug->project_id ), $f_master_bug_id );
+		}
 		$t_project_id = $t_master_bug->project_id;
 	} else {
 		$f_project_id = gpc_get_int( 'project_id' );
--- C:/Documents and Settings/vsel/mantisbt-1.2.8/bug_report_page.php	Mon Sep 26 22:04:10 2011
+++ C:/Documents and Settings/vsel/mantisbt-edited/bug_report_page.php	Tue Sep 20 14:58:52 2011
@@ -56,7 +56,10 @@
 		$t_bug = bug_get( $f_master_bug_id, true );
 
 		# the user can at least update the master bug (needed to add the relationship)...
+		
+		if ( config_get( 'allow_link_to_readonly_tickets' ) == OFF ) {
 		access_ensure_bug_level( config_get( 'update_bug_threshold', null, null, $t_bug->project_id ), $f_master_bug_id );
+		}
 
 		#@@@ (thraxisp) Note that the master bug is cloned into the same project as the master, independent of
 		#       what the current project is set to.
--- C:/Documents and Settings/vsel/mantisbt-1.2.8/core/html_api.php	Wed Sep 28 20:29:58 2011
+++ C:/Documents and Settings/vsel/mantisbt-edited/core/html_api.php	Wed Sep 28 20:26:42 2011
@@ -1660,7 +1660,7 @@
 		echo '</td>';
 	}
 
-	if( !$t_readonly ) {
+	if( !$t_readonly || config_get( 'allow_link_to_readonly_tickets' ) == ON ) {
 		# CREATE CHILD button
 		echo '<td class="center">';
 		html_button_bug_create_child( $p_bug_id );
0013323_2.diff (2,461 bytes)   

Relationships

duplicate of 0011290 closeddregad Create Clone access to reporters 

Activities

vincent_sels

vincent_sels

2011-09-18 17:28

reporter   ~0029800

Last edited: 2011-10-04 04:06

I achieved this by adding the following setting:

$g_allow_link_to_readonly_tickets = ON;

And altering the following code in bug_report and bug_report_page:

    if ( config_get( 'allow_link_to_readonly_tickets' ) == OFF ) {
        access_ensure_bug_level( config_get( 'update_bug_threshold', null, null, $t_master_bug->project_id ), $f_master_bug_id );
    }

Not sure if that's the proper way to do it though...

vincent_sels

vincent_sels

2011-09-28 14:25

reporter   ~0029879

Last edited: 2011-10-04 04:05

Also, in core\html_api:

if( !$t_readonly <b>|| config_get( 'allow_link_to_readonly_tickets' ) == ON</b> )  {
    # CREATE CHILD button
    echo '<td class="center">';
    html_button_bug_create_child( $p_bug_id );
    echo '</td>';
}

-- Added this to the diff file (_2), please remove the old one.

vincent_sels

vincent_sels

2011-10-04 04:07

reporter   ~0029909

Another change required in bug_report_page (pretty obvious):

    # master bug is not read-only...
    if ( bug_is_readonly( $f_master_bug_id ) <b>&& config_get( 'allow_link_to_readonly_tickets' ) == OFF </b>) {
        error_parameters( $f_master_bug_id );
        trigger_error( ERROR_BUG_READ_ONLY_ACTION_DENIED, ERROR );
    }
dregad

dregad

2012-01-13 05:22

developer   ~0030903

As mentioned by you in 0011290, this is a duplicate so I'm marking it as resolved.