summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDave Lawrence <dlawrence@mozilla.com>2013-03-01 04:56:07 +0100
committerDave Lawrence <dlawrence@mozilla.com>2013-03-01 04:56:07 +0100
commitadc18bde393984f64e877cf15c444be30c621307 (patch)
tree31cd93b1ffee6f5304bd050d639b43c1a79c93b0
parentfe4460ca51a5e4f94b700ab959065feedac3012a (diff)
downloadbugzilla-adc18bde393984f64e877cf15c444be30c621307.tar.gz
bugzilla-adc18bde393984f64e877cf15c444be30c621307.tar.xz
More dashboard improvements
-rw-r--r--extensions/MyDashboard/lib/WebService.pm23
-rw-r--r--extensions/MyDashboard/template/en/default/pages/mydashboard.html.tmpl2
-rw-r--r--extensions/MyDashboard/web/js/flags.js4
3 files changed, 18 insertions, 11 deletions
diff --git a/extensions/MyDashboard/lib/WebService.pm b/extensions/MyDashboard/lib/WebService.pm
index 07619e705..e9ea2315f 100644
--- a/extensions/MyDashboard/lib/WebService.pm
+++ b/extensions/MyDashboard/lib/WebService.pm
@@ -13,7 +13,7 @@ use base qw(Bugzilla::WebService Bugzilla::WebService::Bug);
use Bugzilla::Constants;
use Bugzilla::Error;
-use Bugzilla::Util qw(detaint_natural trick_taint);
+use Bugzilla::Util qw(detaint_natural trick_taint template_var);
use Bugzilla::WebService::Util qw(validate);
use Bugzilla::Extension::MyDashboard::Queries qw(QUERY_DEFS query_bugs query_flags);
@@ -109,11 +109,16 @@ sub run_bug_query {
foreach my $b (@$bugs) {
my $last_changes = {};
my $activity = $self->history({ ids => [ $b->{bug_id} ],
- start_time => $b->{changeddate} });
+ start_time => $b->{changeddate} });
if (@{$activity->{bugs}[0]{history}}) {
- $last_changes->{activity} = $activity->{bugs}[0]{history}[0]{changes};
- $last_changes->{email} = $activity->{bugs}[0]{history}[0]{who};
- $last_changes->{when} = $activity->{bugs}[0]{history}[0]{when};
+ my $change_set = $activity->{bugs}[0]{history}[0];
+ $last_changes->{activity} = $change_set->{changes};
+ foreach my $change (@{ $last_changes->{activity} }) {
+ $change->{field_desc}
+ = template_var('field_descs')->{$change->{field_name}} || $change->{field_name};
+ }
+ $last_changes->{email} = $change_set->{who};
+ $last_changes->{when} = $self->datetime_format_inbound($change_set->{when});
}
my $last_comment_id = $dbh->selectrow_array("
SELECT comment_id FROM longdescs
@@ -121,9 +126,11 @@ sub run_bug_query {
undef, $b->{bug_id}, $b->{changeddate});
if ($last_comment_id) {
my $comments = $self->comments({ comment_ids => [ $last_comment_id ] });
- $last_changes->{comment} = $comments->{comments}{$last_comment_id}{text};
- $last_changes->{email} = $comments->{comments}{$last_comment_id}{creator} if !$last_changes->{email};
- $last_changes->{when} = $comments->{comments}{$last_comment_id}{creation_time} if !$last_changes->{when};
+ my $comment = $comments->{comments}{$last_comment_id};
+ $last_changes->{comment} = $comment->{text};
+ $last_changes->{email} = $comment->{creator} if !$last_changes->{email};
+ $last_changes->{when}
+ = $self->datetime_format_inbound($comment->{creation_time}) if !$last_changes->{when};
}
$b->{last_changes} = $last_changes;
}
diff --git a/extensions/MyDashboard/template/en/default/pages/mydashboard.html.tmpl b/extensions/MyDashboard/template/en/default/pages/mydashboard.html.tmpl
index 7054e6934..72705eb02 100644
--- a/extensions/MyDashboard/template/en/default/pages/mydashboard.html.tmpl
+++ b/extensions/MyDashboard/template/en/default/pages/mydashboard.html.tmpl
@@ -34,7 +34,7 @@
<table id="activity">
{{#each activity}}
<tr>
- <td class="field_label">{{field_name}}:</td>
+ <td class="field_label">{{field_desc}}:</td>
<td class="field_data">
{{#if removed}}
{{#unless added}}
diff --git a/extensions/MyDashboard/web/js/flags.js b/extensions/MyDashboard/web/js/flags.js
index 6820ec289..89b381138 100644
--- a/extensions/MyDashboard/web/js/flags.js
+++ b/extensions/MyDashboard/web/js/flags.js
@@ -66,8 +66,8 @@ YUI({
};
var bugLinkFormatter = function (o) {
- return '<a href="show_bug.cgi?id=' + encodeURIComponent(o.value) +
- ' target="_blank" ' + 'title="' + Y.Escape.html(o.data.bug_status) + ' - ' +
+ return '<a href="show_bug.cgi?id=' + encodeURIComponent(o.value) +
+ '" target="_blank" ' + 'title="' + Y.Escape.html(o.data.bug_status) + ' - ' +
Y.Escape.html(o.data.bug_summary) + '">' + o.value + '</a>';
};