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 307137 Details for
Bug 448774
Display release notes field when bug is inaccessible
[?]
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 display public fields for private bugs (v1)
public_fields.patch (text/plain), 10.26 KB, created by
David Lawrence
on 2008-05-29 20:53:35 UTC
(
hide
)
Description:
Patch to display public fields for private bugs (v1)
Filename:
MIME Type:
Creator:
David Lawrence
Created:
2008-05-29 20:53:35 UTC
Size:
10.26 KB
patch
obsolete
>? bugzilla-3.2rh-20080529.1.tar.gz >? bugzilla.spec >? localconfig >? patches >? data/params >Index: editfields.cgi >=================================================================== >RCS file: /cvs/qa/rh_bugzilla_3/editfields.cgi,v >retrieving revision 1.2 >diff -u -r1.2 editfields.cgi >--- editfields.cgi 11 Feb 2008 03:19:45 -0000 1.2 >+++ editfields.cgi 29 May 2008 20:50:19 -0000 >@@ -65,6 +65,9 @@ > enter_bug => scalar $cgi->param('enter_bug'), > obsolete => scalar $cgi->param('obsolete'), > custom => 1, >+ # REDHAT EXTENSION START 448774 >+ public => scalar $cgi->param('public'), >+ # REDHAT EXTENSION END 448774 > }); > > delete_token($token); >@@ -107,6 +110,11 @@ > $field->set_in_new_bugmail($cgi->param('new_bugmail')); > $field->set_enter_bug($cgi->param('enter_bug')); > $field->set_obsolete($cgi->param('obsolete')); >+ >+ # REDHAT EXTENSION START 448774 >+ $field->set_public($cgi->param('public')); >+ # REDHAT EXTENSION END 448774 >+ > $field->update(); > > delete_token($token); >Index: Bugzilla/Bug.pm >=================================================================== >RCS file: /cvs/qa/rh_bugzilla_3/Bugzilla/Bug.pm,v >retrieving revision 1.40 >diff -u -r1.40 Bug.pm >--- Bugzilla/Bug.pm 28 May 2008 16:53:32 -0000 1.40 >+++ Bugzilla/Bug.pm 29 May 2008 20:50:22 -0000 >@@ -3585,11 +3585,28 @@ > # are not authorized to see the bug. Display an error and stop execution. > # The error the user sees depends on whether or not they are logged in > # (i.e. $user->id contains the user's positive integer ID). >+ >+ # REDHAT EXTENSION START 448774 >+ my $bug = Bugzilla::Bug->new($id); >+ my @public_data; >+ my $public_fields = Bugzilla::Field->match({custom => 1, obsolete => 0, public => 1}); >+ foreach my $field (@$public_fields) { >+ if ($bug->{$field->name}) { >+ $field->{'value'} = $bug->{$field->name}; >+ push(@public_data, $field); >+ } >+ } >+ > if ($user->id) { >- ThrowUserError("bug_access_denied", {'bug_id' => $id}); >+ ThrowUserError("bug_access_denied", >+ {'bug_id' => $id, >+ 'public_data' => \@public_data}); > } else { >- ThrowUserError("bug_access_query", {'bug_id' => $id}); >+ ThrowUserError("bug_access_query", >+ {'bug_id' => $id, >+ 'public_data' => \@public_data}); > } >+ # REDHAT EXTENSION END 448774 > } > > # Validate and return a hash of dependencies >Index: Bugzilla/Field.pm >=================================================================== >RCS file: /cvs/qa/rh_bugzilla_3/Bugzilla/Field.pm,v >retrieving revision 1.8 >diff -u -r1.8 Field.pm >--- Bugzilla/Field.pm 17 Mar 2008 21:48:07 -0000 1.8 >+++ Bugzilla/Field.pm 29 May 2008 20:50:23 -0000 >@@ -91,6 +91,9 @@ > 'sortkey', > 'obsolete', > 'enter_bug', >+ # REDHAT EXTENSION START 448774 >+ 'public', >+ # REDHAT EXTENSION END 448774 > ); > > use constant REQUIRED_CREATE_FIELDS => qw(name description); >@@ -103,15 +106,20 @@ > obsolete => \&_check_obsolete, > sortkey => \&_check_sortkey, > type => \&_check_type, >+ # REDHAT EXTENSION START 448774 >+ public => \&_check_public, >+ # REDHAT EXTENSION END 448774 > }; > >+# REDHAT EXTENSION START 448774 > use constant UPDATE_COLUMNS => qw( > description > mailhead > sortkey > obsolete >- enter_bug >+ public > ); >+# REDHAT EXTENSION END 448774 > > # How various field types translate into SQL data definitions. > use constant SQL_DEFINITIONS => { >@@ -202,6 +210,10 @@ > > sub _check_mailhead { return $_[1] ? 1 : 0; } > >+# REDHAT EXTENSION START 448774 >+sub _check_public { return $_[1] ? 1 : 0; } >+# REDHAT EXTENSION END 448774 >+ > sub _check_name { > my ($invocant, $name, $is_custom) = @_; > $name = lc(clean_text($name)); >@@ -375,6 +387,19 @@ > return $self->{'legal_values'}; > } > >+=item C<public> >+ >+A boolean specifying whether or not this field is visible always even if >+the bug is marked private and is inaccessible to the user. >+ >+=back >+ >+=cut >+ >+# REDHAT EXTENSION START 448774 >+sub public { return $_[0]->{public} } >+# REDHAT EXTENSION END 448774 >+ > =pod > > =head2 Instance Mutators >@@ -397,6 +422,8 @@ > > =item C<set_in_new_bugmail> > >+=item C<set_public> >+ > =back > > =cut >@@ -407,6 +434,10 @@ > sub set_sortkey { $_[0]->set('sortkey', $_[1]); } > sub set_in_new_bugmail { $_[0]->set('mailhead', $_[1]); } > >+# REDHAT EXTENSION START 448774 >+sub set_public { $_[0]->set('public', $_[1]); } >+# REDHAT EXTENSION END 448774 >+ > =pod > > =head2 Instance Method >@@ -520,6 +551,9 @@ > =item C<enter_bug> - boolean - Whether this field is > editable on the bug creation form. Defaults to 0. > >+=item C<public> - boolean - Whether this field is always visible even if bug is private and >+inaccessible to the user. >+ > C<obsolete> - boolean - Whether this field is obsolete. Defaults to 0. > > =back >Index: Bugzilla/DB/Schema.pm >=================================================================== >RCS file: /cvs/qa/rh_bugzilla_3/Bugzilla/DB/Schema.pm,v >retrieving revision 1.15 >diff -u -r1.15 Schema.pm >--- Bugzilla/DB/Schema.pm 17 Apr 2008 14:54:50 -0000 1.15 >+++ Bugzilla/DB/Schema.pm 29 May 2008 20:50:26 -0000 >@@ -693,6 +693,9 @@ > sortkey => {TYPE => 'INT2', NOTNULL => 1}, > obsolete => {TYPE => 'BOOLEAN', DEFAULT => 'FALSE'}, > enter_bug => {TYPE => 'BOOLEAN', DEFAULT => 'FALSE'}, >+ # REDHAT EXTENSION START 448774 >+ public => {TYPE => 'BOOLEAN', DEFAULT => 'FALSE'}, >+ # REDHAT EXTENSION END 448774 > ], > INDEXES => [ > fielddefs_name_idx => {FIELDS => ['name'], >Index: Bugzilla/Install/DB.pm >=================================================================== >RCS file: /cvs/qa/rh_bugzilla_3/Bugzilla/Install/DB.pm,v >retrieving revision 1.12 >diff -u -r1.12 DB.pm >--- Bugzilla/Install/DB.pm 8 May 2008 03:00:29 -0000 1.12 >+++ Bugzilla/Install/DB.pm 29 May 2008 20:50:29 -0000 >@@ -532,6 +532,10 @@ > # 2008-04-01 dkl@redhat.com - Bug 426382 > $dbh->bz_add_column('logincookies', 'javascript', > { TYPE => 'BOOLEAN', DEFAULT => 0 }); >+ >+ # 2008-05-29 dkl@redhat.com - Bug 448774 >+ $dbh->bz_add_column('fielddefs', 'public', >+ { TYPE => 'BOOLEAN', DEFAULT => 0 }); > > ################################################################ > # New --TABLE-- changes should go *** A B O V E *** this point # >Index: template/en/default/admin/custom_fields/create.html.tmpl >=================================================================== >RCS file: /cvs/qa/rh_bugzilla_3/template/en/default/admin/custom_fields/create.html.tmpl,v >retrieving revision 1.1.1.1 >diff -u -r1.1.1.1 create.html.tmpl >--- template/en/default/admin/custom_fields/create.html.tmpl 19 Nov 2007 22:11:21 -0000 1.1.1.1 >+++ template/en/default/admin/custom_fields/create.html.tmpl 29 May 2008 20:50:31 -0000 >@@ -97,8 +97,8 @@ > <input type="text" id="sortkey" name="sortkey" size="6" maxlength="6"> > </td> > >- <th> </th> >- <td> </td> >+ <th align="right"><label for="public">Is public:</label></th> >+ <td><input type="checkbox" id="public" name="public" value="1"></td> > </tr> > </table> > <p> >Index: template/en/default/admin/custom_fields/edit.html.tmpl >=================================================================== >RCS file: /cvs/qa/rh_bugzilla_3/template/en/default/admin/custom_fields/edit.html.tmpl,v >retrieving revision 1.2 >diff -u -r1.2 edit.html.tmpl >--- template/en/default/admin/custom_fields/edit.html.tmpl 11 Feb 2008 03:19:45 -0000 1.2 >+++ template/en/default/admin/custom_fields/edit.html.tmpl 29 May 2008 20:50:31 -0000 >@@ -83,8 +83,9 @@ > value="[% field.sortkey FILTER html %]"> > </td> > >- <th> </th> >- <td> </td> >+ <th align="right"><label for="public">Is public:</label></th> >+ <td><input type="checkbox" id="public" name="public" value="1" >+ [%- " checked" IF field.public %]></td> > </tr> > [% IF field.type == constants.FIELD_TYPE_SINGLE_SELECT > || field.type == constants.FIELD_TYPE_MULTI_SELECT %] >Index: template/en/default/admin/custom_fields/list.html.tmpl >=================================================================== >RCS file: /cvs/qa/rh_bugzilla_3/template/en/default/admin/custom_fields/list.html.tmpl,v >retrieving revision 1.2 >diff -u -r1.2 list.html.tmpl >--- template/en/default/admin/custom_fields/list.html.tmpl 11 Feb 2008 03:19:45 -0000 1.2 >+++ template/en/default/admin/custom_fields/list.html.tmpl 29 May 2008 20:50:31 -0000 >@@ -57,6 +57,10 @@ > heading => "Is Obsolete" > }, > { >+ name => "public" >+ heading => "Is Public" >+ }, >+ { > name => "action" > heading => "Action" > content => "" >Index: template/en/default/bug/field.html.tmpl >=================================================================== >RCS file: /cvs/qa/rh_bugzilla_3/template/en/default/bug/field.html.tmpl,v >retrieving revision 1.5 >diff -u -r1.5 field.html.tmpl >--- template/en/default/bug/field.html.tmpl 26 May 2008 03:31:09 -0000 1.5 >+++ template/en/default/bug/field.html.tmpl 29 May 2008 20:50:32 -0000 >@@ -33,7 +33,7 @@ > [% IF editable %] > <label for="[% field.name FILTER html %]"> > [% END %] >- [% field_descs.${field.name} FILTER html %]: >+ [% field_descs.${field.name} FILTER html %][% " (Public)" IF field.public %]: > [% '</label>' IF editable %] > </th> > >Index: template/en/default/global/user-error.html.tmpl >=================================================================== >RCS file: /cvs/qa/rh_bugzilla_3/template/en/default/global/user-error.html.tmpl,v >retrieving revision 1.27 >diff -u -r1.27 user-error.html.tmpl >--- template/en/default/global/user-error.html.tmpl 14 May 2008 03:28:19 -0000 1.27 >+++ template/en/default/global/user-error.html.tmpl 29 May 2008 20:50:34 -0000 >@@ -1694,6 +1694,20 @@ > </tr> > </table> > >+[%# REDHAT EXTENSION START 448774 %] >+[% IF public_data %] >+ <h3>[% terms.Bug %] [% bug_id FILTER html %] - Public Information</h3> >+ <table> >+ [% FOREACH p = public_data %] >+ <tr> >+ <th align="right">[% p.description FILTER html %]: </th> >+ <td>[% p.value FILTER html %]</td> >+ </tr> >+ [% END %] >+ </table> >+[% END %] >+[%# REDHAT EXTENSION END 448774 %] >+ > <p> > Please press <b>Back</b> and try again. > </p>
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 448774
:
306982
|
307137
|
307159