- $lxdebug->leave_sub();
-}
-
-sub project_report {
- $lxdebug->enter_sub();
-
- map { $form->{$_} = $form->unescape($form->{$_}) }
- (projectnumber, description);
- PE->projects(\%myconfig, \%$form);
-
- $callback =
- "$form->{script}?action=project_report&type=$form->{type}&login=$form->{login}&password=$form->{password}&status=$form->{status}&active=" .
- E($form->{active});
- $href = $callback;
-
- if ($form->{status} eq 'all') {
- $option = $locale->text('All');
- }
- if ($form->{status} eq 'orphaned') {
- $option .= $locale->text('Orphaned');
- }
- if ($form->{projectnumber}) {
- $href .= "&projectnumber=" . $form->escape($form->{projectnumber});
- $callback .= "&projectnumber=$form->{projectnumber}";
- $option .=
- "\n<br>" . $locale->text('Project') . " : $form->{projectnumber}";
- }
- if ($form->{description}) {
- $href .= "&description=" . $form->escape($form->{description});
- $callback .= "&description=$form->{description}";
- $option .=
- "\n<br>" . $locale->text('Description') . " : $form->{description}";
- }
-
- @column_index = qw(projectnumber description);
-
- push(@column_index, "active") if ("both" eq $form->{active});
-
- $column_header{projectnumber} =
- qq|<th><a class=listheading href=$href&sort=projectnumber>|
- . $locale->text('Number')
- . qq|</a></th>|;
- $column_header{description} =
- qq|<th><a class=listheading href=$href&sort=description>|
- . $locale->text('Description')
- . qq|</a></th>|;
- $column_header{active} =
- qq|<th class="listheading">| . $locale->text('Active') . qq|</th>|;
-
- $form->{title} = $locale->text('Projects');
-
- $form->header;
-
- print qq|
-<body>
-
-<table width=100%>
- <tr>
- <th class=listtop>$form->{title}</th>
- </tr>
- <tr height="5"></tr>
- <tr>
- <td>$option</td>
- </tr>
- <tr>
- <td>
- <table width=100%>
- <tr class=listheading>
-|;
-
- map { print "$column_header{$_}\n" } @column_index;
-
- print qq|
- </tr>
-|;
-
- # escape callback
- $form->{callback} = $callback .= "&sort=$form->{sort}";
-
- # escape callback for href
- $callback = $form->escape($callback);
-
- foreach $ref (@{ $form->{project_list} }) {
-
- $i++;
- $i %= 2;
-
- print qq|
- <tr valign=top class=listrow$i>
-|;
-
- $column_data{projectnumber} =
- qq|<td><a href=$form->{script}?action=edit&type=$form->{type}&status=$form->{status}&id=$ref->{id}&login=$form->{login}&password=$form->{password}&callback=$callback>$ref->{projectnumber}</td>|;
- $column_data{description} = qq|<td>$ref->{description} </td>|;
- $column_data{active} =
- qq|<td>| .
- ($ref->{active} ? $locale->text("Yes") : $locale->text("No")) .
- qq|</td>|;
-
- map { print "$column_data{$_}\n" } @column_index;
-
- print "
- </tr>
-";
- }
-
- print qq|
- </table>
- </td>
- </tr>
- <tr>
- <td><hr size=3 noshade></td>
- </tr>
-</table>
-
-<br>
-<form method=post action=$form->{script}>
-
-<input name=callback type=hidden value="$form->{callback}">
-
-<input type=hidden name=type value=$form->{type}>
-
-<input type=hidden name=login value=$form->{login}>
-<input type=hidden name=password value=$form->{password}>
-
-<input class=submit type=submit name=action value="|
- . $locale->text('Add') . qq|">
-
- </form>
-
-</body>
-</html>
-|;
-
- $lxdebug->leave_sub();