- my @column_index = qw(ndx projectnumber description);
-
- my %column_data;
- $column_data{ndx} = qq|<th> </th>|;
- $column_data{projectnumber} = qq|<th>| . $locale->text('Number') . qq|</th>|;
- $column_data{description} =
- qq|<th>| . $locale->text('Description') . qq|</th>|;
-
- # list items with radio button on a form
- $form->header;
-
- my $title = $locale->text('Select from one of the projects below');
-
- print qq|
-<body>
-
-<form method=post action=$form->{script}>
-
-<input type=hidden name=rownumber value=$form->{rownumber}>
-
-<table width=100%>
- <tr>
- <th class=listtop>$title</th>
- </tr>
- <tr space=5></tr>
- <tr>
- <td>
- <table width=100%>
- <tr class=listheading>|;
-
- map { print "\n$column_data{$_}" } @column_index;
-
- print qq|
- </tr>
-|;
-
- my $i = 0;
- my $j;
- foreach my $ref (@{ $form->{project_list} }) {
- my $checked = ($i++) ? "" : "checked";
-
- $ref->{name} =~ s/\"/"/g;
-
- $column_data{ndx} =
- qq|<td><input name=ndx class=radio type=radio value=$i $checked></td>|;
- $column_data{projectnumber} =
- qq|<td><input name="new_projectnumber_$i" type=hidden value="$ref->{projectnumber}">$ref->{projectnumber}</td>|;
- $column_data{description} = qq|<td>$ref->{description}</td>|;
-
- $j++;
- $j %= 2;
- print qq|
- <tr class=listrow$j>|;
-
- map { print "\n$column_data{$_}" } @column_index;
-
- print qq|
- </tr>
-
-<input name="new_id_$i" type=hidden value=$ref->{id}>
-
-|;
-
- }
-
- print qq|
- </table>
- </td>
- </tr>
- <tr>
- <td><hr size=3 noshade></td>
- </tr>
-</table>
-
-<input name=lastndx type=hidden value=$i>
-
-|;
-
- # delete action variable
- map { delete $form->{$_} } qw(action project_list header update);