summaryrefslogtreecommitdiffstats
path: root/extensions/TagNewUsers
diff options
context:
space:
mode:
authorDavid Lawrence <dlawrence@mozilla.com>2011-10-05 00:25:23 +0200
committerDavid Lawrence <dlawrence@mozilla.com>2011-10-05 00:25:23 +0200
commit57584dc4744fea59833ef355f7513690d246c70f (patch)
tree805f2b2941eca17eaf97263165d11d9e676ad9d1 /extensions/TagNewUsers
parent785580c6c290b93fe25868cfbb5d4e300749de62 (diff)
downloadbugzilla-57584dc4744fea59833ef355f7513690d246c70f.tar.gz
bugzilla-57584dc4744fea59833ef355f7513690d246c70f.tar.xz
more porting work
Diffstat (limited to 'extensions/TagNewUsers')
-rw-r--r--extensions/TagNewUsers/Extension.pm16
-rw-r--r--extensions/TagNewUsers/template/en/default/hook/bug/comments-user.html.tmpl4
2 files changed, 18 insertions, 2 deletions
diff --git a/extensions/TagNewUsers/Extension.pm b/extensions/TagNewUsers/Extension.pm
index 382a3c3d1..d71c4ea20 100644
--- a/extensions/TagNewUsers/Extension.pm
+++ b/extensions/TagNewUsers/Extension.pm
@@ -26,6 +26,7 @@ use Bugzilla::Field;
use Bugzilla::User;
use Bugzilla::Install::Util qw(indicate_progress);
use Date::Parse;
+use Scalar::Util qw(blessed);
# users younger than PROFILE_AGE days will be tagged as new
use constant PROFILE_AGE => 60;
@@ -223,4 +224,19 @@ sub _user_is_new {
|| ($user->{creation_age} <= PROFILE_AGE);
}
+sub webservice_user_get {
+ my ($self, $args) = @_;
+ my ($webservice, $params, $users) = @$args{qw(webservice params users)};
+
+ foreach my $user (@$users) {
+ # Most of the time the hash values are XMLRPC::Data objects
+ my $email = blessed $user->{'email'} ? $user->{'email'}->value : $user->{'email'};
+ if ($email) {
+ my $user_obj = Bugzilla::User->new({ name => $email });
+ $user->{'is_new'}
+ = $webservice->type('boolean', $self->_user_is_new($user_obj) ? 1 : 0);
+ }
+ }
+}
+
__PACKAGE__->NAME;
diff --git a/extensions/TagNewUsers/template/en/default/hook/bug/comments-user.html.tmpl b/extensions/TagNewUsers/template/en/default/hook/bug/comments-user.html.tmpl
index 316d381bb..274d26435 100644
--- a/extensions/TagNewUsers/template/en/default/hook/bug/comments-user.html.tmpl
+++ b/extensions/TagNewUsers/template/en/default/hook/bug/comments-user.html.tmpl
@@ -23,11 +23,11 @@
<span
class="new_user"
title="
-[%- comment.author.comment_count FILTER html %] comment[% "s" IF comment.author.comment_count != 1 -%]
+[%- comment.author.comment_count %] comment[% "s" IF comment.author.comment_count != 1 -%]
, created [%
IF comment.author.creation_age == 0 %]today[%
ELSIF comment.author.creation_age > 365 %]more than a year ago[%
-ELSE %][% comment.author.creation_age FILTER html %] day[% "s" IF comment.author.creation_age != 1 %] ago[% END %]."
+ELSE %][% comment.author.creation_age %] day[% "s" IF comment.author.creation_age != 1 %] ago[% END %]."
>
(New to [% terms.Bugzilla %])
</span>