- remove ability to set testgroup for subgroup. Add links to manage_testgroups.cgi which already provides that functionality.

- change link target on manage_testcases form
This commit is contained in:
ccooper%deadsquid.com 2006-08-09 03:45:08 +00:00
Родитель 5dd3a42e92
Коммит 8f9d724e9a
4 изменённых файлов: 11 добавлений и 27 удалений

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

@ -108,7 +108,6 @@ if ($c->param("delete_subgroup_button")) {
}
} elsif ($c->param("editform_mode")) {
requireField('product', $c->param('product'));
requireField('testgroup', $c->param('testgroup'));
my $enabled = $c->param('editform_enabled') ? 1 : 0;
if ($c->param("editform_mode") eq "add") {
my %hash = (
@ -120,8 +119,6 @@ if ($c->param("delete_subgroup_button")) {
Litmus::DB::Subgroup->create(\%hash);
if ($new_subgroup) {
my @selected_testgroups = $c->param("testgroup");
$new_subgroup->update_testgroups(\@selected_testgroups);
my @selected_testcases = $c->param("editform_subgroup_testcases");
$new_subgroup->update_testcases(\@selected_testcases);
$status = "success";
@ -143,8 +140,6 @@ if ($c->param("delete_subgroup_button")) {
$subgroup->name($c->param('editform_name'));
$rv = $subgroup->update();
if ($rv) {
my @selected_testgroups = $c->param("testgroup");
$subgroup->update_testgroups(\@selected_testgroups);
my @selected_testcases = $c->param("editform_subgroup_testcases");
$subgroup->update_testcases(\@selected_testcases);
$status = "success";

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

@ -34,7 +34,6 @@ function checkFormContents(f) {
return (
checkString(f.editform_name, 'Name') &&
verifySelected(f.product, 'Product') &&
verifySelected(f.testgroup, 'Testgroup')
);
}
@ -79,7 +78,9 @@ var manageTestcasesHelpText="<p>The select box on the left contains all the test
</tr>
<tr>
<td class="headerleft">Test Group(s):</td>
<td>[% INCLUDE testgroupbox %]</td>
<td colspan="2">
<div id="testgroups_link_display">[% IF testgroups.size==0 %]<span class="errorHeading">This testcase does not belong to any testgroups that are currently enabled.</span>[% ELSE %][% FOREACH testgroup=testgroups %][% testgroup.name | html %][% UNLESS loop.last %], [% END %][% END %][% END %]</div>
</td>
</tr>
<tr>
<td class="headerleft">Enabled?</td>

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

@ -150,37 +150,25 @@ function populateSubgroup(data) {
options[0].selected = true;
}
changeProduct();
var found_testgroup = 0;
if (subgroup.testgroups[0]) {
var testgroup_box = document.getElementById('testgroup');
options = testgroup_box.getElementsByTagName('option');
for (var i=0; i<options.length; i++) {
if (options[i].value == subgroup.testgroups[0].testgroup_id) {
options[i].selected = true;
found_testgroup=1;
} else {
options[i].selected = false;
}
}
}
if (found_testgroup == 0) {
if (options[0]) {
options[0].selected = true;
}
}
var testgroups_text = "";
var testgroups_link_text = "";
for (var i in subgroup.testgroups) {
if (subgroup.testgroups[i].name != '') {
testgroups_text = testgroups_text + subgroup.testgroups[i].name + ', ';
testgroups_link_text = testgroups_link_text + '<a target="manage_testgroups" href="manage_testgroups.cgi?testgroup_id=' + subgroup.testgroups[i].testgroup_id + '">'+ subgroup.testgroups[i].name + '</a>, ';
}
}
if (testgroups_text != '') {
testgroups_text = testgroups_text.replace(/, $/g,'');
testgroups_link_text = testgroups_link_text.replace(/, $/g,'');
document.getElementById('testgroups_display').innerHTML = testgroups_text;
document.getElementById('testgroups_link_display').innerHTML = testgroups_link_text;
} else {
document.getElementById('testgroups_display').innerHTML = '<span class="errorHeading">This subgroup does not belong to any testgroups that are currently enabled.</span>';
document.getElementById('testgroups_link_display').innerHTML = '<span class="errorHeading">This subgroup does not belong to any testgroups that are currently enabled &rArr;&nbsp;<a target="manage_testgroups" href="manage_testgroups.cgi">Jump to Manage Testgroups</a>.</span>';
}
changeTestgroup();
var enabled_em = document.getElementById('editform_enabled')
if (subgroup.enabled == 1) {

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

@ -182,7 +182,7 @@ function populateTestcase(data) {
document.getElementById('testgroups_link_display').innerHTML = testgroups_link_text;
} else {
document.getElementById('testgroups_display').innerHTML = '<span class="errorHeading">This testcase does not belong to any testgroups that are currently enabled.</span>';
document.getElementById('testgroups_link_display').innerHTML = '<span class="errorHeading">This testcase does not belong to any testgroups that are currently enabled &rArr;&nbsp;<a target="manage_subgroups" href="manage_testgroups.cgi">Jump to Manage Testgroups</a>.</span>';
document.getElementById('testgroups_link_display').innerHTML = '<span class="errorHeading">This testcase does not belong to any testgroups that are currently enabled &rArr;&nbsp;<a target="manage_testgroups" href="manage_testgroups.cgi">Jump to Manage Testgroups</a>.</span>';
}
var subgroups_text = "";