Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: mantisbt/mantisbt
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 074bd9feae22
Choose a base ref
...
head repository: mantisbt/mantisbt
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 56836251f694
Choose a head ref
  • 2 commits
  • 4 files changed
  • 1 contributor

Commits on Apr 10, 2013

  1. Revert "Fix #2971: add reminder events to the bug history"

    This reverts commit f4753ec following
    discussion on the mailing list [1].
    
    [1] http://thread.gmane.org/gmane.comp.bug-tracking.mantis.devel/4330
    
    Conflicts:
    	bug_reminder.php
    dregad committed Apr 10, 2013

    Verified

    This commit was signed with the committer’s verified signature.
    vcunat Vladimír Čunát
    Copy the full SHA
    2cbd52d View commit details
  2. Create reminder bugnote even if no message text provided

    When adding a reminder, a bugnote was actually NOT created when the
    reminder text is empty, even if $g_store_reminders = ON.  This was due
    to bugnote_add() returning false when $p_bugnote_text is blank as the
    code did not take REMINDER type notes into consideration.
    
    Fixes #15744
    dregad committed Apr 10, 2013

    Verified

    This commit was signed with the committer’s verified signature.
    vcunat Vladimír Čunát
    Copy the full SHA
    5683625 View commit details
Showing with 18 additions and 26 deletions.
  1. +0 −5 bug_reminder.php
  2. +18 −16 core/bugnote_api.php
  3. +0 −1 core/constant_inc.php
  4. +0 −4 core/history_api.php
5 changes: 0 additions & 5 deletions bug_reminder.php
Original file line number Diff line number Diff line change
@@ -87,11 +87,6 @@
bugnote_add( $f_bug_id, $f_body, 0, config_get( 'default_reminder_view_status' ) == VS_PRIVATE, REMINDER, $t_attr, NULL, FALSE );
}

# Add history entries for all sent reminders
foreach ( $result as $t_recipient ) {
history_log_event_special( $f_bug_id, BUG_REMINDER_SENT, $t_recipient );
}

form_security_purge( 'bug_reminder' );

html_page_top( null, string_get_bug_view_url( $f_bug_id ) );
34 changes: 18 additions & 16 deletions core/bugnote_api.php
Original file line number Diff line number Diff line change
@@ -124,31 +124,33 @@ function bugnote_is_user_reporter( $p_bugnote_id, $p_user_id ) {
* @return false|int false or indicating bugnote id added
* @access public
*/
function bugnote_add( $p_bug_id, $p_bugnote_text, $p_time_tracking = '0:00', $p_private = false, $p_type = 0, $p_attr = '', $p_user_id = null, $p_send_email = TRUE, $p_log_history = TRUE) {
function bugnote_add( $p_bug_id, $p_bugnote_text, $p_time_tracking = '0:00', $p_private = false, $p_type = BUGNOTE, $p_attr = '', $p_user_id = null, $p_send_email = TRUE, $p_log_history = TRUE) {
$c_bug_id = db_prepare_int( $p_bug_id );
$c_time_tracking = helper_duration_to_minutes( $p_time_tracking );
$c_type = db_prepare_int( $p_type );

$t_bugnote_text_table = db_get_table( 'mantis_bugnote_text_table' );
$t_bugnote_table = db_get_table( 'mantis_bugnote_table' );

$t_time_tracking_enabled = config_get( 'time_tracking_enabled' );
$t_time_tracking_without_note = config_get( 'time_tracking_without_note' );

if( ON == $t_time_tracking_enabled && $c_time_tracking > 0 ) {
if( is_blank( $p_bugnote_text ) && OFF == $t_time_tracking_without_note ) {
error_parameters( lang_get( 'bugnote' ) );
trigger_error( ERROR_EMPTY_FIELD, ERROR );
if( REMINDER !== $p_type ) {
# Check if this is a time-tracking note
$t_time_tracking_enabled = config_get( 'time_tracking_enabled' );
if( ON == $t_time_tracking_enabled && $c_time_tracking > 0 ) {
$t_time_tracking_without_note = config_get( 'time_tracking_without_note' );
if( is_blank( $p_bugnote_text ) && OFF == $t_time_tracking_without_note ) {
error_parameters( lang_get( 'bugnote' ) );
trigger_error( ERROR_EMPTY_FIELD, ERROR );
}
$c_type = TIME_TRACKING;
} else if( is_blank( $p_bugnote_text ) ) {
# This is not time tracking (i.e. it's a normal bugnote)
# @todo should we not trigger an error in this case ?
return false;
}
$c_type = TIME_TRACKING;
} else if( is_blank( $p_bugnote_text ) ) {
return false;
}

$t_bugnote_text = $p_bugnote_text;
$t_bugnote_text_table = db_get_table( 'mantis_bugnote_text_table' );
$t_bugnote_table = db_get_table( 'mantis_bugnote_table' );

# Event integration
$t_bugnote_text = event_signal( 'EVENT_BUGNOTE_DATA', $t_bugnote_text, $c_bug_id );
$t_bugnote_text = event_signal( 'EVENT_BUGNOTE_DATA', $p_bugnote_text, $c_bug_id );

# insert bugnote text
$query = 'INSERT INTO ' . $t_bugnote_text_table . ' ( note ) VALUES ( ' . db_param() . ' )';
1 change: 0 additions & 1 deletion core/constant_inc.php
Original file line number Diff line number Diff line change
@@ -190,7 +190,6 @@
define( 'TAG_RENAMED', 27 );
define( 'BUG_REVISION_DROPPED', 28 );
define( 'BUGNOTE_REVISION_DROPPED', 29 );
define( 'BUG_REMINDER_SENT', 30 );
define( 'PLUGIN_HISTORY', 100 );

# bug revisions
4 changes: 0 additions & 4 deletions core/history_api.php
Original file line number Diff line number Diff line change
@@ -477,10 +477,6 @@ function history_localize_item( $p_field_name, $p_type, $p_old_value, $p_new_val
$p_old_value = user_get_name( $p_old_value );
$t_note = lang_get( 'bug_monitor' ) . ': ' . $p_old_value;
break;
case BUG_REMINDER_SENT:
$p_old_value = user_get_name( $p_old_value );
$t_note = lang_get( 'reminder_sent_to' ) . ': ' . $p_old_value;
break;
case BUG_UNMONITOR:
$p_old_value = user_get_name( $p_old_value );
$t_note = lang_get( 'bug_end_monitor' ) . ': ' . $p_old_value;