View Issue Details
| ID | Project | Category | View Status | Date Submitted | Last Update |
|---|---|---|---|---|---|
| 0008497 | mantisbt | feature | public | 2007-10-22 15:10 | 2025-01-13 12:32 |
| Reporter | Nycto | Assigned To | |||
| Priority | normal | Severity | feature | Reproducibility | N/A |
| Status | confirmed | Resolution | open | ||
| Product Version | 1.1.0rc1 | ||||
| Summary | 0008497: Email when Moved | ||||
| Description | I needed an email notification to be sent when a bug is moved from one project to another. Details about our practical application: | ||||
| Additional Information | The patch was tested on CVS HEAD and 1.1.0rc1. I have attached a diff file that applies the needed changes. The following files are are affected by this patch: For everything to work correctly, this SQL statement must also be run: ALTER TABLE | ||||
| Tags | No tags attached. | ||||
| Attached Files | emailWhenMoved.diff (4,516 bytes)
? MantisCVS.kpf
? changes.sql
? emailWhenMoved.diff
? log.txt
? test.php
Index: account_prefs_inc.php
===================================================================
RCS file: /cvsroot/mantisbt/mantisbt/account_prefs_inc.php,v
retrieving revision 1.34
diff -b -r1.34 account_prefs_inc.php
250a251,264
> <?php echo lang_get( 'email_on_moved' ) ?>
> </td>
> <td>
> <input type="checkbox" name="email_on_moved" <?php check_checked( $t_pref->email_on_moved, ON ); ?> />
> <?php echo lang_get( 'with_minimum_severity' ) ?>
> <select name="email_on_moved_min_severity">
> <option value="<?php echo OFF ?>"><?php echo lang_get( 'any' ) ?></option>
> <option value="<?php echo OFF ?>"></option>
> <?php print_enum_string_option_list( 'severity', $t_pref->email_on_moved_min_severity ) ?>
> </select>
> </td>
> </tr>
> <tr class="row-2">
> <td class="category">
278c292
< <tr class="row-2">
---
> <tr class="row-1">
Index: account_prefs_update.php
===================================================================
RCS file: /cvsroot/mantisbt/mantisbt/account_prefs_update.php,v
retrieving revision 1.36
diff -b -r1.36 account_prefs_update.php
59a60
> $t_prefs->email_on_moved = gpc_get_bool( 'email_on_moved' );
68a70
> $t_prefs->email_on_moved_min_severity = gpc_get_int( 'email_on_moved_min_severity' );
Index: bug_actiongroup.php
===================================================================
RCS file: /cvsroot/mantisbt/mantisbt/bug_actiongroup.php,v
retrieving revision 1.52
diff -b -r1.52 bug_actiongroup.php
90,91c90
< bug_set_field( $t_bug_id, 'project_id', $f_project_id );
< helper_call_custom_function( 'issue_update_notify', array( $t_bug_id ) );
---
> bug_move( $t_bug_id, $f_project_id );
Index: config_defaults_inc.php
===================================================================
RCS file: /cvsroot/mantisbt/mantisbt/config_defaults_inc.php,v
retrieving revision 1.365
diff -b -r1.365 config_defaults_inc.php
681a682
> $g_default_email_on_moved = OFF;
690a692
> $g_default_email_on_moved_minimum_severity = OFF;
Index: manage_config_email_page.php
===================================================================
RCS file: /cvsroot/mantisbt/mantisbt/manage_config_email_page.php,v
retrieving revision 1.10
diff -b -r1.10 manage_config_email_page.php
245a246
> get_capability_row_for_email( lang_get( 'email_on_moved' ), 'moved' );
Index: manage_config_email_set.php
===================================================================
RCS file: /cvsroot/mantisbt/mantisbt/manage_config_email_set.php,v
retrieving revision 1.10
diff -b -r1.10 manage_config_email_set.php
38c38
< $t_valid_actions = array( 'owner', 'reopened', 'deleted', 'bugnote' );
---
> $t_valid_actions = array( 'owner', 'moved', 'reopened', 'deleted', 'bugnote' );
Index: core/bug_api.php
===================================================================
RCS file: /cvsroot/mantisbt/mantisbt/core/bug_api.php,v
retrieving revision 1.111
diff -b -r1.111 bug_api.php
917a918,925
> # --------------------
> # Moves a bug with the given id to the defined project
> function bug_move ( $p_bug_id, $p_project_id ) {
> bug_set_field( $p_bug_id, 'project_id', $p_project_id );
> email_moved( $p_bug_id );
> return true;
> }
>
Index: core/email_api.php
===================================================================
RCS file: /cvsroot/mantisbt/mantisbt/core/email_api.php,v
retrieving revision 1.139
diff -b -r1.139 email_api.php
616a617,621
> # send notices when a bug is moved
> function email_moved( $p_bug_id ) {
> email_generic( $p_bug_id, 'moved', 'email_notification_title_for_action_bug_moved' );
> }
> # --------------------
Index: core/user_pref_api.php
===================================================================
RCS file: /cvsroot/mantisbt/mantisbt/core/user_pref_api.php,v
retrieving revision 1.32
diff -b -r1.32 user_pref_api.php
30a31
> 'email_on_moved' => 'default_email_on_moved',
39a41
> 'email_on_moved_min_severity' => 'default_email_on_moved_minimum_severity',
64a67
> var $email_on_moved = NULL;
73a77
> var $email_on_moved_min_severity = NULL;
Index: lang/strings_english.txt
===================================================================
RCS file: /cvsroot/mantisbt/mantisbt/lang/strings_english.txt,v
retrieving revision 1.316
diff -b -r1.316 strings_english.txt
347a348
> $s_email_notification_title_for_action_bug_moved = 'The following issue has been MOVED.';
420a422
> $s_email_on_moved = 'Email when Moved';
| ||||
| related to | 0034876 | resolved | dregad | When moving issues, it should not be possible to select the current project as target |
| has duplicate | 0013631 | closed | atrol | No mail when moving a ticket from a project to another project |
| has duplicate | 0008483 | closed | dregad | No email notification to reporter when issue is moved to another project |
| has duplicate | 0020745 | closed | atrol | Add NotificationEvent for Move button . |
| has duplicate | 0010621 | closed | vboctor | Send Mails when move issue of proyect |
|
I haven't reviewed the implementation, however, I agree with this feature and it was previously requested by users. I've targeted this issue to Mantis 1.2.0. |
|
|
Unassigned after having been assigned for a long time without progress. |
|
|
why this code not in main branch? |
|
Because no one took the time to
If you are interested in this feature: Submitting a patch is always a good idea, as it increases the chances of improvement eventually making it into MantisBT core. All contributions are welcome and greatly appreciated. Patch submissions can be made in several ways. In the order of preference:
Kindly avoid to upload entire modified PHP files. Please make sure that your submissions adhere to our Coding Guidelines [2], if they don't your patch might be rejected. [1] https://github.com/mantisbt/mantisbt |
|