Commit 324479e5 authored by lpsolit%gmail.com's avatar lpsolit%gmail.com

Bug 95923: Don't let users change fields they aren't allowed to change - Patch…

Bug 95923: Don't let users change fields they aren't allowed to change - Patch by Olav Vitters <bugzilla-mozilla@bkor.dhs.org> r=LpSolit a=justdave
parent 146d47f6
...@@ -159,10 +159,7 @@ ...@@ -159,10 +159,7 @@
<td align="right"> <td align="right">
<label for="alias" title="a name for the [% terms.bug %] that can be used in place of its ID number, f.e. when adding it to a list of dependencies"><b>Alias</b></label>: <label for="alias" title="a name for the [% terms.bug %] that can be used in place of its ID number, f.e. when adding it to a list of dependencies"><b>Alias</b></label>:
</td> </td>
<td> [% PROCESS input inputname => "alias" size => "20" maxlength => "20" %]
<input id="alias" name="alias" value="[% bug.alias FILTER html %]"
size="20" maxlength="20">
</td>
</tr> </tr>
[% END %] [% END %]
...@@ -340,6 +337,7 @@ ...@@ -340,6 +337,7 @@
<label for="qa_contact" accesskey="q"><b><u>Q</u>A Contact</b></label>: <label for="qa_contact" accesskey="q"><b><u>Q</u>A Contact</b></label>:
</td> </td>
<td colspan="7"> <td colspan="7">
[% IF bug.check_can_change_field("qa_contact", 0, 1) || !user.id %]
[% INCLUDE global/userselect.html.tmpl [% INCLUDE global/userselect.html.tmpl
id => "qa_contact" id => "qa_contact"
name => "qa_contact" name => "qa_contact"
...@@ -347,6 +345,17 @@ ...@@ -347,6 +345,17 @@
size => 60 size => 60
emptyok => 1 emptyok => 1
%] %]
[% ELSE %]
<input type="hidden" name="qa_contact"
value="[% bug.qa_contact.login FILTER html %]">
[% IF bug.qa_contact.login && bug.qa_contact.login.length > 60 %]
<span title="[% bug.qa_contact.login FILTER html %]">
[% bug.qa_contact.login FILTER truncate(60) FILTER html %]
</span>
[% ELSE %]
[% bug.qa_contact.login FILTER html %]
[% END %]
[% END %]
</td> </td>
</tr> </tr>
[% END %] [% END %]
...@@ -362,21 +371,15 @@ ...@@ -362,21 +371,15 @@
[% END %] [% END %]
[%%]</b></label>: [%%]</b></label>:
</td> </td>
<td colspan="5"> [% PROCESS input inputname => "bug_file_loc" size => "60" colspan => 5 %]
<input name="bug_file_loc" id="bug_file_loc"
value="[% bug.bug_file_loc FILTER html %]" size="60">
</td>
</tr> </tr>
<tr> <tr>
<td align="right"> <td align="right">
<label for="short_desc" accesskey="s"><b><u>S</u>ummary</b></label>: <label for="short_desc" accesskey="s"><b><u>S</u>ummary</b></label>:
</td> </td>
<td colspan="5"> [% PROCESS input inputname => "short_desc" size => "60" colspan => 5
<input name="short_desc" id="short_desc" maxlength => 255 %]
value="[% bug.short_desc FILTER html %]" size="60"
maxlength="255">
</td>
</tr> </tr>
[% IF Param('usestatuswhiteboard') %] [% IF Param('usestatuswhiteboard') %]
...@@ -385,10 +388,8 @@ ...@@ -385,10 +388,8 @@
<label for="status_whiteboard" accesskey="w"><b>Status <label for="status_whiteboard" accesskey="w"><b>Status
<u>W</u>hiteboard</b></label>: <u>W</u>hiteboard</b></label>:
</td> </td>
<td colspan="5"> [% PROCESS input inputname => "status_whiteboard" size => "60"
<input name="status_whiteboard" id="status_whiteboard" colspan => 5 %]
value="[% bug.status_whiteboard FILTER html %]" size="60">
</td>
</tr> </tr>
[% END %] [% END %]
...@@ -396,10 +397,8 @@ ...@@ -396,10 +397,8 @@
<tr> <tr>
<td align="right"> <td align="right">
<label for="keywords" accesskey="k"><b><a href="describekeywords.cgi"><u>K</u>eywords</a></b></label>: <label for="keywords" accesskey="k"><b><a href="describekeywords.cgi"><u>K</u>eywords</a></b></label>:
<td colspan="5"> [% PROCESS input inputname => "keywords" size => 60 colspan => 5
<input name="keywords" id="keywords" value => bug.keywords.join(', ') %]
value="[% bug.keywords.join(', ') FILTER html %]" size="60">
</td>
</tr> </tr>
[% END %] [% END %]
...@@ -683,8 +682,13 @@ ...@@ -683,8 +682,13 @@
[% END %] [% END %]
</td> </td>
<td> <td>
[% IF bug.check_can_change_field(dep.fieldname, 0, 1) || !user.id %]
<input name="[% dep.fieldname %]" id="[% dep.fieldname %]" <input name="[% dep.fieldname %]" id="[% dep.fieldname %]"
value="[% bug.${dep.fieldname}.join(', ') %]"> value="[% bug.${dep.fieldname}.join(', ') %]">
[% ELSE %]
<input type="hidden" name="[% dep.fieldname %]"
value="[% bug.${dep.fieldname}.join(', ') %]">
[% END %]
</td> </td>
[% END %] [% END %]
...@@ -695,6 +699,7 @@ ...@@ -695,6 +699,7 @@
[% BLOCK select %] [% BLOCK select %]
<td> <td>
[% IF bug.check_can_change_field(selname, 0, 1) || !user.id %]
<select id="[% selname %]" name="[% selname %]"> <select id="[% selname %]" name="[% selname %]">
[% FOREACH x = bug.choices.${selname} %] [% FOREACH x = bug.choices.${selname} %]
<option value="[% x FILTER html %]" <option value="[% x FILTER html %]"
...@@ -702,5 +707,38 @@ ...@@ -702,5 +707,38 @@
</option> </option>
[% END %] [% END %]
</select> </select>
[% ELSE %]
<input type="hidden" name="[% selname %]" value="[% bug.${selname} FILTER html %]">
[% bug.${selname} FILTER html %]
[% END %]
</td>
[% END %]
[%############################################################################%]
[%# Block for INPUT fields #%]
[%############################################################################%]
[% BLOCK input %]
<td[% " colspan=\"$colspan\"" IF $colspan %]>
[% val = value ? value : bug.$inputname %]
[% IF bug.check_can_change_field(inputname, 0, 1) || !user.id %]
<input id="[% inputname %]" name="[% inputname %]"
value="[% val FILTER html %]"[% " size=\"$size\"" IF size %]
[% " maxlength=\"$maxlength\"" IF maxlength %]>
[% ELSE %]
<input type="hidden" name="[% inputname %]" id="[% inputname %]"
value="[% val FILTER html %]">
[% IF size && val.length > size %]
<span title="[% val FILTER html %]">
[% val FILTER truncate(size) FILTER html %]
</span>
[% ELSE %]
[% val FILTER html %]
[% END %]
[% END %]
</td> </td>
[% maxlength = 0 %]
[% colspan = 0 %]
[% size = 0 %]
[% value = undef %]
[% END %] [% END %]
...@@ -324,6 +324,10 @@ ...@@ -324,6 +324,10 @@
'depbug FILTER bug_link(depbug)', 'depbug FILTER bug_link(depbug)',
'"${bug.dup_id}" FILTER bug_link(bug.dup_id)', '"${bug.dup_id}" FILTER bug_link(bug.dup_id)',
'" accesskey=\"$accesskey\"" IF accesskey', '" accesskey=\"$accesskey\"" IF accesskey',
'inputname',
'" colspan=\"$colspan\"" IF $colspan',
'" size=\"$size\"" IF size',
'" maxlength=\"$maxlength\"" IF maxlength'
], ],
'bug/knob.html.tmpl' => [ 'bug/knob.html.tmpl' => [
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment