Update percent bar and links for new bugs when updating a case-run.

Minor bug fixes.
This commit is contained in:
ghendricks%novell.com 2007-03-07 21:14:34 +00:00
Родитель 7cbe106768
Коммит 3433326ddd
12 изменённых файлов: 88 добавлений и 41 удалений

Просмотреть файл

@ -410,7 +410,7 @@ sub get_url {
}
my @vals = $cgi->param($key);
foreach my $val (@vals){
$qstring .= $key ."=". $val ."&";
$qstring .= $key ."=". url_quote($val) ."&";
}
}
chop $qstring;
@ -427,7 +427,7 @@ sub get_query_part {
foreach my $key (@keys){
my @vals = $cgi->param($key);
foreach my $val (@vals){
$qstring .= $key ."=". $val ."&";
$qstring .= $key ."=". url_quote($val) ."&";
}
}
chop $qstring;

Просмотреть файл

@ -124,6 +124,9 @@
[% ELSIF error == "testopia-plan-acl-denied" %]
[% title = "Plan Administrator Privileges Required" %]
You must be an administrator of this test plan to modify the access control list.
[% ELSIF error == "testopia-no-admins" %]
[% title = "Plan Must Have at Least One Admin" %]
There do not seem to be any admins selected. You must select at least one admin for this test plan.
[% ELSIF error == "testopia-format-error" %]
[% title = "Field format error" %]
[% field %] is not formatted correctly.

Просмотреть файл

@ -22,7 +22,7 @@
[%##### BEGIN Hidden Pane #####%]
<td colspan="12" style="margin:0px;padding:0px; border-bottom: 1px solid #000;">
<div id="ra[% index %]" class="ae_dv">
<div id="ra[% index %]" style="margin-left:15px;border-width:0px;[% 'display:none;' UNLESS updating %]">
[%##### Action, Expected Results #####%]
<table class="ae_tb" cellpadding="10">
@ -76,7 +76,7 @@
<a id="st1_[% index %]">
<img id="im[% loop.count %]_[% index %]" src="testopia/img/[% status.name FILTER none %]_gray.gif" width="23" height="23" alt="[% status.name FILTER none %] (disabled)" title="[% status.name FILTER none %](disabled)" border="0" /></a>
[% ELSE %]
<a id="st1_[% index %]" href="javascript:chNote([% index %], [% caserun.id FILTER none %], document.getElementById('notes[% index %]').value); chStat([% index %], [% status.id FILTER none %], [% caserun.id FILTER none %], [% caserun.status_id FILTER none %]);">
<a id="st1_[% index %]" href="javascript: chStat([% index %], [% status.id FILTER none %], [% caserun.id FILTER none %], [% caserun.status_id FILTER none %]);">
<img id="im1_[% index %]" src="testopia/img/[% status.name FILTER none %].gif" width="23" height="23" alt="[% status.name FILTER none %]" title="[% status.name FILTER none %]" border="0" /></a>
[% END %]
</div>

Просмотреть файл

@ -166,9 +166,9 @@
<div id="plan_categories">
<table width="100%" border="0">
<tr class="bz_row_header">
<th><a href="tr_categories.cgi?plan_id=[% plan.id FILTER none %]&product_id=[% plan.product.id FILTER none %]">Categories</a></th>
<th><a href="tr_tags.cgi?plan_id=[% plan.id FILTER none %]">Tags</a></th>
<th><a href="tr_builds.cgi?product_id=[% plan.product.id FILTER none %]&plan_id=[% plan.id FILTER none %]">Builds</a></th>
<th width="33%"><a href="tr_categories.cgi?plan_id=[% plan.id FILTER none %]&product_id=[% plan.product.id FILTER none %]">Categories</a></th>
<th width="33%"><a href="tr_tags.cgi?plan_id=[% plan.id FILTER none %]">Tags</a></th>
<th width="33%"><a href="tr_builds.cgi?product_id=[% plan.product.id FILTER none %]&plan_id=[% plan.id FILTER none %]">Builds</a></th>
</tr>
<tr>
<td align="left">

Просмотреть файл

@ -45,7 +45,7 @@
<script type="text/javascript">
djConfig = {
parseWidgets: false,
searchIds: ["environment","tags","newtag","tagTable","tip_[% run.id FILTER none %]","caseruns_table",[% FOREACH cr = table.list %]"env_[% loop.count %]","head_caserun_[% loop.count %]"[%',' UNLESS loop.last %][% END %]]
searchIds: ["percent_bar","environment","tags","newtag","tagTable","tip_[% run.id FILTER none %]","caseruns_table",[% FOREACH cr = table.list %]"env_[% loop.count %]","head_caserun_[% loop.count %]"[%',' UNLESS loop.last %][% END %]]
};
</script>
<script src="testopia/js/util.js" type="text/javascript"></script>
@ -75,7 +75,7 @@
var id = newcc[i].childNodes[0].firstChild.nodeValue;
var name = newcc[i].childNodes[1].firstChild.nodeValue;
var myOp = new Option(name, id);
cc.add(myOp,null);
addOption(cc,myOp);
}
document.getElementById("newcc").value = '';
document.getElementById("addCC").disabled = false;
@ -91,7 +91,7 @@
url: "tr_show_run.cgi",
content: { cc: cctext, run_id: [% run.id FILTER none %], action: action },
load: function(type, data, evt){ fillcc(data);},
error: function(type, error){ alert("ERROR");},
error: function(type, error){ alert(error.message);},
mimetype: "text/xml"
});
}
@ -146,7 +146,7 @@
</tr>
<tr class="bz_row_data">
<td><a href="mailto:[% run.manager.email FILTER html %]">[% run.manager.identity FILTER html %]</a></td>
<td align="center">
<td align="center" dojoType="ContentPane" id="percent_bar">
[% PROCESS testopia/percent_bar.html.tmpl
percent = run.percent_complete
%]
@ -213,9 +213,9 @@
<div id="run_categories">
<table width="100%" border="0">
<tr class="bz_row_header">
<th>CC List</th>
<th>Case Run Status</th>
<th><a href="tr_tags.cgi?run_id=[% run.id FILTER none %]">Tags</a></th>
<th width="33%">CC List</th>
<th width="33%">Case Run Status</th>
<th width="33%"><a href="tr_tags.cgi?run_id=[% run.id FILTER none %]">Tags</a></th>
</tr>
<tr>
<td valign="top">
@ -283,7 +283,6 @@
<div id="tagTable" dojoType="ContentPane">
[% PROCESS testopia/tag/table.html.tmpl
item = run
type = 'run'
%]
</div>
</td>

Просмотреть файл

@ -20,7 +20,7 @@
<div id="testopia_save_search">
[% IF qname %]
<a href="tr_query.cgi?action=delete_query&query_name=[% qname %]">Delete saved query [% qname FILTER html %]</a>
<a href="tr_query.cgi?action=delete_query&query_name=[% qname FILTER url_quote %]">Delete saved query [% qname FILTER html %]</a>
[% ELSE %]
<form action="tr_query.cgi" method="POST">
<input type="hidden" name="query_part" value="[% table.get_url %][% table.get_query_part %]">

Просмотреть файл

@ -122,16 +122,19 @@ function chStat(idx, sid, cid, osid){
displayMsg('pp'+idx, 3, MSG_WAIT.blink());
disableAllButtons(true);
var upbug = dojo.byId('up_bugs' + idx).checked == true ? 1 : 0;
var stNotes = document.getElementById('notes'+idx).value;
dojo.io.bind({
url: "tr_show_caserun.cgi",
content: { caserun_id: cid, index: idx, status_id: sid, update_bug: upbug, action: 'update_status'},
load: function(type, data, evt){ fillrow(data, idx);
var fields = data.split("|");
var status = fields[0];
var closed = fields[1];
var tested = fields[2];
content: { caserun_id: cid, index: idx, status_id: sid, update_bug: upbug, note: stNotes, action: 'update_status'},
load: function(type, data, evt){
fillrow(data, idx);
var fields = data.split("|~+");
dojo.widget.manager.getWidgetById('percent_bar').setContent(fields[0]);
dojo.widget.manager.getWidgetById('head_caserun_'+idx).setContent(fields[1]);
document.getElementById('body_caserun_'+idx).innerHTML = fields[2];
try{
var deps = fields[3];
var deps = fields[4];
ids = deps.split(",");
for (var i=0; i<ids.length; i++){
if (status == 'FAILED')
@ -141,9 +144,6 @@ function chStat(idx, sid, cid, osid){
}
}
catch (e){}
document.getElementById('xs'+cid).src="testopia/img/"+status+"_small.gif";
document.getElementById('tdb'+idx).innerHTML = tested;
document.getElementById('cld'+idx).innerHTML = closed;
displayMsg('pp'+ idx, 1, MSG_TESTLOG_UPDATED);
setTimeout("clearMsg('pp"+ idx +"')",OK_TIMEOUT);
disableAllButtons(false);
@ -162,12 +162,16 @@ function chNote(idx, cid, note){
url: "tr_show_caserun.cgi",
content: { caserun_id: cid, index: idx, note: note, action: 'update_note'},
load: function(type, data, evt){ fillrow(data, idx);
document.getElementById('notes'+idx).value = '';
document.getElementById('old_notes'+idx).innerHTML = data;
displayMsg('pp'+ idx, 1, MSG_TESTLOG_UPDATED);
fillrow(data, idx);
var fields = data.split("|~+");
dojo.widget.manager.getWidgetById('head_caserun_'+idx).setContent(fields[0]);
document.getElementById('body_caserun_'+idx).innerHTML = fields[1];
document.getElementById('ra'+idx).style.display='block';
document.getElementById('id'+idx).src='testopia/img/td.gif';
displayMsg('pp'+ idx, 1, MSG_TESTLOG_UPDATED);
setTimeout("clearMsg('pp"+ idx +"')",OK_TIMEOUT);
disableAllButtons(false);
getNote(idx,cid);
disableAllButtons(false);
getNote(idx,cid);
},
sync: true,
error: function(type, error){ alert(error.message);},
@ -231,7 +235,12 @@ function attch(idx, cid, bugs){
content: { caserun_id: cid, index: idx, bugs: bugs, action: 'attach_bug'},
load: function(type, data, evt){
document.getElementById('bgl'+idx).innerHTML = data;
displayMsg('pp'+ idx, 1, MSG_BUG_ATTACHED);
if (data.match("Invalid")){
displayMsg('pp'+ idx, 2, "Invalid Bug");
}
else{
displayMsg('pp'+ idx, 1, MSG_BUG_ATTACHED);
}
setTimeout("clearMsg('pp"+ idx +"')",OK_TIMEOUT);
disableAllButtons(false);
},

Просмотреть файл

@ -151,7 +151,7 @@ elsif($action eq 'removeNode'){
elsif ($action eq 'getcategories'){
my $product_id = $cgi->param('product_id');
detaint_natural($product_id);
my $product = Bugzilla::Testtopia::Product->new($product_id);
my $product = Bugzilla::Testopia::Product->new($product_id);
exit unless $product && Bugzilla->user->can_see_product($product->name);
my $cat = Bugzilla::Testopia::Environment::Category({});
my $categories = $cat->get_element_categories_by_product($product_id);

Просмотреть файл

@ -143,7 +143,9 @@ if ($action eq 'Commit'){
}
$vars->{'title'} = "Update Successful";
$vars->{'tr_message'} = $i - scalar @uneditable . " Test Case-Runs Updated";
my $updated = $i - scalar @uneditable;
$vars->{'tr_error'} = scalar @uneditable . " Not updated" if scalar @uneditable > 0;
$vars->{'tr_message'} = "$updated Test Case-Runs Updated";
if ($serverpush && !$cgi->param('debug')) {
print $cgi->multipart_end;
print $cgi->multipart_start;

Просмотреть файл

@ -265,7 +265,8 @@ elsif ($action eq 'save_query'){
$vars->{'tr_message'} = "Updated saved search '$qname'";
}
else{
$query .= "&qname=$qname";
my $quoted_qname = url_quote($qname);
$query .= "&qname=$quoted_qname";
$dbh->do("INSERT INTO test_named_queries
VALUES(?,?,?,?)",
undef, (Bugzilla->user->id, $qname, 1, $query));

Просмотреть файл

@ -166,7 +166,7 @@ elsif ($action eq 'update_build'){
$vars->{'caserun'} = $caserun;
$vars->{'index'} = $cgi->param('index');
$vars->{'updating'} = 1;
$template->process("testopia/caserun/short-form-header.html.tmpl", $vars, \$head_data) ||
ThrowTemplateError($template->error());
$template->process("testopia/caserun/short-form.html.tmpl", $vars, \$body_data) ||
@ -190,6 +190,7 @@ elsif ($action eq 'update_environment'){
my $head_data;
$vars->{'caserun'} = $caserun;
$vars->{'index'} = $cgi->param('index');
$vars->{'updating'} = 1;
$template->process("testopia/caserun/short-form-header.html.tmpl", $vars, \$head_data) ||
ThrowTemplateError($template->error());
$template->process("testopia/caserun/short-form.html.tmpl", $vars, \$body_data) ||
@ -203,13 +204,30 @@ elsif ($action eq 'update_status'){
exit;
}
my $status_id = $cgi->param('status_id');
my $note = $cgi->param('note');
detaint_natural($status_id);
trick_taint($note) if $note;
$caserun->set_status($status_id, $cgi->param('update_bug'));
print $caserun->status ."|". $caserun->close_date ."|". $caserun->testedby->login;
$caserun->append_note($note) if $note;
my $percent_data;
my $body_data;
my $head_data;
$vars->{'caserun'} = $caserun;
$vars->{'index'} = $cgi->param('index');
$vars->{'run'} = $caserun->run;
$vars->{'updating'} = 1;
$template->process("testopia/percent_bar.html.tmpl", $vars, \$percent_data) ||
ThrowTemplateError($template->error());
$template->process("testopia/caserun/short-form-header.html.tmpl", $vars, \$head_data) ||
ThrowTemplateError($template->error());
$template->process("testopia/caserun/short-form.html.tmpl", $vars, \$body_data) ||
ThrowTemplateError($template->error());
print $percent_data . "|~+" . $head_data . "|~+" . $body_data;
if ($caserun->updated_deps) {
print "|". join(',', @{$caserun->updated_deps});
print "|~+". join(',', @{$caserun->updated_deps});
}
}
elsif ($action eq 'update_note'){
@ -220,7 +238,19 @@ elsif ($action eq 'update_note'){
}
my $note = $cgi->param('note');
trick_taint($note);
$caserun->append_note($note);
$caserun->append_note($note);
my $body_data;
my $head_data;
$vars->{'caserun'} = $caserun;
$vars->{'index'} = $cgi->param('index');
$vars->{'updating'} = 1;
$template->process("testopia/caserun/short-form-header.html.tmpl", $vars, \$head_data) ||
ThrowTemplateError($template->error());
$template->process("testopia/caserun/short-form.html.tmpl", $vars, \$body_data) ||
ThrowTemplateError($template->error());
print $head_data . "|~+" . $body_data;
}
elsif ($action eq 'update_assignee'){
my $caserun = Bugzilla::Testopia::TestCaseRun->new($caserun_id);
@ -264,6 +294,7 @@ elsif ($action eq 'attach_bug'){
}
my @buglist;
foreach my $bug (split(/[\s,]+/, $cgi->param('bugs'))){
Bugzilla->batch(1);
eval{
ValidateBugID($bug);
};

Просмотреть файл

@ -281,6 +281,7 @@ elsif ($action eq 'addcc'){
$run->add_cc($ccid);
}
my $cc = get_cc_xml($run);
print $cgi->header;
print $cc;
}
elsif ($action eq 'removecc'){
@ -291,6 +292,7 @@ elsif ($action eq 'removecc'){
$run->remove_cc($ccid);
}
my $cc = get_cc_xml($run);
print $cgi->header;
print $cc;
}
elsif ($action eq 'Delete'){