Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 305183 Details for
Bug 406451
3.35: Needinfo actor support
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
Patch to add needinfo actor support (v2)
needinfo_actor.patch (text/plain), 12.94 KB, created by
David Lawrence
on 2008-05-12 22:05:35 UTC
(
hide
)
Description:
Patch to add needinfo actor support (v2)
Filename:
MIME Type:
Creator:
David Lawrence
Created:
2008-05-12 22:05:35 UTC
Size:
12.94 KB
patch
obsolete
>? bugzilla-3.2rh-20080512.1.tar.gz >? bugzilla.spec >? localconfig >? patches >? data/params >Index: attachment.cgi >=================================================================== >RCS file: /cvs/qa/rh_bugzilla_3/attachment.cgi,v >retrieving revision 1.9 >diff -u -r1.9 attachment.cgi >--- attachment.cgi 3 Apr 2008 17:31:48 -0000 1.9 >+++ attachment.cgi 12 May 2008 22:01:44 -0000 >@@ -360,6 +360,14 @@ > > $bug->add_comment($comment, { isprivate => $attachment->isprivate }); > >+ # REDHAT EXTENSION START 406451 >+ # HACK: We need to call validate/process once more >+ # since we may have cleared the needinfo flag with this comment. >+ $bug->set_needinfo($comment); >+ Bugzilla::Flag::validate($bug->bug_id); >+ Bugzilla::Flag->process($bug, undef, $timestamp, $vars); >+ # REDHAT EXTENSION END 406451 >+ > # Assign the bug to the user, if they are allowed to take it > my $owner = ""; > if ($cgi->param('takebug') && $user->in_group('editbugs', $bug->product_id)) { >@@ -414,10 +422,12 @@ > # We only want attachment IDs. > @$bugattachments = map { $_->id } @$bugattachments; > >- my ($bugsummary, $product_id, $component_id) = >- $dbh->selectrow_array('SELECT short_desc, product_id, component_id >- FROM bugs >- WHERE bug_id = ?', undef, $attachment->bug_id); >+ # REDHAT EXTENSION START 406451 >+ my $bug = Bugzilla::Bug->new($attachment->bug_id); >+ my ($bugsummary, $product_id, $component_id) = >+ ($bug->short_desc, $bug->product_id, $bug->component_id); >+ $vars->{bug} = $bug; >+ # REDHAT EXTENSION END 406451 > > # Get a list of flag types that can be set for this attachment. > my $flag_types = Bugzilla::FlagType::match({ 'target_type' => 'attachment' , >@@ -500,7 +510,7 @@ > my $comment = "(From update of attachment " . $attachment->id . ")\n" . > $cgi->param('comment'); > >- $bug->add_comment($comment, { isprivate => $cgi->param('isprivate') }); >+ $bug->add_comment($comment, { isprivate => $cgi->param('isprivate') }); > } > > # The order of these function calls is important, as Flag::validate >@@ -532,6 +542,12 @@ > # the user submits at the same time. > Bugzilla::Flag->process($bug, $attachment, $timestamp, $vars); > >+ # REDHAT EXTENSION START 406451 >+ # May need to clear a needinfo flag with this comment >+ $bug->set_needinfo(scalar($cgi->param('comment'))); >+ Bugzilla::Flag->process($bug, undef, $timestamp, $vars); >+ # REDHAT END EXTENSION 406451 >+ > # Update the attachment record in the database. > $dbh->do("UPDATE attachments > SET description = ?, >Index: process_bug.cgi >=================================================================== >RCS file: /cvs/qa/rh_bugzilla_3/process_bug.cgi,v >retrieving revision 1.24 >diff -u -r1.24 process_bug.cgi >--- process_bug.cgi 9 May 2008 14:29:52 -0000 1.24 >+++ process_bug.cgi 12 May 2008 22:01:44 -0000 >@@ -330,6 +330,10 @@ > $b->add_comment(scalar($cgi->param('comment')), > { isprivate => scalar $cgi->param('commentprivacy'), > work_time => scalar $cgi->param('work_time') }); >+ # REDHAT EXTENSION START 406451 >+ # Reset needinfo flag if comment is given >+ $b->set_needinfo(scalar($cgi->param('comment'))); >+ # REDHAT EXTENSION END 406451 > } > foreach my $field_name (@set_fields) { > if (should_set($field_name)) { >@@ -522,6 +526,31 @@ > } > } > >+# REDHAT EXTENSION START 406451 >+# If needinfo is set then we need to add needinfo flag >+# for each bug with the relevant requestee >+my $needinfo_flags = Bugzilla::FlagType::match({name => 'needinfo'}); >+if (should_set('needinfo') && $cgi->param('needinfo')) { >+ $cgi->param('flag_type-' . $needinfo_flags->[0]->id, '?'); >+ if (should_set('needinfo_from') && $cgi->param('needinfo_from')) { >+ $cgi->param('requestee_type-' . $needinfo_flags->[0]->id, $cgi->param('needinfo_from')); >+ } elsif (should_set('needinfo_role') && $cgi->param('needinfo_role')) { >+ if ($cgi->param('needinfo_role') eq 'assigned_to') { >+ # Use assigned_to as requestee >+ $cgi->param('requestee_type-' . $needinfo_flags->[0]->id, $first_bug->assigned_to->login); >+ } >+ elsif ($cgi->param('needinfo_role') eq 'reporter') { >+ # Use reporter as requestee >+ $cgi->param('requestee_type-' . $needinfo_flags->[0]->id, $first_bug->reporter->login); >+ } >+ elsif ($cgi->param('needinfo_role') eq 'qa_contact') { >+ # Use qa_contact as requestee >+ $cgi->param('requestee_type-' . $needinfo_flags->[0]->id, $first_bug->qa_contact->login); >+ } >+ } >+} >+# REDHAT EXTENSION END 406451 >+ > ############################## > # Do Actual Database Updates # > ############################## >Index: Bugzilla/Bug.pm >=================================================================== >RCS file: /cvs/qa/rh_bugzilla_3/Bugzilla/Bug.pm,v >retrieving revision 1.37 >diff -u -r1.37 Bug.pm >--- Bugzilla/Bug.pm 9 May 2008 14:29:52 -0000 1.37 >+++ Bugzilla/Bug.pm 12 May 2008 22:01:44 -0000 >@@ -2144,6 +2144,14 @@ > if ($new_status->id != $old_status->id && $self->remaining_time != 0) { > $self->_zero_remaining_time(); > } >+ >+ # REDHAT EXTENSION START 406451 >+ # If we are closing this bug possibly without comment, we need to make >+ # sure that the needinfo flag is cleared. >+ my $cgi = Bugzilla->cgi; >+ $cgi->param('needinfo_override', 1); >+ $self->set_needinfo('X'); >+ # REDHAT EXTENSION END 406451 > } > } > sub set_status_whiteboard { $_[0]->set('status_whiteboard', $_[1]); } >@@ -2152,6 +2160,27 @@ > sub set_url { $_[0]->set('bug_file_loc', $_[1]); } > sub set_version { $_[0]->set('version', $_[1]); } > >+# REDHAT EXTENSION START 406451 >+# Clear the needinfo? flag if comment is being given by requestee or someone >+# used the override flag. >+sub set_needinfo { >+ my ($self, $comment) = @_; >+ my $cgi = Bugzilla->cgi; >+ return if $comment eq ""; >+ foreach my $type (@{$self->flag_types}) { >+ foreach my $flag (@{$type->{flags}}) { >+ if ($flag->name eq 'needinfo' && $flag->status eq '?') { >+ if (!$flag->requestee >+ || $flag->requestee->login eq Bugzilla->user->login >+ || $cgi->param('needinfo_override')) { >+ $cgi->param('flag-' . $flag->id, 'X'); >+ } >+ } >+ } >+ } >+} >+# REDHAT EXTENSION END 406451 >+ > ######################## > # "Add/Remove" Methods # > ######################## >Index: Bugzilla/WebService/Bug.pm >=================================================================== >RCS file: /cvs/qa/rh_bugzilla_3/Bugzilla/WebService/Bug.pm,v >retrieving revision 1.11 >diff -u -r1.11 Bug.pm >--- Bugzilla/WebService/Bug.pm 22 Apr 2008 23:59:58 -0000 1.11 >+++ Bugzilla/WebService/Bug.pm 12 May 2008 22:01:44 -0000 >@@ -775,6 +775,16 @@ > $dbh->bz_start_transaction(); > > my $timestamp = $dbh->selectrow_array(q{SELECT NOW()}); >+ >+ # REDHAT EXTENSION START 406451 >+ # Set and update flags. Unfortunately this is >+ # still done outside of Bugzilla/Bug.pm so >+ # we process them here. >+ $bug->set_needinfo($params->{comment}); >+ Bugzilla::Flag::validate($bug->bug_id); >+ Bugzilla::Flag->process($bug, undef, $timestamp, {}); >+ # REDHAT EXTENSION END 406451 >+ > my $bug_changes = $bug->update($timestamp); > $changes{$bug->bug_id} = [$bug_changes]; > >Index: extensions/compat_xmlrpc/code/webservice.pl >=================================================================== >RCS file: /cvs/qa/rh_bugzilla_3/extensions/compat_xmlrpc/code/webservice.pl,v >retrieving revision 1.33 >diff -u -r1.33 webservice.pl >--- extensions/compat_xmlrpc/code/webservice.pl 6 May 2008 05:07:29 -0000 1.33 >+++ extensions/compat_xmlrpc/code/webservice.pl 12 May 2008 22:01:44 -0000 >@@ -530,6 +530,16 @@ > work_time => $worktime, > } > ); >+ >+ # REDHAT EXTENSION START 406451 >+ # Set and update flags. Unfortunately this is >+ # still done outside of Bugzilla/Bug.pm so >+ # we process them here. >+ $bug->set_needinfo($comment); >+ Bugzilla::Flag::validate($bug->bug_id); >+ Bugzilla::Flag->process($bug, undef, $timestamp, {}); >+ # REDHAT EXTENSION END 406451 >+ > $bug->update(); > > # Send mail. >Index: template/en/default/attachment/edit.html.tmpl >=================================================================== >RCS file: /cvs/qa/rh_bugzilla_3/template/en/default/attachment/edit.html.tmpl,v >retrieving revision 1.4 >diff -u -r1.4 edit.html.tmpl >--- template/en/default/attachment/edit.html.tmpl 31 Mar 2008 18:37:00 -0000 1.4 >+++ template/en/default/attachment/edit.html.tmpl 12 May 2008 22:01:44 -0000 >@@ -267,6 +267,30 @@ > %]<br> > </div> > >+ [%# REDHAT EXTENSION START 406451 %] >+ [% FOREACH type = bug.flag_types %] >+ [% FOREACH flag = type.flags %] >+ [% IF type.name == 'needinfo' %] >+ [% needinfo_status = flag.status %] >+ [% needinfo_from = flag.requestee.login %] >+ [% END %] >+ [% END %] >+ [% END %] >+ [% IF needinfo_status == "?" %] >+ <div> >+ <small> >+ [% IF needinfo_from == user.login || needinfo_from == "" %] >+ Additional information was requested for this [% terms.bug %]. Adding comment will automatically clear needinfo request. >+ [% ELSE %] >+ <input type="checkbox" id="needinfo_override" name="needinfo_override" value="1"/> >+ <label for="needinfo_override">I am providing the requested information for this [% terms.bug %].</label> >+ [% END %] >+ </small> >+ </div> >+ <br> >+ [% END %] >+ [%# REDHAT EXTENSION END 406451 %] >+ > <input type="submit" value="Submit" id="update"><br><br> > <strong>Actions:</strong> > <a href="attachment.cgi?id=[% attachment.id %]">View</a> >Index: template/en/default/bug/edit.html.tmpl >=================================================================== >RCS file: /cvs/qa/rh_bugzilla_3/template/en/default/bug/edit.html.tmpl,v >retrieving revision 1.30 >diff -u -r1.30 edit.html.tmpl >--- template/en/default/bug/edit.html.tmpl 9 May 2008 14:29:53 -0000 1.30 >+++ template/en/default/bug/edit.html.tmpl 12 May 2008 22:01:44 -0000 >@@ -261,6 +261,35 @@ > cols = constants.COMMENT_COLS > %] > <br> >+ >+ [%# REDHAT EXTENSION START 406451 %] >+ [% IF needinfo_status != "?" && bug.status.is_open %] >+ <input type="checkbox" name="needinfo" >+ value="1" [% IF needinfo_status == "?" %]checked="true"[% END %] >+ id="needinfo"> >+ <label for="needinfo">Need additional information from</label> >+ <select name="needinfo_role" id="needinfo_role"> >+ <option value="">anyone</option> >+ <option value="reporter">reporter</option> >+ <option value="assigned_to">assignee</option> >+ [% IF Param('useqacontact') && bug.qa_contact.login != "" %] >+ <option value="qa_contact">qa contact</option> >+ [% END %] >+ </select> >+ or other <input type="text" id="needinfo_from" >+ name="needinfo_from" size="20" >+ maxsize="40" value="[% needinfo_from FILTER html %]"/> >+ <br> >+ [% ELSIF needinfo_status == "?" %] >+ [% IF needinfo_from == user.login || needinfo_from == "" %] >+ Additional information was requested for this [% terms.bug %]. Adding comment will automatically clear needinfo request. >+ [% ELSE %] >+ <input type="checkbox" id="needinfo_override" name="needinfo_override" value="1"/> >+ <label for="needinfo_override">I am providing the requested information for this [% terms.bug %].</label> >+ [% END %] >+ [% END %] >+ [%# REDHAT EXTENSION END 406451 %] >+ > <div id="knob-buttons"> > <input type="submit" value="Commit" class="commit"> > [% IF bug.user.canmove %] >Index: template/en/default/flag/list.html.tmpl >=================================================================== >RCS file: /cvs/qa/rh_bugzilla_3/template/en/default/flag/list.html.tmpl,v >retrieving revision 1.2 >diff -u -r1.2 list.html.tmpl >--- template/en/default/flag/list.html.tmpl 8 Apr 2008 14:59:01 -0000 1.2 >+++ template/en/default/flag/list.html.tmpl 12 May 2008 22:01:44 -0000 >@@ -101,6 +101,12 @@ > > [%# Step 1a: Display existing flag(s). %] > [% FOREACH flag = type.flags %] >+ [%# REDHAT EXTENSION START 406451 %] >+ [% IF type.name == 'needinfo' %] >+ [% needinfo_status = flag.status %] >+ [% needinfo_from = flag.requestee.login %] >+ [% END %] >+ [%# REDHAT EXTENSION END 406451 %] > <tr> > <td> > [% flag.setter.nick FILTER html %]:
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 406451
:
304423
|
305183
|
305190
|
305326
|
305378