Skip to content

Commit

Permalink
Simplify code, align to guidelines
Browse files Browse the repository at this point in the history
  • Loading branch information
dregad committed Apr 19, 2013
1 parent dab98da commit d75c2fb
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions core/email_api.php
Original file line number Diff line number Diff line change
Expand Up @@ -1064,21 +1064,20 @@ function email_smtp_close() {
* @return null
*/
function email_build_subject( $p_bug_id ) {
$t_bug_id = $p_bug_id;

# grab the project name
$p_project_name = project_get_field( bug_get_field( $p_bug_id, 'project_id' ), 'name' );

# grab the subject (summary)
$p_subject = bug_get_field( $p_bug_id, 'summary' );

# padd the bug id with zeros
$p_bug_id = bug_format_id( $t_bug_id );
# pad the bug id with zeros
$t_bug_id = bug_format_id( $p_bug_id );

$t_email_subject = '[' . $p_project_name . ' ' . $p_bug_id . ']: ' . $p_subject;
# build standard subject string
$t_email_subject = "[$p_project_name $t_bug_id]: $p_subject";

#update subject as defined by plugins
$t_email_subject = event_signal('EVENT_DISPLAY_EMAIL_BUILD_SUBJECT', $t_email_subject, array('bug_id' => $t_bug_id));
# update subject as defined by plugins
$t_email_subject = event_signal( 'EVENT_DISPLAY_EMAIL_BUILD_SUBJECT', $t_email_subject, array( 'bug_id' => $p_bug_id ) );

return $t_email_subject;
}
Expand Down

0 comments on commit d75c2fb

Please sign in to comment.