diff options
author | Dylan William Hardison <dylan@mozilla.com> | 2015-04-28 07:28:36 +0200 |
---|---|---|
committer | Byron Jones <glob@mozilla.com> | 2015-04-28 07:28:36 +0200 |
commit | 2d50ce5613761739d6548b3145db9c963c52f59d (patch) | |
tree | 50ef3d32d749ee86ddca1fe7a0f758a2d64e9d24 | |
parent | c19995a905335b5243299006223a50ad0617c097 (diff) | |
download | bugzilla-2d50ce5613761739d6548b3145db9c963c52f59d.tar.gz bugzilla-2d50ce5613761739d6548b3145db9c963c52f59d.tar.xz |
Bug 1154026: Pre-fill Bounty Attachment form fields for e.g. date and reporter
-rw-r--r-- | extensions/BMO/Extension.pm | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/extensions/BMO/Extension.pm b/extensions/BMO/Extension.pm index a1baea7bc..c362d37f7 100644 --- a/extensions/BMO/Extension.pm +++ b/extensions/BMO/Extension.pm @@ -264,6 +264,18 @@ sub bounty_attachment { if ($attachment) { $vars->{form} = $attachment->bounty_details; } + else { + my $now = $dbh->selectrow_array('SELECT LOCALTIMESTAMP(0)'); + $vars->{form} = { + reporter_email => $bug->reporter->email, + reported_date => format_time($bug->creation_ts, "%Y-%m-%d"), + awarded_date => format_time($now, "%Y-%m-%d"), + publish => 1 + }; + if ($bug->cf_last_resolved) { + $vars->{form}{fixed_date} = format_time($bug->cf_last_resolved, "%Y-%m-%d"), + } + } } sub _attachment_is_bounty_attachment { |