Please take our Survey
logo       

Choosing A Webhost:
A web hosting service is a type of Internet hosting service that allows individuals and organizations to provide their own website accessible via the World Wide Web. Web hosts are companies that provide space on a server they own for use by their clients as well as providing Internet connectivity, typically in a data center. Web hosts can also provide data center space and connectivity to the Internet for servers they do not own to be located in their data center, called colocation. more...

mantisbt bug_relationship_add.php,1.2,1.3 bug_relationship_delete.php,1.4,1: msg#00027

bug-tracking.mantis.cvs

Subject: mantisbt bug_relationship_add.php,1.2,1.3 bug_relationship_delete.php,1.4,1.5 bug_report.php,1.38,1.39 bug_report_advanced_page.php,1.43,1.44 bug_report_page.php,1.45,1.46

Update of /cvsroot/mantisbt/mantisbt
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14156

Modified Files:
bug_relationship_add.php bug_relationship_delete.php
bug_report.php bug_report_advanced_page.php
bug_report_page.php
Log Message:
Commit of Masc's Patches:
Fix 0004506: When cloning a bug you should be able to set the relationship
Fix 0004484: Show which project a related issue belongs to
Fix 0004184: Related issues resolved email should be more informative
Fix 0004224: Can't resolve issue as duplicate of other with existing "related
to" relationship

Index: bug_relationship_add.php
===================================================================
RCS file: /cvsroot/mantisbt/mantisbt/bug_relationship_add.php,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- bug_relationship_add.php 18 Jul 2004 00:07:44 -0000 1.2
+++ bug_relationship_add.php 5 Oct 2004 21:12:41 -0000 1.3
@@ -51,78 +51,39 @@
trigger_error(
ERROR_RELATIONSHIP_ACCESS_LEVEL_TO_DEST_BUG_TOO_LOW, ERROR );
}

- # there is no other relationship between the same bugs...
- if ( relationship_exists($f_src_bug_id, $f_dest_bug_id) > 0 ) {
+ # check if there is other relationship between the bugs...
+ $t_old_id_relationship = relationship_same_type_exists( $f_src_bug_id,
$f_dest_bug_id, $f_rel_type );
+
+ if ( $t_old_id_relationship == -1 ) {
+ # the relationship type is exactly the same of the new one. No
sense to proceed
trigger_error( ERROR_RELATIONSHIP_ALREADY_EXISTS, ERROR );
}
+ else if ( $t_old_id_relationship > 0 ) {
+ # there is already a relationship between them -> we have to
update it and not to add a new one
+ helper_ensure_confirmed( lang_get(
'replace_relationship_sure_msg' ), lang_get( 'replace_relationship_button' ) );

- switch ( $f_rel_type ) {
-
- case BUG_BLOCKS:
- # BUG_BLOCKS -> swap src and dest with relationship
BUG_DEPENDANT
-
- # Add relation to the DB
- relationship_add( $f_dest_bug_id, $f_src_bug_id,
BUG_DEPENDANT );
-
- # Add log line to the history (both bugs)
- history_log_event_special( $f_src_bug_id,
BUG_ADD_RELATIONSHIP, BUG_BLOCKS, $f_dest_bug_id );
- history_log_event_special( $f_dest_bug_id,
BUG_ADD_RELATIONSHIP, BUG_DEPENDANT, $f_src_bug_id );
-
- break;
-
- case BUG_DEPENDANT:
- # Add relation to the DB
- relationship_add( $f_src_bug_id, $f_dest_bug_id,
BUG_DEPENDANT );
-
- # Add log line to the history (both bugs)
- history_log_event_special( $f_src_bug_id,
BUG_ADD_RELATIONSHIP, BUG_DEPENDANT, $f_dest_bug_id );
- history_log_event_special( $f_dest_bug_id,
BUG_ADD_RELATIONSHIP, BUG_BLOCKS, $f_src_bug_id );
-
- break;
-
- case BUG_HAS_DUPLICATE:
- # BUG_HAS_DUPLICATE -> swap src and dest with
relationship BUG_DUPLICATE
-
- # Add relation to the DB
- relationship_add( $f_dest_bug_id, $f_src_bug_id,
BUG_DUPLICATE );
-
- # Add log line to the history (both bugs)
- history_log_event_special( $f_src_bug_id,
BUG_ADD_RELATIONSHIP, BUG_HAS_DUPLICATE, $f_dest_bug_id );
- history_log_event_special( $f_dest_bug_id,
BUG_ADD_RELATIONSHIP, BUG_DUPLICATE, $f_src_bug_id );
-
- break;
-
- case BUG_DUPLICATE:
- # Add relation to the DB
- relationship_add( $f_src_bug_id, $f_dest_bug_id,
BUG_DUPLICATE );
-
- # Add log line to the history (both bugs)
- history_log_event_special( $f_src_bug_id,
BUG_ADD_RELATIONSHIP, BUG_DUPLICATE, $f_dest_bug_id );
- history_log_event_special( $f_dest_bug_id,
BUG_ADD_RELATIONSHIP, BUG_HAS_DUPLICATE, $f_src_bug_id );
-
- break;
-
- case BUG_RELATED:
- relationship_add( $f_src_bug_id, $f_dest_bug_id,
BUG_RELATED );
-
- # Add log line to the history (both bugs)
- history_log_event_special( $f_src_bug_id,
BUG_ADD_RELATIONSHIP, BUG_RELATED, $f_dest_bug_id );
- history_log_event_special( $f_dest_bug_id,
BUG_ADD_RELATIONSHIP, BUG_RELATED, $f_src_bug_id );
-
- break;
+ # Update the relationship
+ relationship_update( $t_old_id_relationship, $f_src_bug_id,
$f_dest_bug_id, $f_rel_type );

- default:
- trigger_error( ERROR_GENERIC, ERROR );
+ # Add log line to the history (both bugs)
+ history_log_event_special( $f_src_bug_id,
BUG_REPLACE_RELATIONSHIP, $f_rel_type, $f_dest_bug_id );
+ history_log_event_special( $f_dest_bug_id,
BUG_REPLACE_RELATIONSHIP, relationship_get_complementary_type( $f_rel_type ),
$f_src_bug_id );
+ }
+ else {
+ # Add the new relationship
+ relationship_add( $f_src_bug_id, $f_dest_bug_id, $f_rel_type );

- break;
+ # Add log line to the history (both bugs)
+ history_log_event_special( $f_src_bug_id, BUG_ADD_RELATIONSHIP,
$f_rel_type, $f_dest_bug_id );
+ history_log_event_special( $f_dest_bug_id,
BUG_ADD_RELATIONSHIP, relationship_get_complementary_type( $f_rel_type ),
$f_src_bug_id );
}

# update bug last updated (just for the src bug)
bug_update_date( $f_src_bug_id );

# send email notification to the users addressed by both the bugs
- email_relationship_added( $f_src_bug_id );
- email_relationship_added( $f_dest_bug_id );
+ email_relationship_added( $f_src_bug_id, $f_dest_bug_id, $f_rel_type );
+ email_relationship_added( $f_dest_bug_id, $f_src_bug_id,
relationship_get_complementary_type( $f_rel_type ) );

print_header_redirect_view( $f_src_bug_id );


Index: bug_report.php
===================================================================
RCS file: /cvsroot/mantisbt/mantisbt/bug_report.php,v
retrieving revision 1.38
retrieving revision 1.39
diff -u -d -r1.38 -r1.39
--- bug_report.php 21 Aug 2004 13:27:25 -0000 1.38
+++ bug_report.php 5 Oct 2004 21:12:41 -0000 1.39
@@ -120,23 +120,27 @@
}

$f_master_bug_id = gpc_get_int( 'm_id', 0 );
+ $f_rel_type = gpc_get_int( 'rel_type', -1 );

- if( $f_master_bug_id > 0 ) {
+ if( $f_master_bug_id > 0 && $f_rel_type >= 0 ) {
# it's a child generation... let's create the relationship and
add some lines in the history

+ # update master bug last updated
+ bug_update_date( $f_master_bug_id );
+
# Add log line to record the cloning action
history_log_event_special( $t_bug_id, BUG_CREATED_FROM, '',
$f_master_bug_id );
history_log_event_special( $f_master_bug_id, BUG_CLONED_TO, '',
$t_bug_id );

- # Add relation
- relationship_add( $f_master_bug_id, $t_bug_id, BUG_DEPENDANT );
+ # Add the relationship
+ relationship_add( $t_bug_id, $f_master_bug_id, $f_rel_type );

- # Add log line to the history (both bugs)
- history_log_event_special( $f_master_bug_id,
BUG_ADD_RELATIONSHIP, BUG_DEPENDANT, $t_bug_id );
- history_log_event_special( $t_bug_id, BUG_ADD_RELATIONSHIP,
BUG_BLOCKS, $f_master_bug_id );
+ # Add log line to the history (both issues)
+ history_log_event_special( $f_master_bug_id,
BUG_ADD_RELATIONSHIP, relationship_get_complementary_type( $f_rel_type ),
$t_bug_id );
+ history_log_event_special( $t_bug_id, BUG_ADD_RELATIONSHIP,
$f_rel_type, $f_master_bug_id );

- # send email notification to the users addressed by the master
bug
- email_relationship_added( $f_master_bug_id );
+ # Send the email notification
+ email_relationship_added( $f_master_bug_id, $t_bug_id,
relationship_get_complementary_type( $f_rel_type ) );
}

email_new_bug( $t_bug_id );

Index: bug_report_advanced_page.php
===================================================================
RCS file: /cvsroot/mantisbt/mantisbt/bug_report_advanced_page.php,v
retrieving revision 1.43
retrieving revision 1.44
diff -u -d -r1.43 -r1.44
--- bug_report_advanced_page.php 22 Sep 2004 08:52:37 -0000 1.43
+++ bug_report_advanced_page.php 5 Oct 2004 21:12:41 -0000 1.44
@@ -418,6 +418,23 @@
</td>
</tr>

+<!-- Relationship (in case of cloned bug creation...) -->
+<?php
+ if( $f_master_bug_id > 0 ) {
+?>
+<tr <?php echo helper_alternate_class() ?>>
+ <td class="category">
+ <?php echo lang_get( 'relationship_with_parent' ) ?>
+ </td>
+ <td>
+ <?php relationship_list_box_for_cloned_bug( BUG_BLOCKS ) ?>
+ <?php PRINT '<b>' . lang_get( 'bug' ) . ' ' . bug_format_id(
$f_master_bug_id ) . '</b>' ?>
+ </td>
+</tr>
+<?php
+ }
+?>
+
<!-- Report Stay (report more bugs) -->
<tr <?php echo helper_alternate_class() ?>>
<td class="category">

Index: bug_relationship_delete.php
===================================================================
RCS file: /cvsroot/mantisbt/mantisbt/bug_relationship_delete.php,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- bug_relationship_delete.php 16 Sep 2004 13:56:48 -0000 1.4
+++ bug_relationship_delete.php 5 Oct 2004 21:12:41 -0000 1.5
@@ -64,61 +64,14 @@
# update bug last updated (just for the src bug)
bug_update_date( $f_bug_id );

- # Add log lines to both the histories
- switch ( $t_rel_type ) {
- case BUG_BLOCKS:
- history_log_event_special( $f_bug_id,
BUG_DEL_RELATIONSHIP, BUG_BLOCKS, $t_dest_bug_id );
- email_relationship_deleted( $f_bug_id );
-
- if ( bug_exists( $t_dest_bug_id )) {
- history_log_event_special( $t_dest_bug_id,
BUG_DEL_RELATIONSHIP, BUG_DEPENDANT, $f_bug_id );
- email_relationship_deleted( $t_dest_bug_id );
- }
- break;
-
- case BUG_DEPENDANT:
- history_log_event_special( $f_bug_id,
BUG_DEL_RELATIONSHIP, BUG_DEPENDANT, $t_dest_bug_id );
- email_relationship_deleted( $f_bug_id );
-
- if ( bug_exists( $t_dest_bug_id )) {
- history_log_event_special( $t_dest_bug_id,
BUG_DEL_RELATIONSHIP, BUG_BLOCKS, $f_bug_id );
- email_relationship_deleted( $t_dest_bug_id );
- }
- break;
-
- case BUG_HAS_DUPLICATE:
- history_log_event_special( $f_bug_id,
BUG_DEL_RELATIONSHIP, BUG_HAS_DUPLICATE, $t_dest_bug_id );
- email_relationship_deleted( $f_bug_id );
-
- if ( bug_exists( $t_dest_bug_id )) {
- history_log_event_special( $t_dest_bug_id,
BUG_DEL_RELATIONSHIP, BUG_DUPLICATE, $f_bug_id );
- email_relationship_deleted( $t_dest_bug_id );
- }
- break;
-
- case BUG_DUPLICATE:
- history_log_event_special( $f_bug_id,
BUG_DEL_RELATIONSHIP, BUG_DUPLICATE, $t_dest_bug_id );
- email_relationship_deleted( $f_bug_id );
-
- if ( bug_exists( $t_dest_bug_id )) {
- history_log_event_special( $t_dest_bug_id,
BUG_DEL_RELATIONSHIP, BUG_HAS_DUPLICATE, $f_bug_id );
- email_relationship_deleted( $t_dest_bug_id );
- }
- break;
-
- case BUG_RELATED:
- history_log_event_special( $f_bug_id,
BUG_DEL_RELATIONSHIP, BUG_RELATED, $t_dest_bug_id );
- email_relationship_deleted( $f_bug_id );
-
- if ( bug_exists( $t_dest_bug_id )) {
- history_log_event_special( $t_dest_bug_id,
BUG_DEL_RELATIONSHIP, BUG_RELATED, $f_bug_id );
- email_relationship_deleted( $t_dest_bug_id );
- }
- break;
+ # send email and update the history for the src issue
+ history_log_event_special( $f_bug_id, BUG_DEL_RELATIONSHIP,
$t_rel_type, $t_dest_bug_id );
+ email_relationship_deleted( $f_bug_id, $t_dest_bug_id, $t_rel_type );

- default:
- trigger_error( ERROR_GENERIC, ERROR );
- break;
+ if ( bug_exists( $t_dest_bug_id )) {
+ # send email and update the history for the dest issue
+ history_log_event_special( $t_dest_bug_id,
BUG_DEL_RELATIONSHIP, relationship_get_complementary_type( $t_rel_type ),
$f_bug_id );
+ email_relationship_deleted( $t_dest_bug_id, $f_bug_id,
relationship_get_complementary_type( $t_rel_type ) );
}

print_header_redirect_view( $f_bug_id );

Index: bug_report_page.php
===================================================================
RCS file: /cvsroot/mantisbt/mantisbt/bug_report_page.php,v
retrieving revision 1.45
retrieving revision 1.46
diff -u -d -r1.45 -r1.46
--- bug_report_page.php 22 Sep 2004 08:52:37 -0000 1.45
+++ bug_report_page.php 5 Oct 2004 21:12:41 -0000 1.46
@@ -304,6 +304,23 @@
</td>
</tr>

+<!-- Relationship (in case of cloned bug creation...) -->
+<?php
+ if( $f_master_bug_id > 0 ) {
+?>
+<tr <?php echo helper_alternate_class() ?>>
+ <td class="category">
+ <?php echo lang_get( 'relationship_with_parent' ) ?>
+ </td>
+ <td>
+ <?php relationship_list_box_for_cloned_bug( BUG_BLOCKS ) ?>
+ <?php PRINT '<b>' . lang_get( 'bug' ) . ' ' . bug_format_id(
$f_master_bug_id ) . '</b>' ?>
+ </td>
+</tr>
+<?php
+ }
+?>
+
<!-- Report Stay (report more bugs) -->
<tr <?php echo helper_alternate_class() ?>>
<td class="category">



-------------------------------------------------------
This SF.net email is sponsored by: IT Product Guide on ITManagersJournal
Use IT products in your business? Tell us what you think of them. Give us
Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out more
http://productguide.itmanagersjournal.com/guidepromo.tmpl


<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

Recently Viewed:
hardware.arm.at...    cms.citadel.dev...    video.gstreamer...    java.facelets.u...    misc.basics.qna...    web.wiki.instik...    network.uip.use...    xdg.devel/2003-...    tex.bibtex.bibd...    finance.quotesp...    ietf.zeroconf/2...    redhat.blinux.g...    suse.db2/2003-0...    php.phpesp/2004...    uml.devel/2003-...    gnome.labyrinth...    qnx.openqnx.dev...    boot-loaders.gr...    db.dataperfect....    audio.audacity....    linux.uclinux.m...    editors.j.devel...    os.openbsd.tech...    kde.users.multi...   
Home | advertise | OSDir is an inevitable website. super tiny logo

Free Magazines

Cisco News
Receive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business.
subscribe

Systems Management News, the newspaper for IT systems administration and data center managers! Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field.
subscribe

The Enterprise Newsweekly eWeek is the essential technology information source for builders of e-business.
subscribe

Oracle Magazine Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company.
subscribe

Total Telecom Total Telecom is "The Economist of the communications industry".
subscribe

Navigation