Bug 54779 - Fix user match form

git-svn-id: svn://svn.office.custis.ru/3rdparty/bugzilla.org/trunk@1426 6955db30-a419-402b-8a0d-67ecbb4d7f56
master
vfilippov 2011-10-12 14:36:42 +00:00
parent 08b4edaf0a
commit 3c683b278f
7 changed files with 32 additions and 26 deletions

BIN
images/collapse.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 115 B

BIN
images/expand.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 112 B

View File

@ -355,6 +355,8 @@ foreach my $b (@bug_objects)
{
my $method = $methods{$field_name};
$method ||= "set_" . $field_name;
use Data::Dumper;
die Dumper $ARGS->{$field_name} if ref $ARGS->{$field_name} eq 'ARRAY';
$b->$method($ARGS->{$field_name} || '');
}
}

View File

@ -123,24 +123,23 @@
<div class="bz_comment_worktime">
[% PROCESS formattimeunit time_unit=comment.work_time %]h
</div>
[% END %]
[% IF comment.type == constants.CMT_WORKTIME
&& (comment.who == user.id || user.in_group('worktimeadmin')) %]
<div class="bz_comment_unmark_wtonly" id="unmark_wtonly_[% comment.id %]" style="display: none">
<img src="images/clockx.gif" width="16" height="16"
alt="Mark comment as worktime-only" title="Mark comment as normal"
<img src="images/expand.gif" width="16" height="16"
alt="Mark comment as normal (expand by default)" title="Mark comment as normal (expand by default)"
style="cursor: pointer; vertical-align: middle"
onclick="mark_wtonly([% comment.id %],1,this)" />
<span id="wtonly_cont_[% comment.id %]" style="display: none">
<input style="vertical-align: middle" type="checkbox"
name="cmt_normal_[% comment.id %]" id="cmt_normal_[% comment.id %]" value="1" />
<label style="vertical-align: middle" for="cmt_normal_[% comment.id %]">Mark comment as normal</label>
<label style="vertical-align: middle" for="cmt_normal_[% comment.id %]">Expand by default</label>
</span>
</div>
[% END %]
[% END %]
<div style="clear: both"></div>
</div>
@ -151,14 +150,14 @@
[%+ PROCESS formattimeunit time_unit=comment.work_time %]
[% IF (comment.who == user.id OR user.in_group('worktimeadmin'))
AND comment.type == constants.CMT_NORMAL %]
<img src="images/clock.gif" width="16" height="16"
alt="Mark comment as worktime-only" title="Mark comment as worktime-only"
<img src="images/collapse.gif" width="16" height="16"
alt="Collapse by default" title="Collapse by default"
style="cursor: pointer; vertical-align: middle"
onclick="mark_wtonly([% comment.id %],0,this)" />
<span id="wtonly_cont_[% comment.id %]" style="display: none">
<input style="vertical-align: middle" type="checkbox"
name="cmt_worktime_[% comment.id %]" id="cmt_worktime_[% comment.id %]" value="1" />
<label style="vertical-align: middle" for="cmt_worktime_[% comment.id %]">Mark comment as worktime only</label>
<label style="vertical-align: middle" for="cmt_worktime_[% comment.id %]">Collapse by default</label>
</span>
[% END %]
[% END %]

View File

@ -974,7 +974,7 @@ document.changeform = document.[% cfname %];
<label for="commentsilent">Silent</label>
<input type="checkbox" name="cmt_worktime" value="1" id="cmt_worktime"
onclick="if(this.checked)document.getElementById('commentsilent').checked=true" />
<label for="cmt_worktime">Worktime only</label>
<label for="cmt_worktime">Collapse by default</label>
<!-- This table keeps the submit button aligned with the box. -->
<table><tr><td>

View File

@ -38,19 +38,21 @@
[%# use the global field descs %]
[%# This lists fields which use the user auto-completion feature and which
# are not listed in field_descs. %]
[% field_labels = { # Used by editcomponents.cgi
"initialcc" => "Default CC List",
"initialowner" => "Default Assignee",
"initialqacontact" => "Default QA Contact",
# Used by process_bug.cgi
"masscc" => "CC List",
# Used by request.cgi
"requester" => "Requester",
"requestee" => "Requestee",
# Used by userprefs.cgi
"new_watchedusers" => "Watch List",
# Used by superworktime
"worktime_user" => "Worktime user",
[%# FIXME move away from here %]
[% field_labels = {
# Used by editcomponents.cgi
"initialcc" => "Default CC List",
"initialowner" => "Default Assignee",
"initialqacontact" => "Default QA Contact",
# Used by process_bug.cgi
"masscc" => "CC List",
# Used by request.cgi
"requester" => "Requester",
"requestee" => "Requestee",
# Used by userprefs.cgi
"new_watchedusers" => "Watch List",
# Used by superworktime
"worktime_user" => "Worktime user",
}
%]
[% IF matchsuccess == 1 %]
@ -103,7 +105,12 @@
[%# this is messy to allow later expansion %]
[% exclude_hash = {
Bugzilla_login => 1
Bugzilla_password => 1
} %]
[% FOREACH field = matches %]
[% exclude_hash.${field.key} = 1 %]
<tr>
<td align="left" valign="top">
[% PROCESS field_names field_name=field.key %]:
@ -174,7 +181,7 @@
[% IF matchsuccess == 1 %]
[% PROCESS "global/hidden-fields.html.tmpl" exclude="^Bugzilla_(login|password)$" %]
[% PROCESS "global/hidden-fields.html.tmpl" exclude_hash = exclude_hash %]
<p>
<input type="submit" id="continue" value="Continue" />
@ -190,9 +197,7 @@
[% PROCESS global/footer.html.tmpl %]
[% BLOCK field_names %]
[% IF field_descs.$field_name %]
[% field_descs.$field_name FILTER html %]
[% ELSIF field_labels.$field_name %]
@ -202,5 +207,4 @@
[% ELSE %]
[% field_name FILTER html %]
[% END %]
[% END %]

View File

@ -29,6 +29,7 @@
[%# Generate hidden form fields for non-excluded fields. %]
[% FOREACH field = cgi.param() %]
[% NEXT IF exclude_hash && exclude_hash.${field} %]
[% NEXT IF exclude && field.search(exclude) %]
[%# The '.slice(0)' bit is here to force the 'param(field)' to be evaluated
in a list context, so we can avoid extra code checking for single valued or