diff --git a/bugnote_view_inc.php b/bugnote_view_inc.php index 3b6a2cf..58bd928 100644 --- a/bugnote_view_inc.php +++ b/bugnote_view_inc.php @@ -146,6 +146,24 @@ $num_notes = count( $t_bugnotes ); $t_can_delete_note = true; } + # reply button + if ( access_has_bug_level( config_get( 'add_bugnote_threshold' ), $f_bug_id ) ) { + $t_text = sprintf( + lang_get( 'in_reply_to' ), + config_get( 'bugnote_link_tag' ) . $t_bugnote->id, + user_get_name( $t_bugnote->reporter_id ) ) . + "\r\n" . + preg_replace( "/^([^\r\n]*)/m", "> $1", $t_bugnote->note ); + + echo "
"; + echo ""; + echo "
"; + } + # users above update_bugnote_threshold should be able to edit this bugnote if ( $t_can_edit_note || access_has_bug_level( config_get( 'update_bugnote_threshold' ), $f_bug_id ) ) { print_button( 'bugnote_edit_page.php?bugnote_id='.$t_bugnote->id, lang_get( 'bugnote_edit_link' ) ); diff --git a/core/string_api.php b/core/string_api.php index 407fcc6..10b1871 100644 --- a/core/string_api.php +++ b/core/string_api.php @@ -120,6 +120,18 @@ function string_nl2br( $p_string, $p_wrap = 100 ) { } /** + * Show quotes + * @param string $p_string + * @return string + */ +function string_quoting( $p_string ) { + return preg_replace( "/^(> [^\r\n]*)/m", + "$1", + $p_string ); +} + + +/** * Prepare a multiple line string for display to HTML * @param string $p_string * @return string diff --git a/javascript/dev/common.js b/javascript/dev/common.js index af6d397..b149f25 100644 --- a/javascript/dev/common.js +++ b/javascript/dev/common.js @@ -22,6 +22,13 @@ * -------------------------------------------------------- */ +function AddBugNoteText( text ) { + var dst = document.getElementsByName("bugnote_text")[0]; + dst.value += unescape(text) + "\n"; + dst.focus(); +} + + /* * String manipulation */ diff --git a/javascript/min/common.js b/javascript/min/common.js index 70c6203..ac7537a 100644 --- a/javascript/min/common.js +++ b/javascript/min/common.js @@ -1 +1,7 @@ -function Trim(d){if(typeof d!="string"){return d}var c=d;var b="";b=c.substring(0,1);while(b==" "){c=c.substring(1,c.length);b=c.substring(0,1)}b=c.substring(c.length-1,c.length);while(b==" "){c=c.substring(0,c.length-1);b=c.substring(c.length-1,c.length)}return c}function GetCookie(f){var c="MANTIS_"+f;var b=document.cookie;b=b.split(";");var d=0;while(d